From 5e00e168e2dc34c44b40ebe31e8c62a4d6510f8a Mon Sep 17 00:00:00 2001 From: lucasew Date: Wed, 28 Feb 2024 22:32:50 -0300 Subject: [PATCH] python3Packages.orange3: fix ModuleNotFoundError pkg_resources Signed-off-by: lucasew --- .../python-modules/orange3/default.nix | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/orange3/default.nix b/pkgs/development/python-modules/orange3/default.nix index fe7f77554182..1c4531254ae8 100644 --- a/pkgs/development/python-modules/orange3/default.nix +++ b/pkgs/development/python-modules/orange3/default.nix @@ -4,7 +4,10 @@ , buildPythonPackage , chardet , copyDesktopItems +, pythonRelaxDepsHook , cython +, catboost +, xgboost , fetchFromGitHub , fetchurl , httpx @@ -45,7 +48,7 @@ let self = buildPythonPackage rec { pname = "orange3"; version = "3.36.2"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -58,15 +61,17 @@ let postPatch = '' substituteInPlace pyproject.toml \ - --replace "setuptools>=41.0.0,<50.0" "setuptools" - sed -i 's;\(scikit-learn\)[^$]*;\1;g' requirements-core.txt - sed -i 's;pyqtgraph[^$]*;;g' requirements-gui.txt # TODO: remove after bump with a version greater than 0.13.1 + --replace-fail 'cython>=3.0' 'cython' + + # disable update checking + echo -e "def check_for_updates():\n\tpass" >> Orange/canvas/__main__.py ''; nativeBuildInputs = [ copyDesktopItems - cython + pythonRelaxDepsHook oldest-supported-numpy + cython qt5.wrapQtAppsHook recommonmark setuptools @@ -76,13 +81,18 @@ let enableParallelBuilding = true; + pythonRelaxDeps = [ "scikit-learn" ]; + propagatedBuildInputs = [ numpy scipy chardet + catboost + xgboost openpyxl opentsne qtconsole + setuptools bottleneck matplotlib joblib @@ -107,6 +117,9 @@ let # FIXME: ImportError: cannot import name '_variable' from partially initialized module 'Orange.data' (most likely due to a circular import) (/build/source/Orange/data/__init__.py) doCheck = false; + # FIXME: pythonRelaxDeps is not relaxing the scikit-learn version constraint, had to disable this + dontCheckRuntimeDeps = true; + pythonImportsCheck = [ "Orange" "Orange.data._variable" ]; desktopItems = [