diff --git a/pkgs/development/python-modules/limiter/default.nix b/pkgs/development/python-modules/limiter/default.nix new file mode 100644 index 000000000000..21217f34673f --- /dev/null +++ b/pkgs/development/python-modules/limiter/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, token-bucket +}: + +buildPythonPackage rec { + pname = "limiter"; + version = "0.1.2"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "alexdelorenzo"; + repo = pname; + rev = "v${version}"; + sha256 = "0cdqw08qw3cid1yjknlh4hqfl46xh4madkjrl7sxk2c1pbwils8r"; + }; + + propagatedBuildInputs = [ + token-bucket + ]; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "token-bucket==0.2.0" "token-bucket>=0.2.0" + ''; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ + "limiter" + ]; + + meta = with lib; { + description = "Python rate-limiting, thread-safe and asynchronous decorators and context managers"; + homepage = "https://github.com/alexdelorenzo/limiter"; + license = with licenses; [ agpl3Only ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/spyse-python/default.nix b/pkgs/development/python-modules/spyse-python/default.nix new file mode 100644 index 000000000000..65e382ce30d1 --- /dev/null +++ b/pkgs/development/python-modules/spyse-python/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, dataclasses-json +, fetchFromGitHub +, limiter +, pythonOlder +, requests +, responses +}: + +buildPythonPackage rec { + pname = "spyse-python"; + version = "2.2.3"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "spyse-com"; + repo = pname; + rev = "v${version}"; + sha256 = "041k0037anwaxp2mh7mdk8rdsw9hdr3arigyyqfxfn35x8j41c3k"; + }; + + propagatedBuildInputs = [ + requests + dataclasses-json + responses + limiter + ]; + + # Tests requires an API token + doCheck = false; + + postPatch = '' + substituteInPlace setup.py \ + --replace "'dataclasses~=0.6'," "" \ + --replace "responses~=0.13.3" "responses>=0.13.3" + ''; + + pythonImportsCheck = [ + "spyse" + ]; + + meta = with lib; { + description = "Python module for spyse.com API"; + homepage = "https://github.com/spyse-com/spyse-python"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f2fc7434b7f5..e5191c2e3237 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4315,6 +4315,8 @@ in { lima = callPackage ../development/python-modules/lima { }; + limiter= callPackage ../development/python-modules/limiter { }; + limitlessled = callPackage ../development/python-modules/limitlessled { }; limits = callPackage ../development/python-modules/limits { }; @@ -8673,6 +8675,8 @@ in { spyder-kernels = callPackage ../development/python-modules/spyder-kernels { }; + spyse-python = callPackage ../development/python-modules/spyse-python { }; + sqlalchemy = callPackage ../development/python-modules/sqlalchemy { }; sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };