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