Unverified Commit f01f29e7 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

Merge pull request #233187 from fabaff/elasticsearch-curator-fix

elasticsearch-curator: 5.8.4 -> 8.0.4 
parents 100cdbc7 b688ff79
Loading
Loading
Loading
Loading
+54 −41
Original line number Diff line number Diff line
{ lib, fetchFromGitHub, python3 }:
{ lib
, fetchFromGitHub
, python3
}:

let
  python = python3.override {
    packageOverrides = self: super: {
      click = super.click.overridePythonAttrs (old: rec {
        version = "7.1.2";
        src = old.src.override {
          inherit version;
          hash = "sha256-0rUlXHxjSbwb0eWeCM0SrLvWPOZJ8liHVXg6qU37axo=";
        };
      });
      requests-aws4auth = super.requests-aws4auth.overridePythonAttrs (old: {
        doCheck = false; # requires click>=8.0
      });
    };
  };
in python.pkgs.buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
  pname = "elasticsearch-curator";
  version = "5.8.4";

  format = "setuptools";
  version = "8.0.4";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "elastic";
    repo = "curator";
    rev = "v${version}";
    hash = "sha256-wSfd52jebUkgF5xhjcoUjI7j46eJF33pVb4Wrybq44g=";
    rev = "refs/tags/v${version}";
    hash = "sha256-FPp2BpfYsmNwwevYQ6EH3N1q0TjyeEsBeDM9EUbLl+Q=";
  };

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "urllib3==1.26.4" "urllib3"
    substituteInPlace setup.py \
      --replace "urllib3==1.26.4" "urllib3" \
      --replace "pyyaml==5.4.1" "pyyaml"
  '';
  pythonRelaxDeps = [
    "click"
    "ecs-logging"
    "elasticsearch8"
    "es_client"
    "pyyaml"
  ];

  propagatedBuildInputs = with python.pkgs; [
    elasticsearch
    urllib3
    requests
    boto3
    requests-aws4auth
  nativeBuildInputs = with python3.pkgs; [
    hatchling
    pythonRelaxDepsHook
  ];

  propagatedBuildInputs = with python3.pkgs; [
    certifi
    click
    ecs-logging
    elasticsearch8
    es-client
    pyyaml
    voluptuous
    certifi
    six
    voluptuous
  ];

  nativeCheckInputs = with python.pkgs; [
  nativeCheckInputs = with python3.pkgs; [
    mock
    requests
    pytestCheckHook
  ];

  disabledTestPaths = [
    "test/integration" # requires running elasticsearch
    # Test requires running elasticsearch
    "tests/integration/test_alias.py"
    "tests/integration/test_allocation.py"
    "tests/integration/test_cli.py"
    "tests/integration/test_close.py"
    "tests/integration/test_clusterrouting.py"
    "tests/integration/test_count_pattern.py"
    "tests/integration/test_create_index.py"
    "tests/integration/test_datemath.py"
    "tests/integration/test_delete_indices.py"
    "tests/integration/test_delete_snapshots.py"
    "tests/integration/test_delete_snapshots.py"
    "tests/integration/test_es_repo_mgr.py"
    "tests/integration/test_forcemerge.py"
    "tests/integration/test_integrations.py"
    "tests/integration/test_open.py"
    "tests/integration/test_reindex.py"
    "tests/integration/test_replicas.py"
    "tests/integration/test_restore.py"
    "tests/integration/test_rollover.py"
    "tests/integration/test_shrink.py"
    "tests/integration/test_snapshot.py"
  ];

  disabledTests = [
    # access network
    # Test require access network
    "test_api_key_not_set"
    "test_api_key_set"
  ];
@@ -80,6 +92,7 @@ in python.pkgs.buildPythonApplication rec {

      * Perform various actions on the items which remain in the actionable list.
    '';
    changelog = "https://github.com/elastic/curator/releases/tag/v${version}";
    maintainers = with maintainers; [ basvandijk ];
  };
}