python39Packages.tomli: break infinite recursion with setuptools-scm by splitting tests, add SuperSandro2000 as maintainer

This commit is contained in:
Sandro Jäckel 2021-08-27 02:34:32 +02:00 committed by Martin Weinelt
parent e0620c63a7
commit ce240f5ca1
2 changed files with 39 additions and 7 deletions

View File

@ -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 ];
};
}

View File

@ -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
];
}