mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-12-04 20:00:10 +00:00
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
pythonOlder,
|
|
fetchPypi,
|
|
rustPlatform,
|
|
pytestCheckHook,
|
|
pyahocorasick,
|
|
hypothesis,
|
|
typing-extensions,
|
|
pytest-benchmark,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "ahocorasick-rs";
|
|
version = "1.0.4";
|
|
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
inherit version;
|
|
pname = "ahocorasick_rs";
|
|
hash = "sha256-g14kMC4UCvVKAHP5qzEx0tHYMMH/1wmzO44VEPSSsdA=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit pname version src;
|
|
hash = "sha256-xh1a1KBXmK5+3PKx1Ez093wa4+TdBnpqes+1mqBqol4=";
|
|
};
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
maturinBuildHook
|
|
cargoSetupHook
|
|
];
|
|
|
|
dependencies = lib.optionals (pythonOlder "3.12") [ typing-extensions ];
|
|
|
|
nativeCheckInputs = [
|
|
pytest-benchmark
|
|
pytestCheckHook
|
|
pyahocorasick
|
|
hypothesis
|
|
];
|
|
|
|
pytestFlags = [ "--benchmark-disable" ];
|
|
|
|
pythonImportsCheck = [ "ahocorasick_rs" ];
|
|
|
|
meta = {
|
|
description = "Fast Aho-Corasick algorithm for Python";
|
|
homepage = "https://github.com/G-Research/ahocorasick_rs/";
|
|
changelog = "https://github.com/G-Research/ahocorasick_rs/blob/${version}/CHANGELOG.md";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ erictapen ];
|
|
};
|
|
|
|
}
|