Skip to content

Commit

Permalink
Merge pull request #110456 from fabaff/sendgrid
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Jan 22, 2021
2 parents eca1193 + 65301a3 commit 15e6801
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 1 deletion.
34 changes: 34 additions & 0 deletions pkgs/development/python-modules/python-http-client/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
49 changes: 49 additions & 0 deletions pkgs/development/python-modules/sendgrid/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
28 changes: 28 additions & 0 deletions pkgs/development/python-modules/starkbank-ecdsa/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
2 changes: 1 addition & 1 deletion pkgs/servers/home-assistant/component-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@
"scsgate" = ps: with ps; [ ]; # missing inputs: scsgate
"search" = ps: with ps; [ aiohttp-cors ];
"season" = ps: with ps; [ ephem ];
"sendgrid" = ps: with ps; [ ]; # missing inputs: sendgrid
"sendgrid" = ps: with ps; [ sendgrid ];
"sense" = ps: with ps; [ ]; # missing inputs: sense_energy
"sensehat" = ps: with ps; [ ]; # missing inputs: sense-hat
"sensibo" = ps: with ps; [ ]; # missing inputs: pysensibo
Expand Down
6 changes: 6 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6199,6 +6199,8 @@ in {

python-hpilo = callPackage ../development/python-modules/python-hpilo { };

python-http-client = callPackage ../development/python-modules/python-http-client { };

python-igraph = callPackage ../development/python-modules/python-igraph {
pkg-config = pkgs.pkg-config;
igraph = pkgs.igraph;
Expand Down Expand Up @@ -6981,6 +6983,8 @@ in {

send2trash = callPackage ../development/python-modules/send2trash { };

sendgrid = callPackage ../development/python-modules/sendgrid { };

sentencepiece = callPackage ../development/python-modules/sentencepiece { inherit (pkgs) sentencepiece pkg-config; };

sentinel = callPackage ../development/python-modules/sentinel { };
Expand Down Expand Up @@ -7367,6 +7371,8 @@ in {
inherit (pkgs.darwin.apple_sdk.frameworks) ApplicationServices;
};

starkbank-ecdsa = callPackage ../development/python-modules/starkbank-ecdsa { };

staticjinja = callPackage ../development/python-modules/staticjinja { };

statistics = callPackage ../development/python-modules/statistics { };
Expand Down

0 comments on commit 15e6801

Please sign in to comment.