From d4f83403c1adf224a96c4e5a3a4705f0ccc8c848 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 3 Jul 2025 18:34:18 +0200 Subject: [PATCH] python3Packages.related: unbreak and pep517 build Removes dependency on future package. --- .../python-modules/related/default.nix | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/related/default.nix b/pkgs/development/python-modules/related/default.nix index d36157d818cc..c84e7bcf344e 100644 --- a/pkgs/development/python-modules/related/default.nix +++ b/pkgs/development/python-modules/related/default.nix @@ -3,17 +3,17 @@ attrs, buildPythonPackage, fetchPypi, - future, pytestCheckHook, python-dateutil, pythonOlder, pyyaml, + setuptools, }: buildPythonPackage rec { pname = "related"; version = "0.7.3"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -22,22 +22,40 @@ buildPythonPackage rec { hash = "sha256-IqmbqAW6PubN9GBXrMs5Je4u1XkgLl9camSGNrlrFJA="; }; - propagatedBuildInputs = [ + postPatch = '' + # Remove outdated setup.cfg + rm setup.cfg + substituteInPlace setup.py \ + --replace-fail "'pytest-runner'," "" + + # remove dependency on future + substituteInPlace \ + src/related/dispatchers.py \ + src/related/fields.py \ + tests/ex03_company/test_company.py \ + --replace-fail \ + "from future.moves.urllib.parse import ParseResult" \ + "from urllib.parse import ParseResult" + + substituteInPlace \ + src/related/converters.py \ + --replace-fail \ + "from future.moves.urllib.parse import urlparse" \ + "from urllib.parse import urlparse" + ''; + + build-system = [ setuptools ]; + + pythonRemoveDeps = [ "future" ]; + + dependencies = [ attrs - future python-dateutil pyyaml ]; nativeCheckInputs = [ pytestCheckHook ]; - postPatch = '' - # Remove outdated setup.cfg - rm setup.cfg - substituteInPlace setup.py \ - --replace "'pytest-runner'," "" - ''; - disabledTests = [ # Source tarball doesn't contains all needed files "test_compose_from_yml"