-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
pythonPackages.levenshtein: fix 0.18.1 build #168547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
78f6457
72b19db
3d59ca3
a5bc2ea
7ad5fe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { lib | ||
| , stdenv | ||
| , fetchFromGitHub | ||
| , cmake | ||
| }: | ||
|
|
||
| stdenv.mkDerivation rec { | ||
| pname = "rapidfuzz-cpp"; | ||
| version = "1.0.0"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "maxbachmann"; | ||
| repo = pname; | ||
| rev = "v${version}"; | ||
| sha256 = "1g30ckm78ixsd06s067saaqbw97mkxyhfn75dr0ql7i3j9ghz7mw"; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ cmake ]; | ||
|
|
||
| cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]; | ||
|
|
||
| meta = with lib; { | ||
| description = "Rapid fuzzy string matching in C++ using the Levenshtein Distance"; | ||
| homepage = "https://github.com/maxbachmann/rapidfuzz-cpp"; | ||
| license = licenses.mit; | ||
| maintainers = with maintainers; [ fab ]; | ||
| platforms = platforms.all; | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,29 +2,52 @@ | |||||||
| , buildPythonPackage | ||||||||
| , fetchFromGitHub | ||||||||
| , pythonOlder | ||||||||
| , pytestCheckHook | ||||||||
| , python | ||||||||
| , cmake | ||||||||
| , ninja | ||||||||
| , cython | ||||||||
| , scikit-build | ||||||||
| , setuptools | ||||||||
| , rapidfuzz-cpp | ||||||||
| , rapidfuzz | ||||||||
| , pytestCheckHook | ||||||||
| }: | ||||||||
|
|
||||||||
| buildPythonPackage rec { | ||||||||
| pname = "levenshtein"; | ||||||||
| version = "0.18.1"; | ||||||||
| format = "setuptools"; | ||||||||
| format = "pyproject"; | ||||||||
|
|
||||||||
| disabled = pythonOlder "3.6"; | ||||||||
|
|
||||||||
| src = fetchFromGitHub { | ||||||||
| owner = "maxbachmann"; | ||||||||
| repo = "Levenshtein"; | ||||||||
| repo = pname; | ||||||||
| rev = "v${version}"; | ||||||||
| sha256 = "sha256-3p9LM4tv45bqeTsuyngivqfd5uml7uqGB2ICKqPa0qY="; | ||||||||
| fetchSubmodules = true; | ||||||||
| sha256 = "sha256-WREYdD5MFOpCzH4BSceRpzQZdpi3Xxxn0DpMvDsNlGo="; | ||||||||
| }; | ||||||||
|
|
||||||||
| postPatch = '' | ||||||||
| substituteInPlace setup.cfg \ | ||||||||
| --replace "rapidfuzz >= 1.8.2, < 1.9" "rapidfuzz" | ||||||||
| substituteInPlace setup.py \ | ||||||||
| --replace ", < 3.0.0" "" | ||||||||
|
|
||||||||
| substituteInPlace pyproject.toml \ | ||||||||
| --replace "Cython==3.0.0a10" "Cython>=0.29.0" | ||||||||
| ''; | ||||||||
|
|
||||||||
| nativeBuildInputs = [ | ||||||||
| cmake | ||||||||
| ninja | ||||||||
| cython | ||||||||
| scikit-build | ||||||||
| setuptools | ||||||||
| ]; | ||||||||
|
|
||||||||
| buildInputs = [ | ||||||||
| rapidfuzz-cpp | ||||||||
| ]; | ||||||||
|
|
||||||||
| propagatedBuildInputs = [ | ||||||||
| rapidfuzz | ||||||||
| ]; | ||||||||
|
|
@@ -33,6 +56,12 @@ buildPythonPackage rec { | |||||||
| pytestCheckHook | ||||||||
| ]; | ||||||||
|
|
||||||||
| dontUseCmakeConfigure = true; | ||||||||
|
|
||||||||
| cmakeFlags = [ | ||||||||
| "-DCMAKE_MODULE_PATH=${python.pkgs.scikit-build}/${python.sitePackages}/skbuild/resources/cmake" | ||||||||
| ]; | ||||||||
|
Comment on lines
+61
to
+63
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| pythonImportsCheck = [ | ||||||||
| "Levenshtein" | ||||||||
| ]; | ||||||||
|
|
@@ -42,5 +71,6 @@ buildPythonPackage rec { | |||||||
| homepage = "https://github.com/maxbachmann/Levenshtein"; | ||||||||
| license = licenses.gpl2Plus; | ||||||||
| maintainers = with maintainers; [ fab ]; | ||||||||
| platforms = platforms.all; | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
that's automatic for Python packages |
||||||||
| }; | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { lib | ||
| , buildPythonPackage | ||
| , fetchFromGitHub | ||
| }: | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "rapidfuzz-capi"; | ||
| version = "1.0.2"; | ||
| format = "pyproject"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "maxbachmann"; | ||
| repo = "rapidfuzz_capi"; | ||
| rev = "v.${version}"; | ||
| sha256 = "127mwjbyp2nfj846bxb3aajmhsgzfx4wfvizpnwb30yv2fcrpy7l"; | ||
| }; | ||
|
|
||
| pythonImportsCheck = [ "rapidfuzz_capi" ]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also needs |
||
|
|
||
| meta = with lib; { | ||
| description = "C-API of RapidFuzz, which can be used to extend RapidFuzz from separate packages"; | ||
| homepage = "https://github.com/maxbachmann/rapidfuzz_capi"; | ||
| license = licenses.mit; | ||
| maintainers = with maintainers; [ dotlambda ]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dotlambda ? 28b65c3#diff-7051ba4a27a1aa6bb264875507a22237c6aaf3566a13335c6c96f76593be5314 i'm probably going to remove this file and wait for your pr to get merged
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I meant to put this on the respective line in rapidfuzz-cpp |
||
| }; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be patched out or just left out if you use
format = "setuptools"