From 0be52475d81e5ff0089dad311efe5213ee17ff16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 18:56:44 -0700 Subject: [PATCH 1/7] python311Packages.pycountry: don't use importlib-metadata --- .../python-modules/pycountry/default.nix | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/pycountry/default.nix b/pkgs/development/python-modules/pycountry/default.nix index bc5b1d00192ee7..75287c6cbf6b24 100644 --- a/pkgs/development/python-modules/pycountry/default.nix +++ b/pkgs/development/python-modules/pycountry/default.nix @@ -1,8 +1,9 @@ { lib , buildPythonPackage -, fetchPypi +, pythonOlder +, fetchFromGitHub +, fetchpatch2 , poetry-core -, importlib-metadata , pytestCheckHook }: @@ -11,17 +12,33 @@ buildPythonPackage rec { version = "23.12.11"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-AFadgurvvGpJCjEb+oSpxXHP+d2/iwpPTntPhotK2SU="; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "pycountry"; + repo = "pycountry"; + rev = "refs/tags/${version}"; + hash = "sha256-B6kphZZZgK0YuPSmkiQNbEqEfqOQb+WZGnO2UeEqQN4="; }; - propagatedBuildInputs = [ + patches = [ + (fetchpatch2 { + name = "fix-usage-of-importlib_metadata.patch"; + url = "https://github.com/pycountry/pycountry/commit/824d2535833d061c04a1f1b6b964f42bb53bced2.patch"; + excludes = [ "HISTORY.txt" "poetry.lock" "pyproject.toml" ]; + hash = "sha256-U4fbZP++d6YfTJkVG3k2rBC8nOF9NflM6+ONlwBNu+g="; + }) + ]; + + postPatch = '' + sed -i "/addopts/d" pytest.ini + ''; + + nativeBuildInputs = [ poetry-core ]; nativeCheckInputs = [ - importlib-metadata pytestCheckHook ]; @@ -29,11 +46,11 @@ buildPythonPackage rec { "pycountry" ]; - meta = with lib; { - homepage = "https://github.com/flyingcircusio/pycountry"; + meta = { + homepage = "https://github.com/pycountry/pycountry"; + changelog = "https://github.com/pycountry/pycountry/blob/${src.rev}/HISTORY.txt"; description = "ISO country, subdivision, language, currency and script definitions and their translations"; - license = licenses.lgpl2; - maintainers = with maintainers; [ ]; + license = lib.licenses.lgpl21Plus; + maintainers = with lib.maintainers; [ dotlambda ]; }; - } From 253e46dfaf6a6b0b7fbc87daca12266046c4cdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 18:54:34 -0700 Subject: [PATCH 2/7] python311Packages.radios: 0.3.0 -> 0.3.1 Diff: https://github.com/frenck/python-radios/compare/v0.3.0...v0.3.1 Changelog: https://github.com/frenck/python-radios/releases/tag/v0.3.1 --- pkgs/development/python-modules/radios/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/radios/default.nix b/pkgs/development/python-modules/radios/default.nix index 15d515086024d1..5831579f7df56e 100644 --- a/pkgs/development/python-modules/radios/default.nix +++ b/pkgs/development/python-modules/radios/default.nix @@ -20,7 +20,7 @@ buildPythonPackage rec { pname = "radios"; - version = "0.3.0"; + version = "0.3.1"; pyproject = true; disabled = pythonOlder "3.11"; @@ -30,7 +30,7 @@ buildPythonPackage rec { owner = "frenck"; repo = "python-radios"; rev = "v${version}"; - hash = "sha256-bzo+SA8kqc2GcxSV0TiIJyPVG+JshdsMoXSUhZYSphU="; + hash = "sha256-c0zfpfEdZvjvKtwGcNLLgEkBihhtz/wouHuYRLCxtBY="; }; postPatch = '' @@ -71,6 +71,7 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; meta = with lib; { + changelog = "https://github.com/frenck/python-radios/releases/tag/v${version}"; description = "Asynchronous Python client for the Radio Browser API"; homepage = "https://github.com/frenck/python-radios"; license = licenses.mit; From 602141b1a228a576d0738f5919fbc9078af6bf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 19:15:14 -0700 Subject: [PATCH 3/7] python311Packages.xhtml2pdf: 0.2.13 -> 0.2.15 Diff: https://github.com/xhtml2pdf/xhtml2pdf/compare/refs/tags/v0.2.13...v0.2.15 Changelog: https://github.com/xhtml2pdf/xhtml2pdf/releases/tag/v0.2.15 --- .../python-modules/xhtml2pdf/default.nix | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/xhtml2pdf/default.nix b/pkgs/development/python-modules/xhtml2pdf/default.nix index f1c0d836bf7468..f223e63c7f0ece 100644 --- a/pkgs/development/python-modules/xhtml2pdf/default.nix +++ b/pkgs/development/python-modules/xhtml2pdf/default.nix @@ -2,36 +2,59 @@ , arabic-reshaper , buildPythonPackage , fetchFromGitHub +, fetchpatch2 , html5lib , pillow , pyhanko +, pyhanko-certvalidator , pypdf , pytestCheckHook , python-bidi , pythonOlder +, pythonRelaxDepsHook , reportlab +, setuptools , svglib }: buildPythonPackage rec { pname = "xhtml2pdf"; - version = "0.2.13"; + version = "0.2.15"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "xhtml2pdf"; + repo = "xhtml2pdf"; rev = "refs/tags/v${version}"; - hash = "sha256-K7gsTLYcXmKmEQzOXrJ2kvvLzKaDkZ/NRLRc0USii5M="; + hash = "sha256-JXxh/n1kUsy3O4P/6WTfa5p+mYy/t4ZBUhlHp+ypoQc="; }; + patches = [ + # https://github.com/xhtml2pdf/xhtml2pdf/pull/754 + (fetchpatch2 { + name = "reportlab-compat.patch"; + url = "https://github.com/xhtml2pdf/xhtml2pdf/commit/1252510bd23b833b45b4d252aeac62c1eb51eeef.patch"; + hash = "sha256-9Fkn086uh2biabmiChbBna8Q4lJV/604yX1ng9j5TGs="; + }) + ]; + + nativeBuildInputs = [ + pythonRelaxDepsHook + setuptools + ]; + + pythonRelaxDeps = [ + "reportlab" + ]; + propagatedBuildInputs = [ arabic-reshaper html5lib pillow pyhanko + pyhanko-certvalidator pypdf python-bidi reportlab From d34b8732e1214c2955fe87ebc012c764336785e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 19:25:44 -0700 Subject: [PATCH 4/7] python311Packages.pydantic-extra-types: refactor --- .../python-modules/pydantic-extra-types/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pydantic-extra-types/default.nix b/pkgs/development/python-modules/pydantic-extra-types/default.nix index 04e79239d81da8..7595ac0b1d5732 100644 --- a/pkgs/development/python-modules/pydantic-extra-types/default.nix +++ b/pkgs/development/python-modules/pydantic-extra-types/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { pname = "pydantic-extra-types"; version = "2.6.0"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "pydantic"; @@ -45,11 +45,8 @@ buildPythonPackage rec { pytestCheckHook ] ++ passthru.optional-dependencies.all; - pytestFlagsArray = [ - "-W" "ignore::DeprecationWarning" - ]; - meta = with lib; { + changelog = "https://github.com/pydantic/pydantic-extra-types/blob/${src.rev}/HISTORY.md"; description = "Extra Pydantic types"; homepage = "https://github.com/pydantic/pydantic-extra-types"; license = licenses.mit; From afea7eb53b1680b1d61931976ea83a5032d0c3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 19:54:14 -0700 Subject: [PATCH 5/7] python311Packages.woob: fix build --- .../python-modules/woob/default.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/woob/default.nix b/pkgs/development/python-modules/woob/default.nix index 72f390df41f545..fcb0211a13aa83 100644 --- a/pkgs/development/python-modules/woob/default.nix +++ b/pkgs/development/python-modules/woob/default.nix @@ -3,21 +3,19 @@ , buildPythonPackage , fetchFromGitLab , fetchpatch -, gnupg , html2text -, libyaml , lxml -, nose , packaging , pillow , prettytable , pycountry +, pytestCheckHook , python-dateutil , pythonOlder , pyyaml , requests , rich -, termcolor +, setuptools , testers , unidecode , woob @@ -26,27 +24,25 @@ buildPythonPackage rec { pname = "woob"; version = "3.6"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchFromGitLab { owner = "woob"; - repo = pname; + repo = "woob"; rev = version; hash = "sha256-M9AjV954H1w64YGCVxDEGGSnoEbmocG3zwltob6IW04="; }; nativeBuildInputs = [ - packaging + setuptools ]; propagatedBuildInputs = [ babel python-dateutil - gnupg html2text - libyaml lxml packaging pillow @@ -55,17 +51,18 @@ buildPythonPackage rec { pyyaml requests rich - termcolor unidecode ]; nativeCheckInputs = [ - nose + pytestCheckHook ]; - checkPhase = '' - nosetests - ''; + disabledTests = [ + # require networking + "test_ciphers" + "test_verify" + ]; pythonImportsCheck = [ "woob" @@ -77,6 +74,7 @@ buildPythonPackage rec { }; meta = with lib; { + changelog = "https://gitlab.com/woob/woob/-/blob/${src.rev}/ChangeLog"; description = "Collection of applications and APIs to interact with websites"; homepage = "https://woob.tech"; license = licenses.lgpl3Plus; From 01eb61122c80d3257499819d4845734214249555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 20:07:25 -0700 Subject: [PATCH 6/7] streamlink: fix build --- pkgs/applications/video/streamlink/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/video/streamlink/default.nix b/pkgs/applications/video/streamlink/default.nix index 2eda19313e1c37..3b3051d924bcaa 100644 --- a/pkgs/applications/video/streamlink/default.nix +++ b/pkgs/applications/video/streamlink/default.nix @@ -7,13 +7,17 @@ python3Packages.buildPythonApplication rec { pname = "streamlink"; version = "6.7.0"; - format = "pyproject"; + pyproject = true; src = fetchPypi { inherit pname version; hash = "sha256-kjrDJ/QCccWxRLEQ0virAdm0TLxN5PmtO/Zs+4Nc1MM="; }; + nativeBuildInputs = with python3Packages; [ + setuptools + ]; + nativeCheckInputs = with python3Packages; [ pytestCheckHook mock From 57b84021f7f9dc7a9a53c8dab7177645d6205d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 12 Mar 2024 20:13:31 -0700 Subject: [PATCH 7/7] streamlink: don't propagate ffmpeg --- pkgs/applications/video/streamlink/default.nix | 17 ++++++++++++++--- .../video/streamlink/ffmpeg-path.patch | 13 +++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/video/streamlink/ffmpeg-path.patch diff --git a/pkgs/applications/video/streamlink/default.nix b/pkgs/applications/video/streamlink/default.nix index 3b3051d924bcaa..c71e712625c248 100644 --- a/pkgs/applications/video/streamlink/default.nix +++ b/pkgs/applications/video/streamlink/default.nix @@ -1,6 +1,7 @@ { lib , python3Packages , fetchPypi +, substituteAll , ffmpeg }: @@ -14,6 +15,13 @@ python3Packages.buildPythonApplication rec { hash = "sha256-kjrDJ/QCccWxRLEQ0virAdm0TLxN5PmtO/Zs+4Nc1MM="; }; + patches = [ + (substituteAll { + src = ./ffmpeg-path.patch; + ffmpeg = lib.getExe ffmpeg; + }) + ]; + nativeBuildInputs = with python3Packages; [ setuptools ]; @@ -27,7 +35,12 @@ python3Packages.buildPythonApplication rec { pytest-trio ]; - propagatedBuildInputs = (with python3Packages; [ + disabledTests = [ + # requires ffmpeg to be in PATH + "test_no_cache" + ]; + + propagatedBuildInputs = with python3Packages; [ certifi isodate lxml @@ -40,8 +53,6 @@ python3Packages.buildPythonApplication rec { typing-extensions urllib3 websocket-client - ]) ++ [ - ffmpeg ]; meta = with lib; { diff --git a/pkgs/applications/video/streamlink/ffmpeg-path.patch b/pkgs/applications/video/streamlink/ffmpeg-path.patch new file mode 100644 index 00000000000000..6108c53dcf0be1 --- /dev/null +++ b/pkgs/applications/video/streamlink/ffmpeg-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/streamlink/stream/ffmpegmux.py b/src/streamlink/stream/ffmpegmux.py +index 258b314a..c493e010 100644 +--- a/src/streamlink/stream/ffmpegmux.py ++++ b/src/streamlink/stream/ffmpegmux.py +@@ -80,7 +80,7 @@ class MuxedStream(Stream, Generic[TSubstreams]): + + + class FFMPEGMuxer(StreamIO): +- __commands__: ClassVar[List[str]] = ["ffmpeg"] ++ __commands__: ClassVar[List[str]] = ["@ffmpeg@"] + + DEFAULT_OUTPUT_FORMAT = "matroska" + DEFAULT_VIDEO_CODEC = "copy"