From 8d1439ee85543491cadf00452fce738b0e7d43d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 27 Aug 2021 02:35:00 +0200 Subject: [PATCH] python39Packages.flit-core: break infinite recursion with setuptools-scm by splitting tests, add SuperSandro2000 as maintainer --- .../python-modules/flit-core/default.nix | 25 +++++++++++++------ .../python-modules/flit-core/tests.nix | 22 ++++++++++++++++ 2 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/python-modules/flit-core/tests.nix 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 + ]; +}