diff --git a/pkgs/development/python-modules/ahocorapy/default.nix b/pkgs/development/python-modules/ahocorapy/default.nix new file mode 100644 index 000000000000..cd4f90e8ae5c --- /dev/null +++ b/pkgs/development/python-modules/ahocorapy/default.nix @@ -0,0 +1,45 @@ +{ + buildPythonPackage, + fetchFromGitHub, + future, + lib, + pytestCheckHook, + setuptools, +}: + +buildPythonPackage rec { + pname = "ahocorapy"; + version = "1.6.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "abusix"; + repo = "ahocorapy"; + tag = version; + hash = "sha256-ynVkDnrZ12dpNPoKfUdw0/X06aORFkmXFMVH9u0Payo="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + future + ]; + + pythonImportsCheck = [ "ahocorapy" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ + "tests/ahocorapy_test.py" + ]; + + meta = { + changelog = "https://github.com/abusix/ahocorapy/blob/${src.tag}/CHANGELOG"; + description = "Pure python Aho-Corasick library"; + homepage = "https://github.com/abusix/ahocorapy"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/beacontools/default.nix b/pkgs/development/python-modules/beacontools/default.nix new file mode 100644 index 000000000000..8e6315db900f --- /dev/null +++ b/pkgs/development/python-modules/beacontools/default.nix @@ -0,0 +1,53 @@ +{ + ahocorapy, + buildPythonPackage, + construct, + fetchFromGitHub, + lib, + pybluez, + pytestCheckHook, + setuptools, + stdenv, +}: + +buildPythonPackage rec { + pname = "beacontools"; + version = "2.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "citruz"; + repo = "beacontools"; + tag = "v${version}"; + hash = "sha256-3a/HDssOqIfReSijRvmiXwuZjvWLJfDaDyUdA2vv/jA="; + }; + + build-system = [ setuptools ]; + + pythonRelaxDeps = [ + "ahocorapy" + ]; + + dependencies = [ + ahocorapy + construct + ]; + + optional-dependencies = { + scan = lib.optionals stdenv.hostPlatform.isLinux [ pybluez ]; + }; + + pythonImportsCheck = [ "beacontools" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + changelog = "https://github.com/citruz/beacontools/releases/tag/${src.tag}"; + description = "Python library for working with various types of Bluetooth LE Beacons"; + homepage = "https://github.com/citruz/beacontools"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index b4d5afe27378..52b900981d16 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -1323,8 +1323,12 @@ aioecowitt ]; "eddystone_temperature" = - ps: with ps; [ - ]; # missing inputs: beacontools + ps: + with ps; + [ + beacontools + ] + ++ beacontools.optional-dependencies.scan; "edimax" = ps: with ps; [ pyedimax diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0e004b4121dc..e52fa9f62213 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -131,6 +131,8 @@ self: super: with self; { aggdraw = callPackage ../development/python-modules/aggdraw { }; + ahocorapy = callPackage ../development/python-modules/ahocorapy { }; + ahocorasick-rs = callPackage ../development/python-modules/ahocorasick-rs { }; aigpy = callPackage ../development/python-modules/aigpy { }; @@ -1565,6 +1567,8 @@ self: super: with self; { bdffont = callPackage ../development/python-modules/bdffont { }; + beacontools = callPackage ../development/python-modules/beacontools { }; + beaker = callPackage ../development/python-modules/beaker { }; before-after = callPackage ../development/python-modules/before-after { };