diff --git a/pkgs/development/python-modules/flit-core/default.nix b/pkgs/development/python-modules/flit-core/default.nix index a4c6b99b07f4..7b2731595629 100644 --- a/pkgs/development/python-modules/flit-core/default.nix +++ b/pkgs/development/python-modules/flit-core/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage +, callPackage , flit -, isPy3k , toml , pytestCheckHook , testpath @@ -12,6 +12,11 @@ buildPythonPackage rec { version = "3.2.0"; format = "pyproject"; + outputs = [ + "out" + "testsout" + ]; + inherit (flit) src patches; preConfigure = '' @@ -22,19 +27,23 @@ buildPythonPackage rec { toml ]; - checkInputs = [ - pytestCheckHook - testpath - ]; + postInstall = '' + mkdir $testsout + cp -R ../tests $testsout/tests + ''; + + # check in passthru.tests.pytest to escape infinite recursion with setuptools-scm + doCheck = false; passthru.tests = { inherit flit; + pytest = callPackage ./tests.nix { }; }; - meta = { + meta = with lib; { description = "Distribution-building parts of Flit. See flit package for more information"; homepage = "https://github.com/takluyver/flit"; - license = lib.licenses.bsd3; - maintainers = [ lib.maintainers.fridh ]; + license = licenses.bsd3; + maintainers = with maintainers; [ fridh SuperSandro2000 ]; }; } diff --git a/pkgs/development/python-modules/flit-core/tests.nix b/pkgs/development/python-modules/flit-core/tests.nix new file mode 100644 index 000000000000..0fd13e80cb12 --- /dev/null +++ b/pkgs/development/python-modules/flit-core/tests.nix @@ -0,0 +1,22 @@ +{ buildPythonPackage +, flit +, flit-core +, pytestCheckHook +, testpath +}: + +buildPythonPackage rec { + pname = "flit-core"; + inherit (flit-core) version; + + src = flit-core.testsout; + + dontBuild = true; + dontInstall = true; + + checkInputs = [ + flit + pytestCheckHook + testpath + ]; +}