python3Packages.*: remove explicit OMP_NUM_THREADS definitions where numpy is used

This commit is contained in:
Grimmauld 2026-06-26 18:43:24 +02:00
commit ef8b8d8f58
No known key found for this signature in database
15 changed files with 6 additions and 44 deletions

View file

@ -143,10 +143,6 @@ buildPythonPackage rec {
preCheck = ''
export HOME="$(mktemp -d)"
export OMP_NUM_THREADS=$(( $NIX_BUILD_CORES / 4 ))
if [ $OMP_NUM_THREADS -eq 0 ]; then
export OMP_NUM_THREADS=1
fi
# See https://github.com/astropy/astropy/issues/17649 and see
# --hypothesis-profile=ci pytest flag below.

View file

@ -52,10 +52,6 @@ buildPythonPackage rec {
scikit-learn
];
preCheck = ''
export OMP_NUM_THREADS=1
'';
disabledTestPaths =
lib.optionals stdenv.hostPlatform.isDarwin [
# These tests may fail if multiple builds run them at the same time due

View file

@ -28,10 +28,6 @@ buildPythonPackage rec {
six
];
preCheck = ''
export OMP_NUM_THREADS=2
'';
nativeCheckInputs = [ pytestCheckHook ];
meta = {

View file

@ -49,7 +49,6 @@ buildPythonPackage rec {
preCheck = ''
cd $TMPDIR
export HOME=$TMPDIR
export OMP_NUM_THREADS=1
'';
meta = {

View file

@ -67,8 +67,6 @@ buildPythonPackage (finalAttrs: {
preCheck = ''
rm linearmodels/__init__.py
export OMP_NUM_THREADS=1
'';
disabledTestPaths = [

View file

@ -82,10 +82,6 @@ buildPythonPackage (finalAttrs: {
writableTmpDirAsHomeHook
];
preCheck = ''
export OMP_NUM_THREADS=1
'';
disabledTests = [
# _pickle.PickleError: ScriptFunction cannot be pickled
"test_run_eval_fail_with_wrong_model"

View file

@ -18,6 +18,8 @@
blas,
lapack,
openmpCheckPhaseHook,
# Reverse dependency
sage,
@ -93,7 +95,6 @@ buildPythonPackage (finalAttrs: {
# see https://github.com/OpenMathLib/OpenBLAS/issues/2993
preConfigure = ''
sed -i 's/-faltivec//' numpy/distutils/system_info.py
export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
'';
preBuild = ''
@ -110,6 +111,10 @@ buildPythonPackage (finalAttrs: {
typing-extensions
];
propagatedNativeBuildInputs = [
openmpCheckPhaseHook
];
preCheck = ''
cd "$out"
'';

View file

@ -93,10 +93,6 @@ buildPythonPackage (finalAttrs: {
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ];
preConfigure = ''
export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
'';
buildInputs = [
blas
lapack

View file

@ -80,7 +80,6 @@ buildPythonPackage (finalAttrs: {
preCheck = ''
# Set config used by tests to ensure reproducibility
echo 'pbc_tools_pbc_fft_engine = "NUMPY"' > pyscf/pyscf_config.py
export OMP_NUM_THREADS=1
ulimit -s 20000
export PYSCF_CONFIG_FILE=$(pwd)/pyscf/pyscf_config.py
'';

View file

@ -62,7 +62,6 @@ buildPythonPackage (finalAttrs: {
# This is due to the Cython-compiled modules not being in the correct location
# of the source tree.
preCheck = ''
export OMP_NUM_THREADS=$NIX_BUILD_CORES
mkdir -p test && cd test
'';

View file

@ -62,10 +62,6 @@ buildPythonPackage (finalAttrs: {
pytestCheckHook
];
preCheck = ''
export OMP_NUM_THREADS=1
'';
# only the $out dir contains the built cython extensions, so we run the tests inside there
enabledTestPaths = [ "${placeholder "out"}/${python.sitePackages}/skbio" ];

View file

@ -116,7 +116,6 @@ buildPythonPackage rec {
preCheck = ''
cd $TMPDIR
export HOME=$TMPDIR
export OMP_NUM_THREADS=1
'';
pythonImportsCheck = [ "sklearn" ];

View file

@ -175,11 +175,6 @@ buildPythonPackage (finalAttrs: {
'';
preCheck = ''
export OMP_NUM_THREADS=$(( $NIX_BUILD_CORES / 4 ))
if [ $OMP_NUM_THREADS -eq 0 ]; then
export OMP_NUM_THREADS=1
fi
cd $out
'';

View file

@ -185,10 +185,6 @@ buildPythonPackage (finalAttrs: {
writableTmpDirAsHomeHook
];
preCheck = ''
export OMP_NUM_THREADS=1
'';
pytestFlags = [
# DeprecationWarning: Failing to pass a value to the 'type_params' parameter of
# 'typing._eval_type' is deprecated, as it leads to incorrect behaviour when calling

View file

@ -42,10 +42,6 @@ buildPythonPackage (finalAttrs: {
nativeCheckInputs = [ pytestCheckHook ];
preCheck = ''
export OMP_NUM_THREADS=1
'';
# RuntimeError: torch.compile is not supported on Python 3.14+
disabledTests = lib.optionals (pythonAtLeast "3.14") [ "test_up" ];