diff --git a/pkgs/development/python-modules/prowlpy/default.nix b/pkgs/development/python-modules/prowlpy/default.nix index 55a6e19b6797..c4cd08413856 100644 --- a/pkgs/development/python-modules/prowlpy/default.nix +++ b/pkgs/development/python-modules/prowlpy/default.nix @@ -1,42 +1,42 @@ { buildPythonPackage, - click, + cacert, fetchFromGitHub, - httpx, lib, loguru, + pyreqwest, pytest-asyncio, pytest-cov-stub, pytestCheckHook, respx, setuptools, + typer, xmltodict, }: buildPythonPackage rec { pname = "prowlpy"; - version = "1.1.5"; + version = "2.0.0"; pyproject = true; src = fetchFromGitHub { owner = "OMEGARAZER"; repo = "prowlpy"; tag = "v${version}"; - hash = "sha256-psXq858y5wsDU5GqGOzVFmYBSZvfuYXzOTZ20mx8PMw="; + hash = "sha256-S+hhZndOb5O9okrrnXGt7D0N4VRIThbMN1LYVPGzFy8="; }; build-system = [ setuptools ]; dependencies = [ - httpx + pyreqwest xmltodict - ] - ++ httpx.optional-dependencies.http2; + ]; optional-dependencies = { cli = [ - click loguru + typer ]; }; @@ -50,6 +50,12 @@ buildPythonPackage rec { ] ++ lib.concatAttrValues optional-dependencies; + preCheck = '' + # Without this pyreqwest fails with + # unexpected error: No CA certificates were loaded from the system + export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt" + ''; + # tests fail without this pytestFlags = [ "-v" ]; diff --git a/pkgs/development/python-modules/pyreqwest/default.nix b/pkgs/development/python-modules/pyreqwest/default.nix new file mode 100644 index 000000000000..10b189757108 --- /dev/null +++ b/pkgs/development/python-modules/pyreqwest/default.nix @@ -0,0 +1,78 @@ +{ + buildPythonPackage, + cacert, + dirty-equals, + docker, + fetchFromGitHub, + granian, + httpx, + lib, + pydantic, + pytest-asyncio, + pytestCheckHook, + requests-toolbelt, + rustPlatform, + starlette, + syrupy, + trustme, + yarl, +}: + +buildPythonPackage (finalAttrs: { + pname = "pyreqwest"; + version = "0.12.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "MarkusSintonen"; + repo = "pyreqwest"; + tag = "v${finalAttrs.version}"; + hash = "sha256-o33/KkPBl4ActDV0R8KqWll6F47HPO3amHFI00rHryE="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) pname version src; + hash = "sha256-+flEikEImbiu/x+pJQz3rynYKmfjaS9N0/A1HSzH0jU="; + }; + + build-system = [ + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + ]; + + pythonImportsCheck = [ "pyreqwest" ]; + + nativeCheckInputs = [ + dirty-equals + docker + granian + httpx + pydantic + pytest-asyncio + pytestCheckHook + requests-toolbelt + starlette + syrupy + trustme + yarl + ]; + + preCheck = '' + # Without this tests fails with + # unexpected error: No CA certificates were loaded from the system + export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt" + ''; + + disabledTestPaths = [ + # requires a running Docker daemon + "tests/test_examples.py" + ]; + + meta = { + changelog = "https://github.com/MarkusSintonen/pyreqwest/releases/tag/${finalAttrs.src.tag}"; + description = "Fast Python HTTP client based on Rust reqwest"; + homepage = "https://github.com/MarkusSintonen/pyreqwest"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.dotlambda ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d55902fe5911..0443a3664d6a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14992,6 +14992,8 @@ self: super: with self; { pyrepetierng = callPackage ../development/python-modules/pyrepetierng { }; + pyreqwest = callPackage ../development/python-modules/pyreqwest { }; + pyrevolve = callPackage ../development/python-modules/pyrevolve { }; pyrfc3339 = callPackage ../development/python-modules/pyrfc3339 { };