diff --git a/pkgs/development/python-modules/http-message-signatures/default.nix b/pkgs/development/python-modules/http-message-signatures/default.nix new file mode 100644 index 000000000000..fb67dd34c7b5 --- /dev/null +++ b/pkgs/development/python-modules/http-message-signatures/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, cryptography +, fetchFromGitHub +, http-sfv +, pytestCheckHook +, pythonOlder +, setuptools-scm +, requests +}: + +buildPythonPackage rec { + pname = "http-message-signatures"; + version = "0.4.3"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pyauth"; + repo = pname; + rev = "v${version}"; + hash = "sha256-CMF9p913P04Hx/221ck1e0AoAsP7aXkX2UKp4S1nnU0="; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + cryptography + http-sfv + ]; + + checkInputs = [ + pytestCheckHook + requests + ]; + + pytestFlagsArray = [ + "test/test.py" + ]; + + pythonImportsCheck = [ + "http_message_signatures" + ]; + + meta = with lib; { + description = "Requests authentication module for HTTP Signature"; + homepage = "https://github.com/pyauth/http-message-signatures"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/http-sfv/default.nix b/pkgs/development/python-modules/http-sfv/default.nix new file mode 100644 index 000000000000..264065b6efa1 --- /dev/null +++ b/pkgs/development/python-modules/http-sfv/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, typing-extensions +}: + +buildPythonPackage rec { + pname = "http-sfv"; + version = "0.9.5"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "mnot"; + repo = "http_sfv"; + rev = "http_sfv-${version}"; + hash = "sha256-hzg5vRX0vNKS/hYLF6n8mLK5qiwP7do4M8YMlBAA66I="; + }; + + propagatedBuildInputs = [ + typing-extensions + ]; + + # Tests require external data (https://github.com/httpwg/structured-field-tests) + doCheck = false; + + pythonImportsCheck = [ + "http_sfv" + ]; + + meta = with lib; { + description = "Module to parse and serialise HTTP structured field values"; + homepage = "https://github.com/mnot/http_sfv"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/requests-http-signature/default.nix b/pkgs/development/python-modules/requests-http-signature/default.nix index c51e24e0ac9d..96ade3b45f6d 100644 --- a/pkgs/development/python-modules/requests-http-signature/default.nix +++ b/pkgs/development/python-modules/requests-http-signature/default.nix @@ -1,25 +1,37 @@ { lib , buildPythonPackage , fetchFromGitHub -, cryptography +, http-message-signatures +, http-sfv , requests , pytestCheckHook +, pythonOlder +, setuptools-scm }: buildPythonPackage rec { pname = "requests-http-signature"; - version = "0.2.0"; + version = "0.7.1"; format = "setuptools"; + disabled = pythonOlder "3.7"; + src = fetchFromGitHub { owner = "pyauth"; repo = pname; rev = "v${version}"; - hash = "sha256-B45P/loXcRKOChSDeHOnlz+67mtmTeAMYlo21TOmV8s="; + hash = "sha256-sW2vYqT/nY27DvEKHdptc3dUpuqKmD7PLMs+Xp+cpeU="; }; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + propagatedBuildInputs = [ - cryptography + http-message-signatures + http-sfv requests ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 268791fb2303..2f185abf3d19 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3887,8 +3887,12 @@ in { httplib2 = callPackage ../development/python-modules/httplib2 { }; + http-message-signatures = callPackage ../development/python-modules/http-message-signatures { }; + http-parser = callPackage ../development/python-modules/http-parser { }; + http-sfv = callPackage ../development/python-modules/http-sfv { }; + httpretty = callPackage ../development/python-modules/httpretty { }; httpserver = callPackage ../development/python-modules/httpserver { };