From aed0db11bae06e49307dbae34ac8367d41a37296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Breda?= Date: Thu, 8 Aug 2024 08:37:56 +0100 Subject: [PATCH 1/6] python31{1,2}Packages.enzyme: 0.4.1 -> 0.5.2 Note the license change: https://github.com/Diaoul/enzyme/pull/37/files#diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7 --- pkgs/development/python-modules/enzyme/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/enzyme/default.nix b/pkgs/development/python-modules/enzyme/default.nix index 47c2abb01ed2..5d969858c00f 100644 --- a/pkgs/development/python-modules/enzyme/default.nix +++ b/pkgs/development/python-modules/enzyme/default.nix @@ -2,24 +2,27 @@ lib, fetchPypi, buildPythonPackage, + setuptools, }: buildPythonPackage rec { pname = "enzyme"; - version = "0.4.1"; - format = "setuptools"; + version = "0.5.2"; + pyproject = true; # Tests rely on files obtained over the network doCheck = false; src = fetchPypi { inherit pname version; - sha256 = "1fv2kh2v4lwj0hhrhj9pib1pdjh01yr4xgyljhx11l94gjlpy5pj"; + hash = "sha256-fPd5FI2eZusoOGA+rOFAxTw878i4/l1NWgOl+11Xs8E="; }; + nativeBuildInputs = [ setuptools ]; + meta = with lib; { homepage = "https://github.com/Diaoul/enzyme"; - license = licenses.asl20; + license = licenses.mit; description = "Python video metadata parser"; }; } From a7c7290b039af68454d7797ee7427ae1d2629d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Breda?= Date: Thu, 8 Aug 2024 08:38:50 +0100 Subject: [PATCH 2/6] python31{1,2}Packages.pysubs2: 1.6.1 -> 1.7.3 --- pkgs/development/python-modules/pysubs2/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pysubs2/default.nix b/pkgs/development/python-modules/pysubs2/default.nix index 71fbf56b77c2..e03a87fffda0 100644 --- a/pkgs/development/python-modules/pysubs2/default.nix +++ b/pkgs/development/python-modules/pysubs2/default.nix @@ -8,14 +8,14 @@ buildPythonPackage rec { pname = "pysubs2"; - version = "1.6.1"; + version = "1.7.3"; format = "pyproject"; src = fetchFromGitHub { owner = "tkarabela"; repo = pname; rev = version; - hash = "sha256-0bW9aB6ERRQK3psqeU0Siyi/8drEGisAp8UtTfOKlp0="; + hash = "sha256-PrpN+w/gCi7S9OmD6kbbvL9VlZEfy1DbehFTwjxsibA="; }; nativeBuildInputs = [ setuptools ]; From 8c07271c4f49457ed665fb81a087381db80b199e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 8 Aug 2024 15:43:21 +0300 Subject: [PATCH 3/6] python31{1,2}Packages.subliminal: reformat expression a bit - Don't use `with lib;` in all of meta scope. - Group arguments with similar purpose together. - Fix a small typo. - Don't use `repo = pname` in src. --- .../python-modules/subliminal/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/subliminal/default.nix b/pkgs/development/python-modules/subliminal/default.nix index d34a49f46ff1..60d1dbd24899 100644 --- a/pkgs/development/python-modules/subliminal/default.nix +++ b/pkgs/development/python-modules/subliminal/default.nix @@ -1,23 +1,25 @@ { lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + appdirs, babelfish, beautifulsoup4, - buildPythonPackage, chardet, click, dogpile-cache, enzyme, - fetchFromGitHub, guessit, pysrt, - pytestCheckHook, - pythonOlder, pytz, rarfile, requests, six, stevedore, + + pytestCheckHook, sympy, vcrpy, }: @@ -31,7 +33,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "Diaoul"; - repo = pname; + repo = "subliminal"; rev = "refs/tags/${version}"; hash = "sha256-P4gVxKKCGKS3MC4F3yTAaOSv36TtdoYfrf61tBHg8VY="; }; @@ -59,15 +61,15 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ + pytestCheckHook sympy vcrpy - pytestCheckHook ]; pythonImportsCheck = [ "subliminal" ]; disabledTests = [ - # Tests rewuire network access + # Tests require network access "test_refine_video_metadata" "test_scan" "test_hash" @@ -84,12 +86,12 @@ buildPythonPackage rec { "tests/test_legendastv.py" ]; - meta = with lib; { + meta = { description = "Python library to search and download subtitles"; homepage = "https://github.com/Diaoul/subliminal"; changelog = "https://github.com/Diaoul/subliminal/blob/${version}/HISTORY.rst"; - license = licenses.mit; - maintainers = with maintainers; [ doronbehar ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ doronbehar ]; # Too many tests fail ever since a certain python-updates merge, see: # https://github.com/Diaoul/subliminal/issues/1062 . Disabling tests # alltogether may produce a not completly failing executable, but that From cead2ccdc6a780605d571894890efd09d706820d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 8 Aug 2024 15:50:27 +0300 Subject: [PATCH 4/6] python31{1,2}Packages.subliminal: 2.1.0 -> 2.2.1; unbreak --- .../python-modules/subliminal/default.nix | 50 ++++++++----------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/pkgs/development/python-modules/subliminal/default.nix b/pkgs/development/python-modules/subliminal/default.nix index 60d1dbd24899..23347af0ff45 100644 --- a/pkgs/development/python-modules/subliminal/default.nix +++ b/pkgs/development/python-modules/subliminal/default.nix @@ -4,64 +4,67 @@ fetchFromGitHub, pythonOlder, - appdirs, babelfish, beautifulsoup4, chardet, click, + click-option-group, dogpile-cache, enzyme, guessit, - pysrt, - pytz, + srt, + pysubs2, rarfile, requests, - six, + platformdirs, stevedore, + tomli, pytestCheckHook, + pytest-cov, + pytest-xdist, + mypy, sympy, vcrpy, }: buildPythonPackage rec { pname = "subliminal"; - version = "2.1.0"; - format = "setuptools"; + version = "2.2.1"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "Diaoul"; repo = "subliminal"; rev = "refs/tags/${version}"; - hash = "sha256-P4gVxKKCGKS3MC4F3yTAaOSv36TtdoYfrf61tBHg8VY="; + hash = "sha256-g7gg2qdLKl7bg/nNXRWN9wZaNShOOc38sVASZrIycMU="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace " --pep8 --flakes" "" - ''; - propagatedBuildInputs = [ - appdirs babelfish beautifulsoup4 chardet click + click-option-group dogpile-cache enzyme guessit - pysrt - pytz + srt + pysubs2 rarfile requests - six + platformdirs stevedore + tomli ]; nativeCheckInputs = [ pytestCheckHook + pytest-cov + pytest-xdist + mypy sympy vcrpy ]; @@ -70,20 +73,9 @@ buildPythonPackage rec { disabledTests = [ # Tests require network access - "test_refine_video_metadata" + "test_refine" "test_scan" "test_hash" - "test_provider_pool_list_subtitles" - "test_async_provider_pool_list_subtitles" - "test_list_subtitles" - "test_download_bad_subtitle" - # Not implemented - "test_save_subtitles" - ]; - - disabledTestPaths = [ - # AttributeError: module 'rarfile' has no attribute 'custom_check' - "tests/test_legendastv.py" ]; meta = { From 1ca92c5641fae066b6c21b54c1051fd458dbde2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Breda?= Date: Thu, 8 Aug 2024 08:40:38 +0100 Subject: [PATCH 5/6] ffsubsync: nixfmt --- pkgs/by-name/ff/ffsubsync/package.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ff/ffsubsync/package.nix b/pkgs/by-name/ff/ffsubsync/package.nix index 10f150a3ccb6..47321cbe5a41 100644 --- a/pkgs/by-name/ff/ffsubsync/package.nix +++ b/pkgs/by-name/ff/ffsubsync/package.nix @@ -1,6 +1,7 @@ -{ lib -, fetchFromGitHub -, python3 +{ + lib, + fetchFromGitHub, + python3, }: python3.pkgs.buildPythonApplication rec { @@ -15,9 +16,7 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-ZdKZeKfAUe/FXLOur9Btb5RgXewmy3EHunQphqlxpIc="; }; - nativeBuildInputs = with python3.pkgs; [ - setuptools - ]; + nativeBuildInputs = with python3.pkgs; [ setuptools ]; propagatedBuildInputs = with python3.pkgs; [ auditok @@ -36,13 +35,9 @@ python3.pkgs.buildPythonApplication rec { webrtcvad ]; - nativeCheckInputs = with python3.pkgs; [ - pytestCheckHook - ]; + nativeCheckInputs = with python3.pkgs; [ pytestCheckHook ]; - pythonImportsCheck = [ - "ffsubsync" - ]; + pythonImportsCheck = [ "ffsubsync" ]; meta = with lib; { homepage = "https://github.com/smacke/ffsubsync"; From 700b1e637c32f50ae7013d7bfd42de967a128547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Breda?= Date: Thu, 8 Aug 2024 08:48:26 +0100 Subject: [PATCH 6/6] ffsubsync: fix build by adding a Python 3.12 patch --- pkgs/by-name/ff/ffsubsync/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/ff/ffsubsync/package.nix b/pkgs/by-name/ff/ffsubsync/package.nix index 47321cbe5a41..f247edf6e2aa 100644 --- a/pkgs/by-name/ff/ffsubsync/package.nix +++ b/pkgs/by-name/ff/ffsubsync/package.nix @@ -1,6 +1,7 @@ { lib, fetchFromGitHub, + fetchpatch, python3, }: @@ -16,6 +17,14 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-ZdKZeKfAUe/FXLOur9Btb5RgXewmy3EHunQphqlxpIc="; }; + patches = [ + # updates for python 3.12 (not currently included in a release) + (fetchpatch { + url = "https://github.com/smacke/ffsubsync/commit/de75bdbfe846b3376f8c0bcfe2e5e5db82d7ff20.patch"; + hash = "sha256-JN7F9H9G8HK2aLOlm/Ec+GsWnU+65f1P658nq8FbAjo="; + }) + ]; + nativeBuildInputs = with python3.pkgs; [ setuptools ]; propagatedBuildInputs = with python3.pkgs; [