diff --git a/pkgs/applications/video/streamlink/default.nix b/pkgs/applications/video/streamlink/default.nix index 2eda19313e1c37..c71e712625c248 100644 --- a/pkgs/applications/video/streamlink/default.nix +++ b/pkgs/applications/video/streamlink/default.nix @@ -1,19 +1,31 @@ { lib , python3Packages , fetchPypi +, substituteAll , ffmpeg }: python3Packages.buildPythonApplication rec { pname = "streamlink"; version = "6.7.0"; - format = "pyproject"; + pyproject = true; src = fetchPypi { inherit pname version; hash = "sha256-kjrDJ/QCccWxRLEQ0virAdm0TLxN5PmtO/Zs+4Nc1MM="; }; + patches = [ + (substituteAll { + src = ./ffmpeg-path.patch; + ffmpeg = lib.getExe ffmpeg; + }) + ]; + + nativeBuildInputs = with python3Packages; [ + setuptools + ]; + nativeCheckInputs = with python3Packages; [ pytestCheckHook mock @@ -23,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 @@ -36,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" 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 ]; }; - } 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; 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; 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; 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