Unverified Commit 77e68f9b authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #287965 from fabaff/slowapi-bump

python311Packages.slowapi: 0.1.8 -> 0.1.9
parents bb49848f 4f94d3a6
Loading
Loading
Loading
Loading
+67 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, grpcio
, protobuf
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
, setuptools
, setuptools-scm
}:

buildPythonPackage rec {
  pname = "aetcd";
  version = "1.0.0a4";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "martyanov";
    repo = "aetcd";
    rev = "refs/tags/v${version}";
    hash = "sha256-g49ppfh8dyGpZeu/HdTDX8RAk5VTcZmqENRpNY12qkg=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail "setuptools_scm==6.3.2" "setuptools_scm"
    substituteInPlace setup.cfg \
      --replace-fail "--cov=aetcd" ""
  '';

  nativeBuildInputs = [
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
    grpcio
    protobuf
  ];

  nativeCheckInputs = [
    pytest-asyncio
    pytest-mock
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "aetcd"
  ];

  disabledTestPaths = [
    # Tests require a running ectd instance
    "tests/integration/"
  ];

  meta = with lib; {
    description = "Python asyncio-based client for etcd";
    homepage = "https://github.com/martyanov/aetcd";
    changelog = "https://github.com/martyanov/aetcd/blob/v${version}/docs/changelog.rst";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
  };
}
+54 −21
Original line number Diff line number Diff line
{ lib
, aetcd
, buildPythonPackage
, coredis
, deprecated
, fetchFromGitHub
, etcd3
, fetchFromGitHub
, hiro
, importlib-resources
, motor
, packaging
, pymemcache
, pymongo
@@ -20,13 +23,13 @@
buildPythonPackage rec {
  pname = "limits";
  version = "3.7.0";
  format = "setuptools";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "alisaifee";
    repo = pname;
    repo = "limits";
    rev = "refs/tags/${version}";
    # Upstream uses versioneer, which relies on git attributes substitution.
    # This leads to non-reproducible archives on github. Remove the substituted
@@ -37,36 +40,65 @@ buildPythonPackage rec {
    hash = "sha256-0h3ofungHkjycUvNJ3jf+VB/GSrshgUDECN2YoPGzzg=";
  };

  postPatch = ''
    substituteInPlace pytest.ini \
      --replace-fail "--cov=limits" "" \
      --replace-fail "-K" ""

    substituteInPlace setup.py \
      --replace-fail "versioneer.get_version()" "'${version}'"

    # Recreate _version.py, deleted at fetch time due to non-reproducibility.
    echo 'def get_versions(): return {"version": "${version}"}' > limits/_version.py
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    deprecated
    importlib-resources
    packaging
    setuptools
    typing-extensions
  ];

  nativeCheckInputs = [
    etcd3
    hiro
  passthru.optional-dependencies = {
    redis = [
      redis
    ];
    rediscluster = [
      redis
    ];
    memcached = [
      pymemcache
    ];
    mongodb = [
      pymongo
    ];
    etcd = [
      etcd3
    ];
    async-redis = [
      coredis
    ];
    # async-memcached = [
    #   emcache  # Missing module
    # ];
    async-mongodb = [
      motor
    ];
    async-etcd = [
      aetcd
    ];
  };

  nativeCheckInputs = [
    hiro
    pytest-asyncio
    pytest-lazy-fixture
    pytestCheckHook
    redis
  ];

  postPatch = ''
    substituteInPlace pytest.ini \
      --replace "--cov=limits" "" \
      --replace "-K" ""

    substituteInPlace setup.py \
      --replace "versioneer.get_version()" "'${version}'"

    # Recreate _version.py, deleted at fetch time due to non-reproducibility.
    echo 'def get_versions(): return {"version": "${version}"}' > limits/_version.py
  '';
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  pythonImportsCheck = [
    "limits"
@@ -82,6 +114,7 @@ buildPythonPackage rec {
  meta = with lib; {
    description = "Rate limiting using various strategies and storage backends such as redis & memcached";
    homepage = "https://github.com/alisaifee/limits";
    changelog = "https://github.com/alisaifee/limits/releases/tag/${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
+4 −15
Original line number Diff line number Diff line
@@ -10,37 +10,26 @@
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, pythonRelaxDepsHook
, redis
, starlette
}:

buildPythonPackage rec {
  pname = "slowapi";
  version = "0.1.8";
  format = "pyproject";
  version = "0.1.9";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "laurentS";
    repo = pname;
    repo = "slowapi";
    rev = "refs/tags/v${version}";
    hash = "sha256-xgHz8b95SXf/GwzKPfQ/RHbUNJfCx6+7a2HB8+6hjsw=";
    hash = "sha256-R/Mr+Qv22AN7HCDGmAUVh4efU8z4gMIyhC0AuKmxgdE=";
  };

  pythonRelaxDeps = [
    "limits"
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace '["redis^3.4.1"]' '["redis"]'
  '';

  nativeBuildInputs = [
    poetry-core
    pythonRelaxDepsHook
  ];

  propagatedBuildInputs = [
+2 −0
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ self: super: with self; {
  aesedb = callPackage ../development/python-modules/aesedb { };
  aetcd = callPackage ../development/python-modules/aetcd { };
  afdko = callPackage ../development/python-modules/afdko { };
  affine = callPackage ../development/python-modules/affine { };