Skip to content

Commit f090882

Browse files
tobimlblasc
authored andcommitted
python3Packages.gensim: get src from repo, unpin cython_0
NixOS#353367
1 parent 6b90e6a commit f090882

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

pkgs/development/python-modules/gensim/default.nix

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
{
22
lib,
33
buildPythonPackage,
4-
cython_0,
4+
cython,
55
oldest-supported-numpy,
66
setuptools,
7-
fetchPypi,
7+
fetchFromGitHub,
88
mock,
99
numpy,
1010
scipy,
1111
smart-open,
1212
pyemd,
1313
pytestCheckHook,
14-
pythonOlder,
1514
}:
1615

1716
buildPythonPackage rec {
1817
pname = "gensim";
1918
version = "4.3.3";
2019
pyproject = true;
2120

22-
# C code generated with CPython3.12 does not work cython_0.
23-
disabled = !(pythonOlder "3.12");
24-
25-
src = fetchPypi {
26-
inherit pname version;
27-
hash = "sha256-hIUgdqaj2I19rFviReJMIcO4GbVl4UwbYfo+Xudtz1c=";
21+
# The pypi source package fails to build with Cython 3.0, so we get
22+
# the sources from the repo instead.
23+
src = fetchFromGitHub {
24+
owner = "piskvorky";
25+
repo = "gensim";
26+
rev = version;
27+
hash = "sha256-J2DNnu4SmJtAnBZ+D4xUFGDVCj9u2zXMLZlVFWbbSUg=";
2828
};
2929

30+
postPatch = ''
31+
substituteInPlace pyproject.toml \
32+
--replace-fail "Cython>=0.29.32,<3.0.0" "Cython"
33+
'';
34+
3035
build-system = [
31-
cython_0
36+
cython
3237
oldest-supported-numpy
3338
setuptools
3439
];

0 commit comments

Comments
 (0)