Skip to content

Commit

Permalink
python3Packages.gensim: get src from repo, unpin cython_0
Browse files Browse the repository at this point in the history
  • Loading branch information
tobim authored and lblasc committed Nov 6, 2024
1 parent 6b90e6a commit f090882
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions pkgs/development/python-modules/gensim/default.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
{
lib,
buildPythonPackage,
cython_0,
cython,
oldest-supported-numpy,
setuptools,
fetchPypi,
fetchFromGitHub,
mock,
numpy,
scipy,
smart-open,
pyemd,
pytestCheckHook,
pythonOlder,
}:

buildPythonPackage rec {
pname = "gensim";
version = "4.3.3";
pyproject = true;

# C code generated with CPython3.12 does not work cython_0.
disabled = !(pythonOlder "3.12");

src = fetchPypi {
inherit pname version;
hash = "sha256-hIUgdqaj2I19rFviReJMIcO4GbVl4UwbYfo+Xudtz1c=";
# The pypi source package fails to build with Cython 3.0, so we get
# the sources from the repo instead.
src = fetchFromGitHub {
owner = "piskvorky";
repo = "gensim";
rev = version;
hash = "sha256-J2DNnu4SmJtAnBZ+D4xUFGDVCj9u2zXMLZlVFWbbSUg=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "Cython>=0.29.32,<3.0.0" "Cython"
'';

build-system = [
cython_0
cython
oldest-supported-numpy
setuptools
];
Expand Down

0 comments on commit f090882

Please sign in to comment.