From eef1570cd5241ed18257dd980af6e3f47a521eaa Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Jan 2023 10:22:12 +0100 Subject: [PATCH 1/3] python310Packages.audio-metadata: relax more-itertools constraint --- .../python-modules/audio-metadata/default.nix | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/audio-metadata/default.nix b/pkgs/development/python-modules/audio-metadata/default.nix index fc3adf2534e7..a96983732cd8 100644 --- a/pkgs/development/python-modules/audio-metadata/default.nix +++ b/pkgs/development/python-modules/audio-metadata/default.nix @@ -1,25 +1,36 @@ -{ lib, buildPythonPackage, fetchPypi +{ lib +, buildPythonPackage +, fetchPypi , attrs , bidict , bitstruct , more-itertools , pprintpp , tbm-utils +, pythonRelaxDepsHook +, pythonOlder }: buildPythonPackage rec { pname = "audio-metadata"; version = "0.11.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; sha256 = "9e7ba79d49cf048a911d5f7d55bb2715c10be5c127fe5db0987c5fe1aa7335eb"; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "'attrs>=18.2,<19.4'" "'attrs'" - ''; + pythonRelaxDeps = [ + "attrs" + "more-itertools" + ]; + + nativeBuildInputs = [ + pythonRelaxDepsHook + ]; propagatedBuildInputs = [ attrs @@ -33,9 +44,14 @@ buildPythonPackage rec { # No tests doCheck = false; + pythonImportsCheck = [ + "audio_metadata" + ]; + meta = with lib; { homepage = "https://github.com/thebigmunch/audio-metadata"; description = "A library for reading and, in the future, writing metadata from audio files"; + changelog = "https://github.com/thebigmunch/audio-metadata/blob/${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ jakewaksbaum ]; }; From 6d0c7f746f92669b3dae2b20109b449680e6b083 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Jan 2023 10:54:21 +0100 Subject: [PATCH 2/3] python310Packages.ward: init at 0.67.0b0 --- .../python-modules/ward/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/ward/default.nix diff --git a/pkgs/development/python-modules/ward/default.nix b/pkgs/development/python-modules/ward/default.nix new file mode 100644 index 000000000000..9d438d74258f --- /dev/null +++ b/pkgs/development/python-modules/ward/default.nix @@ -0,0 +1,65 @@ +{ lib +, buildPythonPackage +, click +, click-completion +, click-default-group +, cucumber-tag-expressions +, fetchFromGitHub +, pluggy +, poetry-core +, pprintpp +, pythonOlder +, pythonRelaxDepsHook +, rich +, tomli +}: + +buildPythonPackage rec { + pname = "ward"; + version = "0.67.0b0"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "darrenburns"; + repo = pname; + rev = "refs/tags/release%2F${version}"; + hash = "sha256-4dEMEEPySezgw3dIcYMl56HrhyaYlql9JvtamOn7Y8g="; + }; + + pythonRelaxDeps = [ + "rich" + ]; + + nativeBuildInputs = [ + poetry-core + pythonRelaxDepsHook + ]; + + propagatedBuildInputs = [ + click + rich + tomli + pprintpp + cucumber-tag-expressions + click-default-group + click-completion + pluggy + ]; + + # Fixture is missing. Looks like an issue with the import of the sample file + doCheck = false; + + pythonImportsCheck = [ + "ward" + ]; + + meta = with lib; { + description = "Test framework for Python"; + homepage = "https://github.com/darrenburns/ward"; + changelog = "https://github.com/darrenburns/ward/releases/tag/release%2F${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 48b188ddf43e..dcff126d93ab 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12058,6 +12058,8 @@ self: super: with self; { warcio = callPackage ../development/python-modules/warcio { }; + ward = callPackage ../development/python-modules/ward { }; + warlock = callPackage ../development/python-modules/warlock { }; warrant = callPackage ../development/python-modules/warrant { }; From 4a05ecfd664b120aa3c4df96ded0c0ec10f4f7ab Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Jan 2023 10:59:42 +0100 Subject: [PATCH 3/3] python310Packages.audio-metadata: prepare for running the tests --- .../python-modules/audio-metadata/default.nix | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/audio-metadata/default.nix b/pkgs/development/python-modules/audio-metadata/default.nix index a96983732cd8..d1d6de0bcba8 100644 --- a/pkgs/development/python-modules/audio-metadata/default.nix +++ b/pkgs/development/python-modules/audio-metadata/default.nix @@ -1,34 +1,48 @@ { lib -, buildPythonPackage -, fetchPypi , attrs , bidict , bitstruct +, buildPythonPackage +, fetchFromGitHub +, fetchpatch , more-itertools +, poetry-core , pprintpp -, tbm-utils -, pythonRelaxDepsHook , pythonOlder +, pythonRelaxDepsHook +, tbm-utils }: buildPythonPackage rec { pname = "audio-metadata"; version = "0.11.1"; - format = "setuptools"; + format = "pyproject"; disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - sha256 = "9e7ba79d49cf048a911d5f7d55bb2715c10be5c127fe5db0987c5fe1aa7335eb"; + src = fetchFromGitHub { + owner = "thebigmunch"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-5ZX4HwbuB9ZmFfHuxaMCrn3R7/znuDsoyqqLql2Nizg="; }; + patches = [ + # Switch to poetry-core, https://github.com/thebigmunch/audio-metadata/pull/41 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/thebigmunch/audio-metadata/commit/dfe91a69ee37e9dcefb692165eb0f9cd36a7e5b8.patch"; + hash = "sha256-ut3mqgZQu0YFbsTEA13Ch0+aSNl17ndMV0fuIu3n5tc="; + }) + ]; + pythonRelaxDeps = [ "attrs" "more-itertools" ]; nativeBuildInputs = [ + poetry-core pythonRelaxDepsHook ]; @@ -41,7 +55,7 @@ buildPythonPackage rec { tbm-utils ]; - # No tests + # Tests require ward which is not ready to be used doCheck = false; pythonImportsCheck = [