diff --git a/pkgs/development/python-modules/crownstone-cloud/default.nix b/pkgs/development/python-modules/crownstone-cloud/default.nix new file mode 100644 index 000000000000..94e6219264c0 --- /dev/null +++ b/pkgs/development/python-modules/crownstone-cloud/default.nix @@ -0,0 +1,50 @@ +{ lib +, aiohttp +, asynctest +, buildPythonPackage +, fetchFromGitHub +, certifi +, pythonOlder +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "crownstone-cloud"; + version = "1.4.5"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "crownstone"; + repo = "crownstone-lib-python-cloud"; + rev = "v${version}"; + sha256 = "1a8bkqkrc7iyggr5rr20qdqg67sycdx2d94dd1ylkmr7627r34ys"; + }; + + propagatedBuildInputs = [ + aiohttp + asynctest + certifi + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "codecov>=2.1.10" "" + ''; + + pythonImportsCheck = [ + "crownstone_cloud" + ]; + + meta = with lib; { + description = "Python module for communicating with Crownstone Cloud and devices"; + homepage = "https://github.com/crownstone/crownstone-lib-python-cloud"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/crownstone-core/default.nix b/pkgs/development/python-modules/crownstone-core/default.nix new file mode 100644 index 000000000000..35289cf1956c --- /dev/null +++ b/pkgs/development/python-modules/crownstone-core/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pyaes +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "crownstone-core"; + version = "3.0.1"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "crownstone"; + repo = "crownstone-lib-python-core"; + rev = version; + sha256 = "138lignv7c8kkqbqfkdcfpg39gm9x44h7r2j403m4ib7gq420hsn"; + }; + + propagatedBuildInputs = [ + pyaes + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "crownstone_core" + ]; + + meta = with lib; { + description = "Python module with shared classes, util functions and definition of Crownstone"; + homepage = "https://github.com/crownstone/crownstone-lib-python-core"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/crownstone-sse/default.nix b/pkgs/development/python-modules/crownstone-sse/default.nix new file mode 100644 index 000000000000..ef2e2cbc240c --- /dev/null +++ b/pkgs/development/python-modules/crownstone-sse/default.nix @@ -0,0 +1,44 @@ +{ lib +, aiohttp +, asynctest +, buildPythonPackage +, certifi +, fetchFromGitHub +, pythonOlder +, coverage +}: + +buildPythonPackage rec { + pname = "crownstone-sse"; + version = "2.0.2"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "crownstone"; + repo = "crownstone-lib-python-sse"; + rev = version; + sha256 = "0rrr92j8pi5annrfa22k1hggsyyacl9asi9i8yrj4jqdjvwjn2gc"; + }; + + propagatedBuildInputs = [ + aiohttp + asynctest + certifi + ]; + + # Tests are only providing coverage + doCheck = false; + + pythonImportsCheck = [ + "crownstone_sse" + ]; + + meta = with lib; { + description = "Python module for listening to Crownstone SSE events"; + homepage = "https://github.com/crownstone/crownstone-lib-python-sse"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/crownstone-uart/default.nix b/pkgs/development/python-modules/crownstone-uart/default.nix new file mode 100644 index 000000000000..fd1c2094335c --- /dev/null +++ b/pkgs/development/python-modules/crownstone-uart/default.nix @@ -0,0 +1,41 @@ +{ lib +, crownstone-core +, buildPythonPackage +, pyserial +, fetchFromGitHub +, pythonOlder +}: + +buildPythonPackage rec { + pname = "crownstone-uart"; + version = "2.1.0"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "crownstone"; + repo = "crownstone-lib-python-uart"; + rev = version; + sha256 = "0sdz131vmrfp6hrm9iwqw8mj9qazsxg7b85yadib1122w9f3b1zc"; + }; + + propagatedBuildInputs = [ + crownstone-core + pyserial + ]; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ + "crownstone_uart" + ]; + + meta = with lib; { + description = "Python module for communicating with Crownstone USB dongles"; + homepage = "https://github.com/crownstone/crownstone-lib-python-uart"; + 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 e6d6a08447a5..9fe2c10dc4b8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1751,6 +1751,14 @@ in { croniter = callPackage ../development/python-modules/croniter { }; + crownstone-cloud = callPackage ../development/python-modules/crownstone-cloud { }; + + crownstone-core = callPackage ../development/python-modules/crownstone-core { }; + + crownstone-sse = callPackage ../development/python-modules/crownstone-sse { }; + + crownstone-uart = callPackage ../development/python-modules/crownstone-uart { }; + cryptacular = callPackage ../development/python-modules/cryptacular { }; cryptography = callPackage ../development/python-modules/cryptography {