diff --git a/pkgs/development/python-modules/tomli/default.nix b/pkgs/development/python-modules/tomli/default.nix index c658339dcd9c..79cd5a4f500c 100644 --- a/pkgs/development/python-modules/tomli/default.nix +++ b/pkgs/development/python-modules/tomli/default.nix @@ -1,9 +1,8 @@ { lib , buildPythonPackage +, callPackage , fetchFromGitHub , flit-core -, pytestCheckHook -, python-dateutil }: buildPythonPackage rec { @@ -11,6 +10,11 @@ buildPythonPackage rec { version = "1.1.0"; format = "pyproject"; + outputs = [ + "out" + "testsout" + ]; + src = fetchFromGitHub { owner = "hukkin"; repo = pname; @@ -20,17 +24,24 @@ buildPythonPackage rec { nativeBuildInputs = [ flit-core ]; - checkInputs = [ - pytestCheckHook - python-dateutil - ]; + postInstall = '' + mkdir $testsout + cp -R benchmark/ pyproject.toml tests/ $testsout/ + ''; pythonImportsCheck = [ "tomli" ]; + # check in passthru.tests.pytest to escape infinite recursion with setuptools-scm + doCheck = false; + + passthru.tests = { + pytest = callPackage ./tests.nix { }; + }; + meta = with lib; { description = "A Python library for parsing TOML, fully compatible with TOML v1.0.0"; homepage = "https://github.com/hukkin/tomli"; license = licenses.mit; - maintainers = with maintainers; [ veehaitch ]; + maintainers = with maintainers; [ veehaitch SuperSandro2000 ]; }; } diff --git a/pkgs/development/python-modules/tomli/tests.nix b/pkgs/development/python-modules/tomli/tests.nix new file mode 100644 index 000000000000..5d3d67dbd128 --- /dev/null +++ b/pkgs/development/python-modules/tomli/tests.nix @@ -0,0 +1,21 @@ +{ buildPythonPackage +, tomli +, pytestCheckHook +, python-dateutil +}: + +buildPythonPackage rec { + pname = "tomli-tests"; + inherit (tomli) version; + + src = tomli.testsout; + + dontBuild = true; + dontInstall = true; + + checkInputs = [ + pytestCheckHook + python-dateutil + tomli + ]; +}