python3Packages.pytest: prune deps, refactor

This commit is contained in:
Martin Weinelt 2022-03-31 15:49:20 +02:00
parent cd9f0575eb
commit c838a3ac1e

View file

@ -1,47 +1,48 @@
{ lib, buildPythonPackage, pythonOlder, fetchPypi, isPy3k, isPyPy
, atomicwrites
{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, isPyPy
, writeText
# build
, setuptools-scm
# propagates
, attrs
, hypothesis
, iniconfig
, more-itertools
, packaging
, pathlib2
, pluggy
, py
, pygments
, setuptools
, setuptools-scm
, six
, tomli
, wcwidth
, writeText
# tests
, hypothesis
, pygments
}:
buildPythonPackage rec {
pname = "pytest";
version = "7.1.1";
disabled = !isPy3k;
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-hBEyyu9rGtF6mv3kbcT2z6WaBflVWq5RUfc73yggymM=";
};
nativeBuildInputs = [ setuptools-scm ];
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [
atomicwrites
attrs
iniconfig
more-itertools
packaging
pluggy
py
setuptools
six
tomli
wcwidth
] ++ lib.optionals (pythonOlder "3.6") [ pathlib2 ];
];
checkInputs = [
hypothesis
@ -50,17 +51,13 @@ buildPythonPackage rec {
doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460
preCheck = ''
# don't test bash builtins
rm testing/test_argcomplete.py
'';
# Ignored file https://github.com/pytest-dev/pytest/pull/5605#issuecomment-522243929
# test_missing_required_plugins will emit deprecation warning which is treated as error
checkPhase = ''
runHook preCheck
$out/bin/py.test -x testing/ \
--ignore=testing/test_junitxml.py \
--ignore=testing/test_argcomplete.py \
-k "not test_collect_pyargs_with_testpaths and not test_missing_required_plugins"
# tests leave behind unreproducible pytest binaries in the output directory, remove: