git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #165871 from terlar/add-pyqldb
commit73957ce6aa38a0fa24ee8f367b37f5b77d4eaa1d authorSandro <sandro.jaeckel@gmail.com> dateThu 31 Mar 2022, 14:29 (5 years ago) parent1dfe42f441eaf8
5 files changed+133
pkgs/development/python-modules/amazon-ion/default.nix+29 pkgs/development/python-modules/ionhash/default.nix+38 pkgs/development/python-modules/jsonconversion/default.nix+26 pkgs/development/python-modules/pyqldb/default.nix+32 pkgs/top-level/python-packages.nix+8
pkgs/development/python-modules/amazon-ion/default.nixnew file+29
@@ -0,0 +1,29 @@
1+{ lib, buildPythonPackage, fetchPypi, jsonconversion, six, pytestCheckHook }:
2+
3+buildPythonPackage rec {
4+ pname = "amazon-ion";
5+ version = "0.8.0";
6+
7+ src = fetchPypi {
8+ pname = "amazon.ion";
9+ inherit version;
10+ sha256 = "sha256-vtztUHSnGoPYozhwvigxEdieVtbKNfV4B5yZ4MHaWGw=";
11+ };
12+
13+ postPatch = ''
14+ substituteInPlace setup.py --replace "'pytest-runner'," ""
15+ '';
16+
17+ propagatedBuildInputs = [ jsonconversion six ];
18+
19+ checkInputs = [ pytestCheckHook ];
20+
21+ pythonImportsCheck = [ "amazon.ion" ];
22+
23+ meta = with lib; {
24+ description = "A Python implementation of Amazon Ion";
25+ homepage = "https://github.com/amzn/ion-python";
26+ license = licenses.asl20;
27+ maintainers = [ maintainers.terlar ];
28+ };
29+}
pkgs/development/python-modules/ionhash/default.nixnew file+38
@@ -0,0 +1,38 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, amazon-ion, six, pytestCheckHook }:
2+
3+buildPythonPackage rec {
4+ pname = "ionhash";
5+ version = "1.2.1";
6+
7+ src = fetchFromGitHub {
8+ owner = "amzn";
9+ repo = "ion-hash-python";
10+ rev = "v${version}";
11+ sha256 = "sha256-mXOLKXauWwwIA/LnF4qyZsBiF/QM+rF9MmE2ewmozYo=";
12+ fetchSubmodules = true;
13+ };
14+
15+ patches = [
16+ (fetchpatch {
17+ url = "https://github.com/amzn/ion-hash-python/commit/5cab56d694ecc176e394bb455c2d726ba1514ce0.patch";
18+ sha256 = "sha256-P5QByNafgxI//e3m+b0oG00+rVymCsT/J4dOZSk3354=";
19+ })
20+ ];
21+
22+ postPatch = ''
23+ substituteInPlace setup.py --replace "'pytest-runner'," ""
24+ '';
25+
26+ propagatedBuildInputs = [ amazon-ion six ];
27+
28+ checkInputs = [ pytestCheckHook ];
29+
30+ pythonImportsCheck = [ "ionhash" ];
31+
32+ meta = with lib; {
33+ description = "Python implementation of Amazon Ion Hash";
34+ homepage = "https://github.com/amzn/ion-hash-python";
35+ license = licenses.asl20;
36+ maintainers = [ maintainers.terlar ];
37+ };
38+}
pkgs/development/python-modules/jsonconversion/default.nixnew file+26
@@ -0,0 +1,26 @@
1+{ lib, buildPythonPackage, fetchPypi, pytestCheckHook, numpy }:
2+
3+buildPythonPackage rec {
4+ pname = "jsonconversion";
5+ version = "0.2.13";
6+
7+ src = fetchPypi {
8+ inherit pname version;
9+ sha256 = "sha256-4hMY0N/Px+g5zn3YzNfDWPyi8Pglvd/c2N9SeC4JoZ0=";
10+ };
11+
12+ postPatch = ''
13+ substituteInPlace setup.py --replace "'pytest-runner'" ""
14+ '';
15+
16+ checkInputs = [ pytestCheckHook numpy ];
17+
18+ pythonImportsCheck = [ "jsonconversion" ];
19+
20+ meta = with lib; {
21+ description = "This python module helps converting arbitrary Python objects into JSON strings and back";
22+ homepage = "https://pypi.org/project/jsonconversion/";
23+ license = licenses.bsd2;
24+ maintainers = [ maintainers.terlar ];
25+ };
26+}
pkgs/development/python-modules/pyqldb/default.nixnew file+32
@@ -0,0 +1,32 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, boto3, amazon-ion, ionhash, pytestCheckHook }:
2+
3+buildPythonPackage rec {
4+ pname = "pyqldb";
5+ version = "3.2.2";
6+
7+ src = fetchFromGitHub {
8+ owner = "awslabs";
9+ repo = "amazon-qldb-driver-python";
10+ rev = "v${version}";
11+ sha256 = "sha256-TKf43+k428h8T6ye6mJrnK9D4J1xpIu0QacM7lWJF7w=";
12+ };
13+
14+ propagatedBuildInputs = [ boto3 amazon-ion ionhash ];
15+
16+ checkInputs = [ pytestCheckHook ];
17+
18+ preCheck = ''
19+ export AWS_DEFAULT_REGION=us-east-1
20+ '';
21+
22+ pytestFlagsArray = [ "tests/unit" ];
23+
24+ pythonImportsCheck = [ "pyqldb" ];
25+
26+ meta = with lib; {
27+ description = "Python driver for Amazon QLDB";
28+ homepage = "https://github.com/awslabs/amazon-qldb-driver-python";
29+ license = licenses.asl20;
30+ maintainers = [ maintainers.terlar ];
31+ };
32+}
pkgs/top-level/python-packages.nix+8
@@ -472,6 +472,8 @@ in {
472472
473473 altair = callPackage ../development/python-modules/altair { };
474474
475+ amazon-ion = callPackage ../development/python-modules/amazon-ion { };
476+
475477 amazon_kclpy = callPackage ../development/python-modules/amazon_kclpy { };
476478
477479 ambee = callPackage ../development/python-modules/ambee { };
@@ -4102,6 +4104,8 @@ in {
41024104
41034105 iocapture = callPackage ../development/python-modules/iocapture { };
41044106
4107+ ionhash = callPackage ../development/python-modules/ionhash { };
4108+
41054109 iotawattpy = callPackage ../development/python-modules/iotawattpy { };
41064110
41074111 iowait = callPackage ../development/python-modules/iowait { };
@@ -4310,6 +4314,8 @@ in {
43104314
43114315 json5 = callPackage ../development/python-modules/json5 { };
43124316
4317+ jsonconversion = callPackage ../development/python-modules/jsonconversion { };
4318+
43134319 jsondate = callPackage ../development/python-modules/jsondate { };
43144320
43154321 jsondiff = callPackage ../development/python-modules/jsondiff { };
@@ -7494,6 +7500,8 @@ in {
74947500
74957501 pypytools = callPackage ../development/python-modules/pypytools { };
74967502
7503+ pyqldb = callPackage ../development/python-modules/pyqldb { };
7504+
74977505 pyqrcode = callPackage ../development/python-modules/pyqrcode { };
74987506
74997507 pyqt-builder = callPackage ../development/python-modules/pyqt-builder { };