python3Packages.skorch: disable broken tests (#405978)

This commit is contained in:
Aleksana
2025-05-14 18:08:30 +08:00
committed by GitHub
@@ -2,7 +2,7 @@
lib,
stdenv,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
pythonOlder,
numpy,
scikit-learn,
@@ -17,6 +17,7 @@
pytest-cov-stub,
pytestCheckHook,
safetensors,
transformers,
pythonAtLeast,
}:
@@ -25,9 +26,11 @@ buildPythonPackage rec {
version = "1.1.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-AguMhI/MO4DNexe5azVEXOw7laTRBN0ecFW81qqh0rY=";
src = fetchFromGitHub {
owner = "skorch-dev";
repo = "skorch";
tag = "v${version}";
sha256 = "sha256-f0g/kn3HhvYfGDgLpA7gAnYocJrYqHUq680KrGuoPCQ=";
};
# AttributeError: 'NoneType' object has no attribute 'span' with Python 3.13
@@ -38,6 +41,7 @@ buildPythonPackage rec {
dependencies = [
numpy
pandas
scikit-learn
scipy
tabulate
@@ -47,40 +51,42 @@ buildPythonPackage rec {
nativeCheckInputs = [
flaky
pandas
pytest-cov-stub
pytestCheckHook
safetensors
transformers
];
checkInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
disabledTests =
[
# on CPU, these expect artifacts from previous GPU run
"test_load_cuda_params_to_cpu"
# failing tests
"test_pickle_load"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# there is a problem with the compiler selection
"test_fit_and_predict_with_compile"
];
disabledTests = [
# on CPU, these expect artifacts from previous GPU run
"test_load_cuda_params_to_cpu"
# failing tests
"test_pickle_load"
# there is a problem with the compiler selection
"test_fit_and_predict_with_compile"
# "Weights only load failed"
"test_can_be_copied"
"test_pickle"
"test_pickle_save_load"
"test_train_net_after_copy"
"test_weights_restore"
# Reported as flaky
"test_fit_lbfgs_optimizer"
];
disabledTestPaths =
[
# tries to import `transformers` and download HuggingFace data
"skorch/tests/test_hf.py"
]
++ lib.optionals
(stdenv.hostPlatform.system != "x86_64-linux" && stdenv.hostPlatform.system != "aarch64-darwin")
[
# these tests fail when running in parallel for multiple platforms with:
# "RuntimeError: The server socket has failed to listen on any local
# network address because they use the same hardcoded port." For now,
# running for one platform per OS to avoid spurious failures.
"skorch/tests/test_history.py"
];
disabledTestPaths = [
# tries to download missing HuggingFace data
"skorch/tests/test_dataset.py"
"skorch/tests/test_hf.py"
"skorch/tests/llm/test_llm_classifier.py"
# These tests fail when running in parallel for all platforms with:
# "RuntimeError: The server socket has failed to listen on any local
# network address because they use the same hardcoded port."
# This happens on every platform with sandboxing enabled.
"skorch/tests/test_history.py"
];
pythonImportsCheck = [ "skorch" ];