diff options
Diffstat (limited to 'pkgs/development/python-modules/pytest-shutil/default.nix')
-rw-r--r-- | pkgs/development/python-modules/pytest-shutil/default.nix | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/pkgs/development/python-modules/pytest-shutil/default.nix b/pkgs/development/python-modules/pytest-shutil/default.nix index 480c15b87c361..9c5bffacb431c 100644 --- a/pkgs/development/python-modules/pytest-shutil/default.nix +++ b/pkgs/development/python-modules/pytest-shutil/default.nix @@ -1,46 +1,51 @@ -{ lib -, isPyPy -, buildPythonPackage -, fetchPypi +{ + lib, + isPyPy, + buildPythonPackage, + pytest-fixture-config, + fetchpatch, -# build -, pytest + # build-time + setuptools, + setuptools-git, -# runtime -, setuptools-git -, mock -, path -, execnet -, termcolor -, six + # runtime + pytest, + mock, + path, + execnet, + termcolor, + six, -# tests -, cmdline -, pytestCheckHook - }: + # tests + pytestCheckHook, +}: buildPythonPackage rec { pname = "pytest-shutil"; - version = "1.7.0"; - format = "setuptools"; + inherit (pytest-fixture-config) version src; + pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-2BZSYd5251CFBcNB2UwCsRPclj8nRUOrynTb+r0CEmE="; - }; - - postPatch = '' - substituteInPlace setup.py \ - --replace "contextlib2" 'contextlib2;python_version<"3"' \ - --replace "path.py" "path" - ''; + sourceRoot = "${src.name}/pytest-shutil"; - buildInputs = [ - pytest + # imp was removed in Python 3.12 + patches = [ + (fetchpatch { + name = "stop-using-imp.patch"; + url = "https://build.opensuse.org/public/source/openSUSE:Factory/python-pytest-shutil/stop-using-imp.patch?rev=10"; + hash = "sha256-L8tXoQ9q8o6aP3TpJY/sUVVbUd/ebw0h6de6dBj1WNY="; + stripLen = 1; + }) ]; - propagatedBuildInputs = [ + build-system = [ + setuptools setuptools-git + ]; + + buildInputs = [ pytest ]; + + dependencies = [ mock path execnet @@ -48,17 +53,14 @@ buildPythonPackage rec { six ]; - nativeCheckInputs = [ - cmdline - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = [ - "test_pretty_formatter" - ] ++ lib.optionals isPyPy [ - "test_run" - "test_run_integration" - ]; + disabledTests = + [ "test_pretty_formatter" ] + ++ lib.optionals isPyPy [ + "test_run" + "test_run_integration" + ]; meta = with lib; { description = "A goodie-bag of unix shell and environment tools for py.test"; |