Skip to content

Commit

Permalink
python: update preCheck phase
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 18, 2024
1 parent 1ef22ad commit 0000fbe
Show file tree
Hide file tree
Showing 253 changed files with 12 additions and 907 deletions.
11 changes: 3 additions & 8 deletions pkgs/development/python-modules/accelerate/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,9 @@ buildPythonPackage rec {
pytest7CheckHook
transformers
];
preCheck =
''
export HOME=$(mktemp -d)
export PATH=$out/bin:$PATH
''
+ lib.optionalString config.cudaSupport ''
export TRITON_PTXAS_PATH="${cudatoolkit}/bin/ptxas"
'';
preCheck = lib.optionalString config.cudaSupport ''
export TRITON_PTXAS_PATH="${cudatoolkit}/bin/ptxas"
'';
pytestFlagsArray = [ "tests" ];
disabledTests =
[
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/aeppl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ buildPythonPackage rec {
pytestCheckHook
];

preCheck = ''
export HOME=$(mktemp -d);
'';

pythonImportsCheck = [ "aeppl" ];

disabledTests = [
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/afdko/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];

preCheck = ''
export PATH=$PATH:$out/bin
# Remove build artifacts to prevent them from messing with the tests
rm -rf _skbuild
'';
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/aiodhcpwatcher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ buildPythonPackage rec {
pytestCheckHook
];

preCheck = ''
export HOME=$TMPDIR
'';

pythonImportsCheck = [ "aiodhcpwatcher" ];

meta = with lib; {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/aiogithubapi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ buildPythonPackage rec {
pytestFlagsArray = [ "--asyncio-mode=auto" ];

preCheck = ''
export HOME=$(mktemp -d)
# Need sigstore is an optional dependencies and need <2
rm -rf tests/test_helper.py
'';
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/aiohttp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ buildPythonPackage rec {
# aiohttp in current folder shadows installed version
rm -r aiohttp
touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990
export HOME=$(mktemp -d)
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# Work around "OSError: AF_UNIX path too long"
Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/python-modules/amqtt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ buildPythonPackage rec {
"tests/test_client.py"
];

preCheck = ''
# Some tests need amqtt
export PATH=$out/bin:$PATH
'';

pythonImportsCheck = [ "amqtt" ];

meta = with lib; {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/ansi2html/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ buildPythonPackage rec {
wheel
];

preCheck = "export PATH=$PATH:$out/bin";

nativeCheckInputs = [ pytestCheckHook ];

pythonImportsCheck = [ "ansi2html" ];
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/python-modules/ansible-compat/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ buildPythonPackage rec {
];

preCheck = ''
export HOME=$(mktemp -d)
substituteInPlace test/test_runtime.py \
--replace-fail "printenv" "${coreutils}/bin/printenv"
'';
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/ansible-runner/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ buildPythonPackage rec {
];

preCheck = ''
export HOME=$(mktemp -d)
export PATH="$PATH:$out/bin";
# avoid coverage flags
rm pytest.ini
'';
Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/python-modules/ansible-vault-rw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ buildPythonPackage rec {

propagatedBuildInputs = [ ansible-core ];

# Otherwise tests will fail to create directory
# Permission denied: '/homeless-shelter'
preCheck = ''
export HOME=$(mktemp -d)
'';

# no tests in sdist, no 2.1.0 tag on git
doCheck = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ buildPythonPackage rec {
pytest-cov-stub
];

preCheck = ''
export HOME=$(mktemp -d);
'';

disabledTests = [
# Tests require network access
"test_bulk_search"
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/apptools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ buildPythonPackage rec {

nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);

preCheck = ''
export HOME=$TMP
'';

pythonImportsCheck = [ "apptools" ];

meta = with lib; {
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/arelle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ buildPythonPackage rec {
boto3
] ++ lib.flatten (lib.attrValues optional-dependencies);

preCheck = ''
export HOME=$(mktemp -d)
'';

disabledTestPaths =
[
"tests/integration_tests"
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/argilla/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ buildPythonPackage rec {
# Still quite a bit of optional dependencies missing
doCheck = false;

preCheck = ''
export HOME=$(mktemp -d)
'';

nativeCheckInputs = [
pytestCheckHook
pytest-mock
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/aria2p/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ buildPythonPackage rec {
];
};

preCheck = ''
export HOME=$TMPDIR
'';

nativeCheckInputs = [
aria2
fastapi
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/arviz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ buildPythonPackage rec {
zarr
];

preCheck = ''
export HOME=$(mktemp -d);
'';

pytestFlagsArray = [ "arviz/tests/base_tests/" ];

disabledTests = [
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/asdf-astropy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ buildPythonPackage rec {

pythonImportsCheck = [ "asdf_astropy" ];

preCheck = ''
export HOME=$(mktemp -d)
'';

meta = with lib; {
description = "Extension library for ASDF to provide support for Astropy";
homepage = "https://github.com/astropy/asdf-astropy";
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/ase/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ buildPythonPackage rec {
"test_fix_scaled" # Did not raise UserWarning
] ++ lib.optionals (pythonAtLeast "3.12") [ "test_info_calculators" ];

preCheck = ''
export PATH="$out/bin:$PATH"
'';

pythonImportsCheck = [ "ase" ];

meta = with lib; {
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/python-modules/aspell-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ buildPythonPackage rec {

preCheck = ''
export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
export HOME=$(mktemp -d)
'';

pytestFlagsArray = [ "test/unittests.py" ];
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/python-modules/astropy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ buildPythonPackage rec {
# https://github.com/astropy/astropy/issues/15316#issuecomment-1722190547
preCheck = ''
cd "$out"
export HOME="$(mktemp -d)"
export OMP_NUM_THREADS=$(( $NIX_BUILD_CORES / 4 ))
'';

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/python-modules/astroquery/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ buildPythonPackage rec {
# Tests must be run in the build directory. The tests create files
# in $HOME/.astropy so we need to set HOME to $TMPDIR.
preCheck = ''
export HOME=$TMPDIR
cd build/lib
'';

Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/python-modules/aw-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ buildPythonPackage rec {
# an instance of aw-server running in order to function.
pytestFlagsArray = [ "tests/test_requestqueue.py" ];

preCheck = ''
# Fake home folder for tests that write to $HOME
export HOME="$TMPDIR"
'';

pythonImportsCheck = [ "aw_client" ];

passthru.updateScript = gitUpdater { rev-prefix = "v"; };
Expand Down
5 changes: 0 additions & 5 deletions pkgs/development/python-modules/aw-core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ buildPythonPackage rec {

nativeCheckInputs = [ pytestCheckHook ];

preCheck = ''
# Fake home folder for tests that write to $HOME
export HOME="$TMPDIR"
'';

pythonImportsCheck = [ "aw_core" ];

passthru.updateScript = gitUpdater { rev-prefix = "v"; };
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/aws-adfs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ buildPythonPackage rec {
toml
];

preCheck = ''
export HOME=$(mktemp -d);
'';

pythonImportsCheck = [ "aws_adfs" ];

meta = with lib; {
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/bambi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ buildPythonPackage rec {
pytestCheckHook
];

preCheck = ''
export HOME=$(mktemp -d)
'';

disabledTests =
[
# Tests require network access
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/bc-detect-secrets/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ buildPythonPackage rec {
responses
] ++ lib.flatten (builtins.attrValues optional-dependencies);

preCheck = ''
export HOME=$(mktemp -d);
'';

disabledTests = [
# Tests are failing for various reasons (missing git repo, missing test data, etc.)
"test_baseline_filters_out_known_secrets"
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/python-modules/betterproto/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ buildPythonPackage rec {
# the protoc-gen-python_betterproto script from the package to be on PATH.
preCheck = ''
(($(ulimit -n) < 1024)) && ulimit -n 1024
export PATH=$PATH:$out/bin
patchShebangs src/betterproto/plugin/main.py
${python.interpreter} -m tests.generate
'';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ buildPythonPackage rec {

preCheck = ''
export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
export PATH=$out/bin:$PATH
'';

pythonImportsCheck = [ "bimmer_connected" ];
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/birch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ buildPythonPackage rec {
pyyaml
];

preCheck = ''
export HOME="$(mktemp -d)"
'';

meta = with lib; {
description = "Simple hierarchical configuration for Python packages";
homepage = "https://github.com/shaypal5/birch";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/black/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ buildPythonPackage rec {

preCheck =
''
export PATH="$PATH:$out/bin"
# The top directory /build matches black's DEFAULT_EXCLUDE regex.
# Make /build the project root for black tests to avoid excluding files.
touch ../.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ buildPythonPackage rec {

nativeCheckInputs = [ pytestCheckHook ];

preCheck = ''
export HOME=$(mktemp -d)
'';

# Race condition, https://github.com/secdev/scapy/pull/4558
# pythonImportsCheck = [ "bof" ];

Expand Down
1 change: 0 additions & 1 deletion pkgs/development/python-modules/cartopy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ buildPythonPackage rec {

preCheck = ''
export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
export HOME=$TMPDIR
'';

pytestFlagsArray = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ buildPythonPackage rec {
# increase tolerance for time-based test
substituteInPlace tests/unit/io/utils.py --replace 'delta=.15' 'delta=.3'
export HOME=$(mktemp -d)
# cythonize this before we hide the source dir as it references
# one of its files
cythonize -i tests/unit/cython/types_testhelper.pyx
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/cattrs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ buildPythonPackage rec {
--replace-fail "from orjson import loads as orjson_loads" ""
'';

preCheck = ''
export HOME=$(mktemp -d);
'';

disabledTestPaths = [
# Don't run benchmarking tests
"bench"
Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/python-modules/censys/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ buildPythonPackage rec {
"rich"
];

# The tests want to write a configuration file
preCheck = ''
export HOME=$(mktemp -d)
mkdir -p $HOME
'';

pythonImportsCheck = [ "censys" ];

meta = with lib; {
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/cfn-lint/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ buildPythonPackage rec {
pytestCheckHook
] ++ lib.flatten (builtins.attrValues optional-dependencies);

preCheck = ''
export PATH=$out/bin:$PATH
'';

disabledTests = [
# Requires git directory
"test_update_docs"
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/chart-studio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ buildPythonPackage rec {
pytestCheckHook
];

preCheck = ''
export HOME=$(mktemp -d)
'';

# most tests talk to a network service, so only run ones that don't do that.
pytestFlagsArray = [
"chart_studio/tests/test_core"
Expand Down
Loading

0 comments on commit 0000fbe

Please sign in to comment.