about summary refs log tree commit diff
path: root/pkgs/development/python-modules/ambee
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-06-09 10:19:42 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-06-09 10:19:42 +0200
commit7c915252f992ff871e3dfd31aaf08ace81dc684e (patch)
tree99afb60eb577f5820c549d7954fd395df244b582 /pkgs/development/python-modules/ambee
parent8f34dc40570e4bc8e395c36be751c64ca177b38d (diff)
python3Packages.ambee: init at 0.2.1
Diffstat (limited to 'pkgs/development/python-modules/ambee')
-rw-r--r--pkgs/development/python-modules/ambee/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ambee/default.nix b/pkgs/development/python-modules/ambee/default.nix
new file mode 100644
index 0000000000000..b6fe6851aead5
--- /dev/null
+++ b/pkgs/development/python-modules/ambee/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, buildPythonPackage
+, pythonOlder
+, fetchFromGitHub
+, aiohttp
+, poetry-core
+, yarl
+, aresponses
+, pytest-asyncio
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "ambee";
+  version = "0.2.1";
+  disabled = pythonOlder "3.8";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "frenck";
+    repo = "python-ambee";
+    rev = "v${version}";
+    sha256 = "11liw2206lyrnx09giqapjpi25lr2qnbmigi6rgynr2a1i9vxy1s";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    aiohttp
+    yarl
+  ];
+
+  checkInputs = [
+    aresponses
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    # Upstream doesn't set a version for the pyproject.toml
+    substituteInPlace pyproject.toml \
+      --replace "0.0.0" "${version}" \
+      --replace "--cov" ""
+  '';
+
+  pythonImportsCheck = [ "ambee" ];
+
+  meta = with lib; {
+    description = "Python client for Ambee API";
+    homepage = "https://github.com/frenck/python-ambee";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}