From 83fa9e16a6d7fe82262dae23b9b1fb603ece979a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Apr 2024 14:50:37 +0200 Subject: [PATCH 1/6] python311Packages.pprintpp: disable failing tests Not a real fix as the module is not maintained and still using nose. --- .../python-modules/pprintpp/default.nix | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pprintpp/default.nix b/pkgs/development/python-modules/pprintpp/default.nix index c0f98eca75e1..7cdc92cf32d7 100644 --- a/pkgs/development/python-modules/pprintpp/default.nix +++ b/pkgs/development/python-modules/pprintpp/default.nix @@ -2,16 +2,18 @@ , buildPythonPackage , fetchpatch , fetchPypi -, nose , parameterized +, pytestCheckHook +, pynose , python , pythonOlder +, setuptools }: buildPythonPackage rec { pname = "pprintpp"; version = "0.4.0"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -34,25 +36,37 @@ buildPythonPackage rec { }) ]; - nativeCheckInputs = [ - nose - parameterized + build-system = [ + setuptools ]; - checkPhase = '' - ${python.interpreter} test.py - ''; + nativeCheckInputs = [ + parameterized + pynose + pytestCheckHook + ]; pythonImportsCheck = [ "pprintpp" ]; + pytestFlagsArray = [ + "test.py" + ]; + + disabledTests = [ + # AttributeError: 'EncodedFile' object has no attribute 'getvalue' + "test_pp" + "test_pp_pprint" + "test_fmt" + ]; + meta = with lib; { description = "A drop-in replacement for pprint that's actually pretty"; - mainProgram = "pypprint"; homepage = "https://github.com/wolever/pprintpp"; changelog = "https://github.com/wolever/pprintpp/blob/${version}/CHANGELOG.txt"; license = licenses.bsd2; maintainers = with maintainers; [ jakewaksbaum ]; + mainProgram = "pypprint"; }; } From 0b7d864b2a93f774e39a7d6ceb5600c9a1c2a3f3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Apr 2024 14:51:46 +0200 Subject: [PATCH 2/6] python311Packages.pprintpp: format with nixfmt --- .../python-modules/pprintpp/default.nix | 33 ++++++++----------- .../python-modules/ward/default.nix | 18 ++++------ 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/pkgs/development/python-modules/pprintpp/default.nix b/pkgs/development/python-modules/pprintpp/default.nix index 7cdc92cf32d7..0e058cab0560 100644 --- a/pkgs/development/python-modules/pprintpp/default.nix +++ b/pkgs/development/python-modules/pprintpp/default.nix @@ -1,13 +1,14 @@ -{ lib -, buildPythonPackage -, fetchpatch -, fetchPypi -, parameterized -, pytestCheckHook -, pynose -, python -, pythonOlder -, setuptools +{ + lib, + buildPythonPackage, + fetchpatch, + fetchPypi, + parameterized, + pytestCheckHook, + pynose, + python, + pythonOlder, + setuptools, }: buildPythonPackage rec { @@ -36,9 +37,7 @@ buildPythonPackage rec { }) ]; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; nativeCheckInputs = [ parameterized @@ -46,13 +45,9 @@ buildPythonPackage rec { pytestCheckHook ]; - pythonImportsCheck = [ - "pprintpp" - ]; + pythonImportsCheck = [ "pprintpp" ]; - pytestFlagsArray = [ - "test.py" - ]; + pytestFlagsArray = [ "test.py" ]; disabledTests = [ # AttributeError: 'EncodedFile' object has no attribute 'getvalue' diff --git a/pkgs/development/python-modules/ward/default.nix b/pkgs/development/python-modules/ward/default.nix index f73cae95e25e..b1f7345f8413 100644 --- a/pkgs/development/python-modules/ward/default.nix +++ b/pkgs/development/python-modules/ward/default.nix @@ -9,35 +9,29 @@ , poetry-core , pprintpp , pythonOlder -, pythonRelaxDepsHook , rich , tomli }: buildPythonPackage rec { pname = "ward"; - version = "0.67.0b0"; - format = "pyproject"; + version = "0.68.0b0"; + pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "darrenburns"; - repo = pname; + repo = "ward"; rev = "refs/tags/release%2F${version}"; hash = "sha256-4dEMEEPySezgw3dIcYMl56HrhyaYlql9JvtamOn7Y8g="; }; - pythonRelaxDeps = [ - "rich" - ]; - - nativeBuildInputs = [ + build-system = [ poetry-core - pythonRelaxDepsHook ]; - propagatedBuildInputs = [ + dependencies = [ click rich tomli @@ -57,10 +51,10 @@ buildPythonPackage rec { meta = with lib; { description = "Test framework for Python"; - mainProgram = "ward"; homepage = "https://github.com/darrenburns/ward"; changelog = "https://github.com/darrenburns/ward/releases/tag/release%2F${version}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; + mainProgram = "ward"; }; } From b663a2486c0b9967d9e8593e85fb4398f7269e59 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Apr 2024 21:09:09 +0200 Subject: [PATCH 3/6] python312Packages.tbm-utils: add patches for pendulum > 3 support --- .../python-modules/tbm-utils/default.nix | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/tbm-utils/default.nix b/pkgs/development/python-modules/tbm-utils/default.nix index 4fa46defe2cb..e1ce85737a0e 100644 --- a/pkgs/development/python-modules/tbm-utils/default.nix +++ b/pkgs/development/python-modules/tbm-utils/default.nix @@ -1,12 +1,14 @@ -{ stdenv -, lib +{ lib +, stdenv +, attrs , buildPythonPackage , fetchFromGitHub -, attrs +, fetchpatch , pendulum , poetry-core , pprintpp , pytestCheckHook +, pythonOlder , pythonRelaxDepsHook , wrapt }: @@ -14,23 +16,46 @@ buildPythonPackage rec { pname = "tbm-utils"; version = "2.6.0"; - format = "pyproject"; + pyproject = true; + + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "thebigmunch"; - repo = pname; + repo = "tbm-utils"; rev = "refs/tags/${version}"; hash = "sha256-AEKawsAxDSDNkIaXEFFgdEBOY2PpASDrhlDrsnM5eyA="; }; + patches = [ + # Migrate to pendulum > 3, https://github.com/thebigmunch/tbm-utils/pull/3 + (fetchpatch { + name = "support-pendulum-3.patch"; + url = "https://github.com/thebigmunch/tbm-utils/commit/473534fae2d9a8dea9100cead6c54cab3f5cd0cd.patch"; + hash = "sha256-3T0KhSmO9r1vM67FWEnTZMQV4b5jS2xtPHI0t9NnCmI="; + }) + (fetchpatch { + name = "update-testsupport-pendulum-3.patch"; + url = "https://github.com/thebigmunch/tbm-utils/commit/a0331d0c15f11cd26bfbb42eebd17296167161ed.patch"; + hash = "sha256-KG6yfnnBltavbNvIBTdbK+CPXwZTLYl14925RY2a8vs="; + }) + ]; + postPatch = '' substituteInPlace pyproject.toml \ - --replace 'poetry>=1.0.0' 'poetry-core' \ - --replace 'poetry.masonry.api' 'poetry.core.masonry.api' + --replace-fail 'poetry>=1.0.0' 'poetry-core' \ + --replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api' ''; - nativeBuildInputs = [ + pythonRelaxDeps = [ + "attrs" + ]; + + build-system = [ poetry-core + ]; + + nativeBuildInputs = [ pythonRelaxDepsHook ]; @@ -41,10 +66,6 @@ buildPythonPackage rec { wrapt ]; - pythonRelaxDeps = [ - "attrs" - ]; - nativeCheckInputs = [ pytestCheckHook ]; @@ -67,10 +88,11 @@ buildPythonPackage rec { "tbm_utils" ]; - meta = { + meta = with lib; { description = "A commonly-used set of utilities"; homepage = "https://github.com/thebigmunch/tbm-utils"; changelog = "https://github.com/thebigmunch/tbm-utils/blob/${version}/CHANGELOG.md"; - license = [ lib.licenses.mit ]; + license = licenses.mit; + maintainers = with maintainers; [ ]; }; } From 29b2453118138db4812acc7e04695b18be6a2bb2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Apr 2024 21:09:54 +0200 Subject: [PATCH 4/6] python312Packages.tbm-utils: format with nixfmt --- .../python-modules/tbm-utils/default.nix | 47 ++++++++----------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/pkgs/development/python-modules/tbm-utils/default.nix b/pkgs/development/python-modules/tbm-utils/default.nix index e1ce85737a0e..7f4963ca6dba 100644 --- a/pkgs/development/python-modules/tbm-utils/default.nix +++ b/pkgs/development/python-modules/tbm-utils/default.nix @@ -1,16 +1,17 @@ -{ lib -, stdenv -, attrs -, buildPythonPackage -, fetchFromGitHub -, fetchpatch -, pendulum -, poetry-core -, pprintpp -, pytestCheckHook -, pythonOlder -, pythonRelaxDepsHook -, wrapt +{ + lib, + stdenv, + attrs, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + pendulum, + poetry-core, + pprintpp, + pytestCheckHook, + pythonOlder, + pythonRelaxDepsHook, + wrapt, }: buildPythonPackage rec { @@ -47,17 +48,11 @@ buildPythonPackage rec { --replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api' ''; - pythonRelaxDeps = [ - "attrs" - ]; + pythonRelaxDeps = [ "attrs" ]; - build-system = [ - poetry-core - ]; + build-system = [ poetry-core ]; - nativeBuildInputs = [ - pythonRelaxDepsHook - ]; + nativeBuildInputs = [ pythonRelaxDepsHook ]; propagatedBuildInputs = [ attrs @@ -66,9 +61,7 @@ buildPythonPackage rec { wrapt ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; disabledTests = lib.optionals stdenv.isDarwin [ # Skip on macOS because /etc/localtime is accessed through the pendulum @@ -84,9 +77,7 @@ buildPythonPackage rec { "tests/test_misc.py" ]; - pythonImportsCheck = [ - "tbm_utils" - ]; + pythonImportsCheck = [ "tbm_utils" ]; meta = with lib; { description = "A commonly-used set of utilities"; From c3bbd7710c08c52d5af70e79392fcce9d6e334b7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Apr 2024 21:11:05 +0200 Subject: [PATCH 5/6] python312Packages.audio-metadata: refactor --- .../python-modules/audio-metadata/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/audio-metadata/default.nix b/pkgs/development/python-modules/audio-metadata/default.nix index d1d6de0bcba8..d6c03d6bfda0 100644 --- a/pkgs/development/python-modules/audio-metadata/default.nix +++ b/pkgs/development/python-modules/audio-metadata/default.nix @@ -16,13 +16,13 @@ buildPythonPackage rec { pname = "audio-metadata"; version = "0.11.1"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "thebigmunch"; - repo = pname; + repo = "audio-metadata"; rev = "refs/tags/${version}"; hash = "sha256-5ZX4HwbuB9ZmFfHuxaMCrn3R7/znuDsoyqqLql2Nizg="; }; @@ -41,12 +41,15 @@ buildPythonPackage rec { "more-itertools" ]; - nativeBuildInputs = [ + build-system = [ poetry-core + ]; + + nativeBuildInputs = [ pythonRelaxDepsHook ]; - propagatedBuildInputs = [ + dependencies = [ attrs bidict bitstruct @@ -63,8 +66,8 @@ buildPythonPackage rec { ]; meta = with lib; { + description = "Library for handling the metadata from audio files"; 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 338e473ba85c9035905744cadb980c69a666a71c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Apr 2024 21:12:36 +0200 Subject: [PATCH 6/6] python312Packages.audio-metadata: format with nixfmt --- .../python-modules/audio-metadata/default.nix | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/audio-metadata/default.nix b/pkgs/development/python-modules/audio-metadata/default.nix index d6c03d6bfda0..e9be3715ec31 100644 --- a/pkgs/development/python-modules/audio-metadata/default.nix +++ b/pkgs/development/python-modules/audio-metadata/default.nix @@ -1,16 +1,17 @@ -{ lib -, attrs -, bidict -, bitstruct -, buildPythonPackage -, fetchFromGitHub -, fetchpatch -, more-itertools -, poetry-core -, pprintpp -, pythonOlder -, pythonRelaxDepsHook -, tbm-utils +{ + lib, + attrs, + bidict, + bitstruct, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + more-itertools, + poetry-core, + pprintpp, + pythonOlder, + pythonRelaxDepsHook, + tbm-utils, }: buildPythonPackage rec { @@ -41,13 +42,9 @@ buildPythonPackage rec { "more-itertools" ]; - build-system = [ - poetry-core - ]; + build-system = [ poetry-core ]; - nativeBuildInputs = [ - pythonRelaxDepsHook - ]; + nativeBuildInputs = [ pythonRelaxDepsHook ]; dependencies = [ attrs @@ -61,9 +58,7 @@ buildPythonPackage rec { # Tests require ward which is not ready to be used doCheck = false; - pythonImportsCheck = [ - "audio_metadata" - ]; + pythonImportsCheck = [ "audio_metadata" ]; meta = with lib; { description = "Library for handling the metadata from audio files";