python3.pkgs.build: move tests to passthru

While build is built using bootstrap packages, none of its test
dependencies should be, so we must move out of the derivation.
This commit is contained in:
Theodore Ni 2023-07-27 23:40:54 -07:00 committed by Frederik Rietdijk
parent 349f57fb42
commit e1cafe642a

View file

@ -1,5 +1,6 @@
{ lib
, stdenv
, build
, buildPythonPackage
, fetchFromGitHub
, flit-core
@ -41,36 +42,52 @@ buildPythonPackage rec {
tomli
];
nativeCheckInputs = [
filelock
pytest-mock
pytest-rerunfailures
pytest-xdist
pytestCheckHook
setuptools
toml
];
# We need to disable tests because this package is part of the bootstrap chain
# and its test dependencies cannot be built yet when this is being built.
doCheck = false;
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
];
passthru.tests = {
pytest = buildPythonPackage {
pname = "${pname}-pytest";
inherit version;
format = "other";
__darwinAllowLocalNetworking = true;
dontBuild = true;
dontInstall = true;
disabledTests = [
# Tests often fail with StopIteration
"test_isolat"
"test_default_pip_is_never_too_old"
"test_build"
"test_with_get_requires"
"test_init"
"test_output"
"test_wheel_metadata"
] ++ lib.optionals stdenv.isDarwin [
# Expects Apple's Python and its quirks
"test_can_get_venv_paths_with_conflicting_default_scheme"
];
nativeCheckInputs = [
build
filelock
pytest-mock
pytest-rerunfailures
pytest-xdist
pytestCheckHook
setuptools
toml
];
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
];
__darwinAllowLocalNetworking = true;
disabledTests = [
# Tests often fail with StopIteration
"test_isolat"
"test_default_pip_is_never_too_old"
"test_build"
"test_with_get_requires"
"test_init"
"test_output"
"test_wheel_metadata"
] ++ lib.optionals stdenv.isDarwin [
# Expects Apple's Python and its quirks
"test_can_get_venv_paths_with_conflicting_default_scheme"
];
};
};
pythonImportsCheck = [
"build"