From 69dd0734e0b2e699d6c1a24de9aeeae350c42a99 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 10 Feb 2025 14:00:21 +0000 Subject: [PATCH 1/3] python3Packages.jira: fix build 7e7963d8736b (python3Packages.jira: 3.8.0 -> 3.9.4, 2025-01-19) update python3Packages.jira to 3.9.4. After that commit, python-jira fails to build: $ nix build -L --impure --expr '(import ./. {}).python3.withPackages(ps: [ ps.jira ])' [...] error: builder for '/nix/store/bfr24lmgw4izl9ixh2sdm794a9kky7w6-python3.12-jira-3.9.4.drv' failed with exit code 1; last 19 log lines: > Sourcing python-remove-tests-dir-hook > Sourcing python-catch-conflicts-hook.sh > Sourcing python-remove-bin-bytecode-hook.sh > Sourcing pypa-build-hook > Using pypaBuildPhase > Sourcing python-runtime-deps-check-hook > Using pythonRuntimeDepsCheckHook > Sourcing pypa-install-hook > Using pypaInstallPhase > Sourcing python-imports-check-hook.sh > Using pythonImportsCheckPhase > Sourcing python-namespaces-hook > Sourcing python-catch-conflicts-hook.sh > Running phase: unpackPhase > unpacking source archive /nix/store/ck51dycsghmkf7449p615crsqdn2xsni-source > source root is source > setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/tox.ini" > Running phase: patchPhase > substitute(): ERROR: file 'setup.cfg' does not exist For full logs, run 'nix log /nix/store/bfr24lmgw4izl9ixh2sdm794a9kky7w6-python3.12-jira-3.9.4.drv'. error: 1 dependencies of derivation '/nix/store/i5xib9msa42grs3cwa1ibw0cfdi799f9-python3-3.12.8-env.drv' failed to build The functionality in setup.cfg was moved to pyproject.toml in pycontribs/jira@668562a3f8c7 (migrate `setup.cfg` to `pyproject.toml` (pycontribs/jira#1776), 2024-03-25). Use pytest-cov-stub instead of the `postPatch` hack. --- pkgs/development/python-modules/jira/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/jira/default.nix b/pkgs/development/python-modules/jira/default.nix index 370b70457660..27c7de4f7b47 100644 --- a/pkgs/development/python-modules/jira/default.nix +++ b/pkgs/development/python-modules/jira/default.nix @@ -10,6 +10,7 @@ pillow, pyjwt, pytestCheckHook, + pytest-cov-stub, pythonOlder, requests, requests-futures, @@ -67,14 +68,10 @@ buildPythonPackage rec { nativeCheckInputs = [ flaky pytestCheckHook + pytest-cov-stub requests-mock ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace "--cov-report=xml --cov jira" "" - ''; - pythonImportsCheck = [ "jira" ]; # impure tests because of connectivity attempts to jira servers From 50eeaac136f85c9a60d40623991f0c26542a880b Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 17 Feb 2025 14:45:24 +0000 Subject: [PATCH 2/3] python3Packages.jira: don't use repo = pname In issue #277994 it was discussed that it's better to hardcode the package name. --- pkgs/development/python-modules/jira/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/jira/default.nix b/pkgs/development/python-modules/jira/default.nix index 27c7de4f7b47..950c08989aac 100644 --- a/pkgs/development/python-modules/jira/default.nix +++ b/pkgs/development/python-modules/jira/default.nix @@ -31,7 +31,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "pycontribs"; - repo = pname; + repo = "jira"; tag = version; hash = "sha256-P3dbrBKpHvLNIA+JBeSXEQl4QVZ0FdKkNIU8oPHWw6k="; }; From 8b4b5dbefc546e6bab9fe64728b8ce2af33473d5 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Mon, 17 Feb 2025 14:50:58 +0000 Subject: [PATCH 3/3] python3Packages.jira: use build-system and dependencies --- pkgs/development/python-modules/jira/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/jira/default.nix b/pkgs/development/python-modules/jira/default.nix index 950c08989aac..d7c1d60f66c1 100644 --- a/pkgs/development/python-modules/jira/default.nix +++ b/pkgs/development/python-modules/jira/default.nix @@ -36,12 +36,12 @@ buildPythonPackage rec { hash = "sha256-P3dbrBKpHvLNIA+JBeSXEQl4QVZ0FdKkNIU8oPHWw6k="; }; - nativeBuildInputs = [ + build-system = [ setuptools setuptools-scm ]; - propagatedBuildInputs = [ + dependencies = [ defusedxml packaging requests