diff --git a/pkgs/development/python-modules/pluggy/default.nix b/pkgs/development/python-modules/pluggy/default.nix index 46aebb519500..e6473e98a282 100644 --- a/pkgs/development/python-modules/pluggy/default.nix +++ b/pkgs/development/python-modules/pluggy/default.nix @@ -1,31 +1,40 @@ { buildPythonPackage , lib -, fetchPypi +, fetchFromGitHub , setuptools-scm , pythonOlder , importlib-metadata +, callPackage }: buildPythonPackage rec { pname = "pluggy"; - version = "1.0.0"; + version = "1.2.0"; format = "pyproject"; - src = fetchPypi { - inherit pname version; - sha256 = "4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"; + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = "pluggy"; + rev = "refs/tags/${version}"; + hash = "sha256-SzJu7ITdmUgusn8sz6fRBpxTMQncWIViP5NCAj4q4GM="; }; nativeBuildInputs = [ setuptools-scm ]; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; # To prevent infinite recursion with pytest doCheck = false; + passthru.tests = { + pytest = callPackage ./tests.nix { }; + }; meta = { + changelog = "https://github.com/pytest-dev/pluggy/blob/${src.rev}/CHANGELOG.rst"; description = "Plugin and hook calling mechanisms for Python"; homepage = "https://github.com/pytest-dev/pluggy"; license = lib.licenses.mit; diff --git a/pkgs/development/python-modules/pluggy/tests.nix b/pkgs/development/python-modules/pluggy/tests.nix new file mode 100644 index 000000000000..dc6e16e7b2d7 --- /dev/null +++ b/pkgs/development/python-modules/pluggy/tests.nix @@ -0,0 +1,20 @@ +{ buildPythonPackage +, pluggy +, pytestCheckHook +}: + +buildPythonPackage { + pname = "pluggy-tests"; + inherit (pluggy) version; + format = "other"; + + inherit (pluggy) src; + + dontBuild = true; + dontInstall = true; + + nativeCheckInputs = [ + pluggy + pytestCheckHook + ]; +}