about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyversasense
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-11-20 21:02:03 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2021-11-20 21:02:03 +0100
commitfcd53ad43a7ae2477e47ec141b8727e0b2651157 (patch)
tree31e33664e9f4be5def1916bd8d744cae408566ee /pkgs/development/python-modules/pyversasense
parent293e6f0ce5e0db0cbc7ba783c0b3ff31293f3d8f (diff)
python3Packages.pyversasense: init at 0.0.6
Diffstat (limited to 'pkgs/development/python-modules/pyversasense')
-rw-r--r--pkgs/development/python-modules/pyversasense/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pyversasense/default.nix b/pkgs/development/python-modules/pyversasense/default.nix
new file mode 100644
index 0000000000000..f462deedd48c9
--- /dev/null
+++ b/pkgs/development/python-modules/pyversasense/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, aiohttp
+, asynctest
+, buildPythonPackage
+, fetchFromGitHub
+, pytest-asyncio
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "pyversasense";
+  version = "0.0.6";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "imstevenxyz";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "vTaDEwImWDMInwti0Jj+j+RFEtXOOKtiH5wOMD6ZmJk=";
+  };
+
+  propagatedBuildInputs = [
+    aiohttp
+  ];
+
+  checkInputs = [
+    asynctest
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  pytestFlagsArray = [
+    "tests/test.py"
+  ];
+
+  disabledTests = [
+    # Tests are not properly mocking network requests
+    "test_device_mac"
+    "test_peripheral_id"
+    "test_peripheral_measurements"
+    "test_samples"
+  ];
+
+  pythonImportsCheck = [
+    "pyversasense"
+  ];
+
+  meta = with lib; {
+    description = "Python library to communicate with the VersaSense API";
+    homepage = "https://github.com/imstevenxyz/pyversasense";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}