Unverified Commit 42cfe992 authored by Yt's avatar Yt Committed by GitHub
Browse files

python3Packages.hydra-core: skip failing test on python>=3.14 (#481936)

parents 4e4825f1 78aca25a
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -44,20 +44,18 @@
  pytest-mock,
  pytestCheckHook,
  torchvision,
  pythonAtLeast,
}:

let
buildPythonPackage (finalAttrs: {
  pname = "detectron2";
  version = "0.6";
in
buildPythonPackage {
  inherit pname version;
  pyproject = true;

  src = fetchFromGitHub {
    owner = "facebookresearch";
    repo = "detectron2";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-TosuUZ1hJrXF3VGzsGO2hmQJitGUxe7FyZyKjNh+zPA=";
  };

@@ -188,6 +186,12 @@ buildPythonPackage {
    "test_apply_deltas_tracing"
    "test_imagelist_padding_tracing"
    "test_roi_pooler_tracing"
  ]
  ++ lib.optionals (pythonAtLeast "3.14") [
    # AttributeError: '...' object has no attribute '__annotations__'
    "test_default_anchor_generator_centered"
    "test_scriptability_cpu"
    "test_scriptable_cpu"
  ];

  pythonImportsCheck = [ "detectron2" ];
@@ -198,4 +202,4 @@ buildPythonPackage {
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ happysalada ];
  };
}
})
+47 −5
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
  pythonAtLeast,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "hydra-core";
  version = "1.3.2";
  pyproject = true;
@@ -32,7 +32,7 @@ buildPythonPackage rec {
  src = fetchFromGitHub {
    owner = "facebookresearch";
    repo = "hydra";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-kD4BStnstr5hwyAOxdpPzLAJ9MZqU/CPiHkaD2HnUPI=";
  };

@@ -87,9 +87,51 @@ buildPythonPackage rec {
  ++ lib.optionals (pythonAtLeast "3.13") [
    # AssertionError: Regex pattern did not match
    "test_failure"
  ]
  ++ lib.optionals (pythonAtLeast "3.14") [
    # AssertionError: Regex pattern did not match
    "test_partial_failure"

    # AssertionError: Mismatch between expected and actual text
    "test_write_protect_config_node"

    # ValueError: badly formed help string
    "TestBasicLauncherIntegration"
    "test_cli_error"
    "test_completion_plugin"
    "test_completion_plugin_multirun"
    "test_configuring_experiments"
    "test_examples_using_the_config_object"
    "test_extending_configs"
    "test_file_completion"
    "test_missing_default_value"
    "test_multi_select"
    "test_searchpath_addition"
    "test_tutorial_config_file"
    "test_tutorial_config_file_bad_key"
    "test_tutorial_config_groups"
    "test_tutorial_defaults"
    "test_tutorial_logging"
    "test_tutorial_simple_cli_app"
    "test_tutorial_working_directory"
    "test_tutorial_working_directory_original_cwd"
    "test_with_flags"
  ];

  disabledTestPaths = [ "tests/test_hydra.py" ];
  disabledTestPaths = [
    "tests/test_hydra.py"
  ]
  ++ lib.optionals (pythonAtLeast "3.14") [
    # ValueError: badly formed help string
    "tests/test_callbacks.py"
    "tests/test_env_defaults.py"
    "tests/test_examples/test_advanced_package_overrides.py"
    "tests/test_examples/test_basic_sweep.py"
    "tests/test_examples/test_configure_hydra.py"
    "tests/test_examples/test_experimental.py"
    "tests/test_examples/test_instantiate_examples.py"
    "tests/test_examples/test_structured_configs_tutorial.py"
  ];

  pythonImportsCheck = [
    "hydra"
@@ -100,8 +142,8 @@ buildPythonPackage rec {
  meta = {
    description = "Framework for configuring complex applications";
    homepage = "https://hydra.cc";
    changelog = "https://github.com/facebookresearch/hydra/blob/v${version}/NEWS.md";
    changelog = "https://github.com/facebookresearch/hydra/blob/${finalAttrs.src.tag}/NEWS.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}
})
+8 −5
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonAtLeast,

  # build-system
  setuptools,
@@ -14,20 +14,23 @@
  pytestCheckHook,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "hydra-joblib-launcher";
  pyproject = true;

  inherit (hydra-core) version src;

  sourceRoot = "${src.name}/plugins/hydra_joblib_launcher";
  # _pickle.PicklingError: Could not pickle the task to send it to the workers
  disabled = pythonAtLeast "3.14";

  sourceRoot = "${finalAttrs.src.name}/plugins/hydra_joblib_launcher";

  # get rid of deprecated "read_version" dependency, no longer in Nixpkgs:
  postPatch = ''
    substituteInPlace pyproject.toml --replace-fail ', "read-version"' ""
    substituteInPlace setup.py  \
      --replace-fail 'from read_version import read_version' ""  \
      --replace-fail 'version=read_version("hydra_plugins/hydra_joblib_launcher", "__init__.py"),' 'version="${version}",'
      --replace-fail 'version=read_version("hydra_plugins/hydra_joblib_launcher", "__init__.py"),' 'version="${finalAttrs.version}",'
  '';

  build-system = [
@@ -52,4 +55,4 @@ buildPythonPackage rec {
    homepage = "https://hydra.cc/docs/plugins/joblib_launcher";
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}
})