push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
replaceVars,
marisa-cpp,
cython,
setuptools,
pytestCheckHook,
hypothesis,
}:
buildPythonPackage rec {
pname = "marisa-trie";
version = "1.2.1";
pyproject = true;
src = fetchFromGitHub {
owner = "pytries";
repo = "marisa-trie";
tag = version;
hash = "sha256-aWfm13nrASAaD+bcMpv85emXnCFyVtZTdhl79yJuOss=";
};
patches = [
(replaceVars ./unvendor-marisa.patch {
marisa = lib.getDev marisa-cpp;
})
];
build-system = [
cython
setuptools
];
buildInputs = [
marisa-cpp
];
nativeCheckInputs = [
pytestCheckHook
hypothesis
];
preBuild = ''
./update_cpp.sh
'';
disabledTestPaths = [
# Don't test packaging
"tests/test_packaging.py"
];
pythonImportsCheck = [ "marisa_trie" ];
meta = with lib; {
description = "Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library";
longDescription = ''
There are official SWIG-based Python bindings included in C++ library distribution.
This package provides alternative Cython-based pip-installable Python bindings.
'';
homepage = "https://github.com/kmike/marisa-trie";
changelog = "https://github.com/pytries/marisa-trie/blob/${src.tag}/CHANGES.rst";
license = licenses.mit;
};
}

View File

@@ -0,0 +1,30 @@
diff --git a/setup.py b/setup.py
index c0c5c03..6373a2a 100755
--- a/setup.py
+++ b/setup.py
@@ -71,15 +71,6 @@ setup(
license=LICENSE,
url="https://github.com/pytries/marisa-trie",
classifiers=CLASSIFIERS,
- libraries=[
- (
- "libmarisa-trie",
- {
- "sources": MARISA_FILES,
- "include_dirs": [MARISA_SOURCE_DIR, MARISA_INCLUDE_DIR],
- },
- )
- ],
ext_modules=[
Extension(
"marisa_trie",
@@ -94,7 +85,8 @@ setup(
"src/std_iostream.cpp",
"src/trie.cpp",
],
- include_dirs=[MARISA_INCLUDE_DIR],
+ include_dirs=["@marisa@/include"],
+ libraries=["marisa"],
)
],
python_requires=">=3.8",