Files
nixpkgs/pkgs/development/python-modules/apricot-select/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

81 lines
1.9 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
apricot-select,
numba,
numpy,
pytestCheckHook,
scikit-learn,
scipy,
setuptools,
torchvision,
tqdm,
}:
buildPythonPackage rec {
pname = "apricot-select";
version = "0.6.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jmschrei";
repo = "apricot";
tag = version;
hash = "sha256-v9BHFxmlbwXVipPze/nV35YijdFBuka3gAl85AlsffQ=";
};
patches = [
# migrate to pytest, https://github.com/jmschrei/apricot/pull/43
(fetchpatch2 {
url = "https://github.com/jmschrei/apricot/commit/ffa5cce97292775c0d6890671a19cacd2294383f.patch?full_index=1";
hash = "sha256-9A49m4587kAPK/kzZBqMRPwuA40S3HinLXaslYUcWdM=";
})
];
build-system = [ setuptools ];
dependencies = [
numba
numpy
scikit-learn
scipy
torchvision
tqdm
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "apricot" ];
disabledTestPaths = [
# Tests require nose
"tests/test_optimizers/test_knapsack_facility_location.py"
"tests/test_optimizers/test_knapsack_feature_based.py"
];
# NOTE: These tests seem to be flaky.
disabledTests = [
"test_digits_modular"
"test_digits_modular_object"
"test_digits_modular_sparse"
"test_digits_sqrt_modular"
"test_digits_sqrt_modular_object"
"test_digits_sqrt_modular_sparse"
];
# NOTE: Tests are disabled by default because they can run for hours and timeout on Hydra.
doCheck = false;
passthru.tests.check = apricot-select.overridePythonAttrs { doCheck = true; };
meta = {
description = "Module for submodular optimization for the purpose of selecting subsets of massive data sets";
homepage = "https://github.com/jmschrei/apricot";
changelog = "https://github.com/jmschrei/apricot/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};
}