diff --git a/pkgs/development/python-modules/ahocorasick-rs/default.nix b/pkgs/development/python-modules/ahocorasick-rs/default.nix new file mode 100644 index 000000000000..3ad7ebbc44bd --- /dev/null +++ b/pkgs/development/python-modules/ahocorasick-rs/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + rustPlatform, + typing-extensions, + pytestCheckHook, + pyahocorasick, + hypothesis, + pytest-benchmark, +}: + +buildPythonPackage rec { + pname = "ahocorasick-rs"; + version = "0.22.0"; + + pyproject = true; + + src = fetchPypi { + inherit version; + pname = "ahocorasick_rs"; + sha256 = "sha256-lzRwODlJlymMSih3CqNIeR+HrUbgVhroM1JuHFfW848="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-CIt/ChNcoqKln6PgeTGp9pfmIWlJj+c5SCPtBhsnT6U="; + }; + + nativeBuildInputs = with rustPlatform; [ + maturinBuildHook + cargoSetupHook + typing-extensions + ]; + + nativeCheckInputs = [ + pytest-benchmark + pytestCheckHook + pyahocorasick + hypothesis + ]; + + pythonImportsCheck = [ "ahocorasick_rs" ]; + + meta = with lib; { + description = "Fast Aho-Corasick algorithm for Python"; + homepage = "https://github.com/G-Research/ahocorasick_rs/"; + license = licenses.asl20; + maintainers = with maintainers; [ erictapen ]; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bd611f2cca19..b4abd54e9e7d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -127,6 +127,8 @@ self: super: with self; { aggdraw = callPackage ../development/python-modules/aggdraw { }; + ahocorasick-rs = callPackage ../development/python-modules/ahocorasick-rs { }; + aigpy = callPackage ../development/python-modules/aigpy { }; aio-geojson-client = callPackage ../development/python-modules/aio-geojson-client { };