From 973ccb68553c9080f25fe1cffd49caebd3ec94a4 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:55:31 -0400 Subject: [PATCH 1/2] fix(pycairo): fix later versions of pycairo --- overrides/build-systems.json | 6 ++++++ overrides/default.nix | 42 +++++++++++++++++------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/overrides/build-systems.json b/overrides/build-systems.json index 6a7ed4714..a6b22881d 100644 --- a/overrides/build-systems.json +++ b/overrides/build-systems.json @@ -14247,6 +14247,9 @@ "setuptools", "setuptools-scm" ], + "pygobject": [ + "setuptools" + ], "pygobject-stubs": [ "setuptools" ], @@ -16389,6 +16392,9 @@ "python-monkey-business": [ "setuptools" ], + "python-mpd2": [ + "setuptools" + ], "python-mpv-jsonipc": [ "setuptools" ], diff --git a/overrides/default.nix b/overrides/default.nix index 807797fe2..461790023 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2122,31 +2122,29 @@ lib.composeManyExtensions [ ) else super.pyarrow; - pycairo = ( - drv: ( - drv.overridePythonAttrs ( - _: { - format = "other"; - } - ) - ).overridePythonAttrs ( - old: { + pycairo = super.pycairo.overridePythonAttrs ( + old: { + format = "other"; + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ + self.meson + pkgs.ninja + pkg-config + ]; - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ - self.meson - pkgs.ninja - pkg-config - ]; + propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ + pkgs.cairo + ]; - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ - pkgs.cairo - ]; + preBuild = '' + cd ../ + ''; - mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ]; - } - ) - ) - super.pycairo; + postBuild = '' + cd build + ''; + mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ]; + } + ); pycocotools = super.pycocotools.overridePythonAttrs ( old: { From 63f51bf85c9061dc443b515e4e91e5f580a96777 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:55:53 -0400 Subject: [PATCH 2/2] chore: add gobject-introspection test --- tests/default.nix | 1 + tests/gobject-introspection/default.nix | 10 ++++ .../gobject_introspection_test/__init__.py | 5 ++ tests/gobject-introspection/poetry.lock | 57 +++++++++++++++++++ tests/gobject-introspection/pyproject.toml | 14 +++++ 5 files changed, 87 insertions(+) create mode 100644 tests/gobject-introspection/default.nix create mode 100644 tests/gobject-introspection/gobject_introspection_test/__init__.py create mode 100644 tests/gobject-introspection/poetry.lock create mode 100644 tests/gobject-introspection/pyproject.toml diff --git a/tests/default.nix b/tests/default.nix index e8dd71b25..3a54db185 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -145,6 +145,7 @@ in subdirectory = callTest ./subdirectory { }; plyvel = callTest ./plyvel { }; awsume = callTest ./awsume { }; + gobject-introspection = callTest ./gobject-introspection { }; } // lib.optionalAttrs (!stdenv.isDarwin) { # pyqt5 = (callTest ./pyqt5 { }); pyqt6 = callTest ./pyqt6 { }; diff --git a/tests/gobject-introspection/default.nix b/tests/gobject-introspection/default.nix new file mode 100644 index 000000000..5023a8c32 --- /dev/null +++ b/tests/gobject-introspection/default.nix @@ -0,0 +1,10 @@ +{ pkgs, poetry2nix, python310 }: + +poetry2nix.mkPoetryApplication { + python = python310; + projectDir = ./.; + pythonImportsCheck = [ "gobject_introspection_test" ]; + + buildInputs = [ pkgs.libnotify ]; + nativeBuildInputs = [ pkgs.gobject-introspection ]; +} diff --git a/tests/gobject-introspection/gobject_introspection_test/__init__.py b/tests/gobject-introspection/gobject_introspection_test/__init__.py new file mode 100644 index 000000000..be3973712 --- /dev/null +++ b/tests/gobject-introspection/gobject_introspection_test/__init__.py @@ -0,0 +1,5 @@ +import gi + +gi.require_version("Notify", "0.7") + +from gi.repository import Notify # noqa: E402, F401 diff --git a/tests/gobject-introspection/poetry.lock b/tests/gobject-introspection/poetry.lock new file mode 100644 index 000000000..32efb9b1b --- /dev/null +++ b/tests/gobject-introspection/poetry.lock @@ -0,0 +1,57 @@ +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. + +[[package]] +name = "pycairo" +version = "1.25.1" +description = "Python interface for cairo" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycairo-1.25.1-cp310-cp310-win32.whl", hash = "sha256:cacb5c2abbfdfc79c728ab261ff791511e4957b606c660f9b380975b678b728f"}, + {file = "pycairo-1.25.1-cp310-cp310-win_amd64.whl", hash = "sha256:109ebbeb5bbc510b726fc31251071264dec241e5084d0668f846d7e17e5af8e0"}, + {file = "pycairo-1.25.1-cp310-cp310-win_arm64.whl", hash = "sha256:b19269a8bf9ab5e3c617f2699bed00977fd02ff304339a233654456c0236f7c6"}, + {file = "pycairo-1.25.1-cp311-cp311-win32.whl", hash = "sha256:b10e58a3ce41e487aae15050b630742e880d4135cee7a69cee2c0ea2a0b4bd0a"}, + {file = "pycairo-1.25.1-cp311-cp311-win_amd64.whl", hash = "sha256:fcf5511b05a652a0ef87f626bf26bfc1b796a67f0d1bd40781c62986fb41c356"}, + {file = "pycairo-1.25.1-cp311-cp311-win_arm64.whl", hash = "sha256:4133ba3ef6d875aa1b16643dc0801846f463b8e78750f5308c41902dfeac5b9a"}, + {file = "pycairo-1.25.1-cp312-cp312-win32.whl", hash = "sha256:56fee2837a07ecd914f4fbf78ff59445f78becd658fe36125101925dd489eb94"}, + {file = "pycairo-1.25.1-cp312-cp312-win_amd64.whl", hash = "sha256:fb31eec2c41ec74e23dc0fc9feb4007b4c37f78ec76220ed92530b342e09821a"}, + {file = "pycairo-1.25.1-cp312-cp312-win_arm64.whl", hash = "sha256:27011d822952d7817130fc17f490de94328590bc8d45bdbca9ec4a47039fca22"}, + {file = "pycairo-1.25.1-cp38-cp38-win32.whl", hash = "sha256:9a7c5ed92fe87f60e9796777d5255f2df2deeb8ab1e3c296e67a1d8c9790808c"}, + {file = "pycairo-1.25.1-cp38-cp38-win_amd64.whl", hash = "sha256:48603ad31616140ad6fa097f13086d0ce8f29ead35ad6a215962f3b0496a5a70"}, + {file = "pycairo-1.25.1-cp39-cp39-win32.whl", hash = "sha256:97666c084e9eb1c08c7fd6d306d153767acdf03c0d80349ec55863cecd4138e0"}, + {file = "pycairo-1.25.1-cp39-cp39-win_amd64.whl", hash = "sha256:ac5437d140eccd97af12a618cc1ace0d9a85f1269f29e963751949f132828b21"}, + {file = "pycairo-1.25.1-cp39-cp39-win_arm64.whl", hash = "sha256:bda5d10adbf1f5eba6b524b5a70ccf7f659680b77e691ff94b312f25a6fcc91f"}, + {file = "pycairo-1.25.1.tar.gz", hash = "sha256:7e2be4fbc3b4536f16db7a11982cbf713e75069a4d73d44fe5a49b68423f5c0c"}, +] + +[[package]] +name = "pygobject" +version = "3.46.0" +description = "Python bindings for GObject Introspection" +optional = false +python-versions = ">=3.8, <4" +files = [ + {file = "PyGObject-3.46.0.tar.gz", hash = "sha256:481437b05af0a66b7c366ea052710eb3aacbb979d22d30b797f7ec29347ab1e6"}, +] + +[package.dependencies] +pycairo = ">=1.16,<2.0" + +[[package]] +name = "python-mpd2" +version = "3.1.0" +description = "A Python MPD client library" +optional = false +python-versions = ">=3.6" +files = [ + {file = "python-mpd2-3.1.0.tar.gz", hash = "sha256:f33c2cdb0d6baa74a36724f38c1c4a099a7ce2c8ec4a2bb7192150a5855df476"}, + {file = "python_mpd2-3.1.0-py2.py3-none-any.whl", hash = "sha256:c4d44a54e88a675f7301fdb11a1bd31165a6f51a664dd41e8137e92f7b02ebfb"}, +] + +[package.extras] +twisted = ["Twisted"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.10" +content-hash = "ffc58c5ce1725e8af5358125f8c993e3c85f90445c5f8568a48b5e68bda3382f" diff --git a/tests/gobject-introspection/pyproject.toml b/tests/gobject-introspection/pyproject.toml new file mode 100644 index 000000000..5905ae192 --- /dev/null +++ b/tests/gobject-introspection/pyproject.toml @@ -0,0 +1,14 @@ +[tool.poetry] +name = "gobject-introspection-test" +version = "0.1.0" +description = "" +authors = ["You "] + +[tool.poetry.dependencies] +python = "^3.10" +python-mpd2 = "^3.1.0" +PyGObject = "^3.46.0" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"