From b9ca873473bf3e934ec7d425d7aad9808d4cdc10 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 15 Feb 2022 12:25:25 +0100 Subject: [PATCH] python3Packages.net2grid: init at 2.0.0 --- .../python-modules/net2grid/default.nix | 58 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/python-modules/net2grid/default.nix diff --git a/pkgs/development/python-modules/net2grid/default.nix b/pkgs/development/python-modules/net2grid/default.nix new file mode 100644 index 000000000000..47e41b8b7aa7 --- /dev/null +++ b/pkgs/development/python-modules/net2grid/default.nix @@ -0,0 +1,58 @@ +{ lib +, aiohttp +, aresponses +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, yarl +}: + +buildPythonPackage rec { + pname = "net2grid"; + version = "2.0.0"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "klaasnicolaas"; + repo = "python-net2grid"; + rev = "v${version}"; + hash = "sha256-2hjWQaktx7XUS7gf7A+9QNSZSujyVZUka/SwEnEu2dg="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + yarl + ]; + + checkInputs = [ + aresponses + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace '"0.0.0"' '"${version}"' \ + --replace 'addopts = "--cov"' "" + ''; + + pythonImportsCheck = [ + "net2grid" + ]; + + meta = with lib; { + description = "Module for interacting with NET2GRID devices"; + homepage = "https://github.com/klaasnicolaas/python-net2grid"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 09e150fc6717..05a05fbcd328 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5380,6 +5380,8 @@ in { nestedtext = callPackage ../development/python-modules/nestedtext { }; + net2grid = callPackage ../development/python-modules/net2grid { }; + netaddr = callPackage ../development/python-modules/netaddr { }; netcdf4 = callPackage ../development/python-modules/netcdf4 { };