diff --git a/pkgs/development/python-modules/amazon-ion/default.nix b/pkgs/development/python-modules/amazon-ion/default.nix new file mode 100644 index 000000000000..016fa989a8ab --- /dev/null +++ b/pkgs/development/python-modules/amazon-ion/default.nix @@ -0,0 +1,29 @@ +{ lib, buildPythonPackage, fetchPypi, jsonconversion, six, pytestCheckHook }: + +buildPythonPackage rec { + pname = "amazon-ion"; + version = "0.8.0"; + + src = fetchPypi { + pname = "amazon.ion"; + inherit version; + sha256 = "sha256-vtztUHSnGoPYozhwvigxEdieVtbKNfV4B5yZ4MHaWGw="; + }; + + postPatch = '' + substituteInPlace setup.py --replace "'pytest-runner'," "" + ''; + + propagatedBuildInputs = [ jsonconversion six ]; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "amazon.ion" ]; + + meta = with lib; { + description = "A Python implementation of Amazon Ion"; + homepage = "https://github.com/amzn/ion-python"; + license = licenses.asl20; + maintainers = [ maintainers.terlar ]; + }; +} diff --git a/pkgs/development/python-modules/ionhash/default.nix b/pkgs/development/python-modules/ionhash/default.nix new file mode 100644 index 000000000000..4d90d572876c --- /dev/null +++ b/pkgs/development/python-modules/ionhash/default.nix @@ -0,0 +1,38 @@ +{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, amazon-ion, six, pytestCheckHook }: + +buildPythonPackage rec { + pname = "ionhash"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "amzn"; + repo = "ion-hash-python"; + rev = "v${version}"; + sha256 = "sha256-mXOLKXauWwwIA/LnF4qyZsBiF/QM+rF9MmE2ewmozYo="; + fetchSubmodules = true; + }; + + patches = [ + (fetchpatch { + url = "https://github.com/amzn/ion-hash-python/commit/5cab56d694ecc176e394bb455c2d726ba1514ce0.patch"; + sha256 = "sha256-P5QByNafgxI//e3m+b0oG00+rVymCsT/J4dOZSk3354="; + }) + ]; + + postPatch = '' + substituteInPlace setup.py --replace "'pytest-runner'," "" + ''; + + propagatedBuildInputs = [ amazon-ion six ]; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "ionhash" ]; + + meta = with lib; { + description = "Python implementation of Amazon Ion Hash"; + homepage = "https://github.com/amzn/ion-hash-python"; + license = licenses.asl20; + maintainers = [ maintainers.terlar ]; + }; +} diff --git a/pkgs/development/python-modules/jsonconversion/default.nix b/pkgs/development/python-modules/jsonconversion/default.nix new file mode 100644 index 000000000000..22f7fe4625d1 --- /dev/null +++ b/pkgs/development/python-modules/jsonconversion/default.nix @@ -0,0 +1,26 @@ +{ lib, buildPythonPackage, fetchPypi, pytestCheckHook, numpy }: + +buildPythonPackage rec { + pname = "jsonconversion"; + version = "0.2.13"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-4hMY0N/Px+g5zn3YzNfDWPyi8Pglvd/c2N9SeC4JoZ0="; + }; + + postPatch = '' + substituteInPlace setup.py --replace "'pytest-runner'" "" + ''; + + checkInputs = [ pytestCheckHook numpy ]; + + pythonImportsCheck = [ "jsonconversion" ]; + + meta = with lib; { + description = "This python module helps converting arbitrary Python objects into JSON strings and back"; + homepage = "https://pypi.org/project/jsonconversion/"; + license = licenses.bsd2; + maintainers = [ maintainers.terlar ]; + }; +} diff --git a/pkgs/development/python-modules/pyqldb/default.nix b/pkgs/development/python-modules/pyqldb/default.nix new file mode 100644 index 000000000000..a6fd8665fd14 --- /dev/null +++ b/pkgs/development/python-modules/pyqldb/default.nix @@ -0,0 +1,32 @@ +{ lib, buildPythonPackage, fetchFromGitHub, boto3, amazon-ion, ionhash, pytestCheckHook }: + +buildPythonPackage rec { + pname = "pyqldb"; + version = "3.2.2"; + + src = fetchFromGitHub { + owner = "awslabs"; + repo = "amazon-qldb-driver-python"; + rev = "v${version}"; + sha256 = "sha256-TKf43+k428h8T6ye6mJrnK9D4J1xpIu0QacM7lWJF7w="; + }; + + propagatedBuildInputs = [ boto3 amazon-ion ionhash ]; + + checkInputs = [ pytestCheckHook ]; + + preCheck = '' + export AWS_DEFAULT_REGION=us-east-1 + ''; + + pytestFlagsArray = [ "tests/unit" ]; + + pythonImportsCheck = [ "pyqldb" ]; + + meta = with lib; { + description = "Python driver for Amazon QLDB"; + homepage = "https://github.com/awslabs/amazon-qldb-driver-python"; + license = licenses.asl20; + maintainers = [ maintainers.terlar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 84dd3512e9de..a8fa9c95307c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -472,6 +472,8 @@ in { altair = callPackage ../development/python-modules/altair { }; + amazon-ion = callPackage ../development/python-modules/amazon-ion { }; + amazon_kclpy = callPackage ../development/python-modules/amazon_kclpy { }; ambee = callPackage ../development/python-modules/ambee { }; @@ -4102,6 +4104,8 @@ in { iocapture = callPackage ../development/python-modules/iocapture { }; + ionhash = callPackage ../development/python-modules/ionhash { }; + iotawattpy = callPackage ../development/python-modules/iotawattpy { }; iowait = callPackage ../development/python-modules/iowait { }; @@ -4310,6 +4314,8 @@ in { json5 = callPackage ../development/python-modules/json5 { }; + jsonconversion = callPackage ../development/python-modules/jsonconversion { }; + jsondate = callPackage ../development/python-modules/jsondate { }; jsondiff = callPackage ../development/python-modules/jsondiff { }; @@ -7494,6 +7500,8 @@ in { pypytools = callPackage ../development/python-modules/pypytools { }; + pyqldb = callPackage ../development/python-modules/pyqldb { }; + pyqrcode = callPackage ../development/python-modules/pyqrcode { }; pyqt-builder = callPackage ../development/python-modules/pyqt-builder { };