about summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-22 16:08:33 +0100
committerGitHub <noreply@github.com>2021-01-22 16:08:33 +0100
commit15e6801eb3bca058e14c833197e9ead11a3912e8 (patch)
tree3ec4d19ffa1117ab77ea0cb5273224091eaba3ef /pkgs/development/python-modules
parenteca1193ed963ef3df43ac7aa796c2229f33d31b6 (diff)
parent65301a3df7ff4561ab75f2dfb00061dcc6082b40 (diff)
downloadnixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.tar
nixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.tar.gz
nixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.tar.bz2
nixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.tar.lz
nixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.tar.xz
nixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.tar.zst
nixlib-15e6801eb3bca058e14c833197e9ead11a3912e8.zip
Merge pull request #110456 from fabaff/sendgrid
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/python-http-client/default.nix34
-rw-r--r--pkgs/development/python-modules/sendgrid/default.nix49
-rw-r--r--pkgs/development/python-modules/starkbank-ecdsa/default.nix28
3 files changed, 111 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/python-http-client/default.nix b/pkgs/development/python-modules/python-http-client/default.nix
new file mode 100644
index 000000000000..f4b19ba379e4
--- /dev/null
+++ b/pkgs/development/python-modules/python-http-client/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, mock
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "python_http_client";
+  version = "3.3.1";
+
+  src = fetchFromGitHub {
+    owner = "sendgrid";
+    repo = "python-http-client";
+    rev = version;
+    sha256 = "0mbcg0vb9v41v7hbvycrxx5wyrf3ysvfgxkix8hn8c4x5l2lmidc";
+  };
+
+  checkInputs = [
+    mock
+    pytestCheckHook
+  ];
+
+  # Failure was fixed by https://github.com/sendgrid/python-http-client/commit/6d62911ab0d0645b499e14bb17c302b48f3c10e4
+  disabledTests = [ "test__daterange" ];
+  pythonImportsCheck = [ "python_http_client" ];
+
+  meta = with lib; {
+    description = "Python HTTP library to call APIs";
+    homepage = "https://github.com/sendgrid/python-http-client";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/sendgrid/default.nix b/pkgs/development/python-modules/sendgrid/default.nix
new file mode 100644
index 000000000000..77cd35938635
--- /dev/null
+++ b/pkgs/development/python-modules/sendgrid/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, flask
+, pytestCheckHook
+, python-http-client
+, pyyaml
+, starkbank-ecdsa
+, werkzeug
+}:
+
+buildPythonPackage rec {
+  pname = "sendgrid";
+  version = "6.5.0";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = "sendgrid-python";
+    rev = version;
+    sha256 = "14kqjdv49486ksc1s0m0hc4k5nf9vn1v1g489mpib01hiiqxjp1b";
+  };
+
+  propagatedBuildInputs = [
+    python-http-client
+    starkbank-ecdsa
+  ];
+
+  checkInputs = [
+    flask
+    pytestCheckHook
+    pyyaml
+    werkzeug
+  ];
+
+  # Exclude tests that require network access
+  pytestFlagsArray = [
+    "--ignore test/test_sendgrid.py"
+    "--ignore live_test.py"
+  ];
+
+  pythonImportsCheck = [ "sendgrid" ];
+
+  meta = with lib; {
+    description = "Python client for SendGrid";
+    homepage = "https://github.com/sendgrid/sendgrid-python";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/starkbank-ecdsa/default.nix b/pkgs/development/python-modules/starkbank-ecdsa/default.nix
new file mode 100644
index 000000000000..70b66b9a4683
--- /dev/null
+++ b/pkgs/development/python-modules/starkbank-ecdsa/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "starkbank-ecdsa";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "starkbank";
+    repo = "ecdsa-python";
+    rev = "v${version}";
+    sha256 = "03smk33zhmv1j1svgjnykak0jnw8yl0yv03i1gsasx71f33zmfwi";
+  };
+
+  checkInputs = [ pytestCheckHook ];
+  pytestFlagsArray = [ "-v tests/*.py" ];
+  pythonImportsCheck = [ "ellipticcurve" ];
+
+  meta = with lib; {
+    description = "Python ECDSA library";
+    homepage = "https://github.com/starkbank/ecdsa-python";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}