Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 baycomp, 5 bottleneck, 6 buildPythonPackage, 7 chardet, 8 copyDesktopItems, 9 cython, 10 catboost, 11 xgboost, 12 fetchFromGitHub, 13 fetchurl, 14 httpx, 15 joblib, 16 keyring, 17 keyrings-alt, 18 makeDesktopItem, 19 matplotlib, 20 nix-update-script, 21 numpy, 22 oldest-supported-numpy, 23 openpyxl, 24 opentsne, 25 orange-canvas-core, 26 orange-widget-base, 27 pandas, 28 pytestCheckHook, 29 pytest-qt, 30 pyqtgraph, 31 pyqt5, 32 pyqtwebengine, 33 python, 34 python-louvain, 35 pythonOlder, 36 pyyaml, 37 pip, 38 qt5, 39 qtconsole, 40 recommonmark, 41 requests, 42 scikit-learn, 43 scipy, 44 serverfiles, 45 setuptools, 46 sphinx, 47 wheel, 48 xlrd, 49 xlsxwriter, 50}: 51 52let 53 self = buildPythonPackage rec { 54 pname = "orange3"; 55 version = "3.37.0"; 56 pyproject = true; 57 58 disabled = pythonOlder "3.7"; 59 60 src = fetchFromGitHub { 61 owner = "biolab"; 62 repo = "orange3"; 63 rev = "refs/tags/${version}"; 64 hash = "sha256-3PybiHXH6oIYJb78/a7LnQA6cYUicDx4Mf65QhIhT4w="; 65 }; 66 67 postPatch = '' 68 substituteInPlace pyproject.toml \ 69 --replace-fail 'cython>=3.0' 'cython' 70 71 # disable update checking 72 echo -e "def check_for_updates():\n\tpass" >> Orange/canvas/__main__.py 73 ''; 74 75 nativeBuildInputs = [ 76 copyDesktopItems 77 oldest-supported-numpy 78 cython 79 qt5.wrapQtAppsHook 80 recommonmark 81 setuptools 82 sphinx 83 wheel 84 ]; 85 86 enableParallelBuilding = true; 87 88 pythonRelaxDeps = [ "scikit-learn" ]; 89 90 propagatedBuildInputs = [ 91 numpy 92 scipy 93 chardet 94 catboost 95 xgboost 96 openpyxl 97 opentsne 98 qtconsole 99 setuptools 100 bottleneck 101 matplotlib 102 joblib 103 requests 104 keyring 105 scikit-learn 106 pandas 107 pyqtwebengine 108 serverfiles 109 orange-canvas-core 110 python-louvain 111 xlrd 112 xlsxwriter 113 httpx 114 pyqtgraph 115 pyqt5 116 orange-widget-base 117 keyrings-alt 118 pyyaml 119 baycomp 120 pip 121 ]; 122 123 # 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) 124 doCheck = false; 125 126 # FIXME: pythonRelaxDeps is not relaxing the scikit-learn version constraint, had to disable this 127 dontCheckRuntimeDeps = true; 128 129 pythonImportsCheck = [ 130 "Orange" 131 "Orange.data._variable" 132 ]; 133 134 desktopItems = [ 135 (makeDesktopItem { 136 name = "orange"; 137 exec = "orange-canvas"; 138 desktopName = "Orange Data Mining"; 139 genericName = "Data Mining Suite"; 140 comment = "Explore, analyze, and visualize your data"; 141 icon = "orange-canvas"; 142 mimeTypes = [ "application/x-extension-ows" ]; 143 categories = [ 144 "Science" 145 "Education" 146 "ArtificialIntelligence" 147 "DataVisualization" 148 "NumericalAnalysis" 149 "Qt" 150 ]; 151 keywords = [ 152 "Machine Learning" 153 "Scientific Visualization" 154 "Statistical Analysis" 155 ]; 156 }) 157 ]; 158 159 postInstall = '' 160 wrapProgram $out/bin/orange-canvas \ 161 "${"$"}{qtWrapperArgs[@]}" 162 mkdir -p $out/share/icons/hicolor/{256x256,48x48}/apps 163 cp distribute/icon-256.png $out/share/icons/hicolor/256x256/apps/orange-canvas.png 164 cp distribute/icon-48.png $out/share/icons/hicolor/48x48/apps/orange-canvas.png 165 ''; 166 167 passthru = { 168 updateScript = nix-update-script { }; 169 tests.unittests = stdenv.mkDerivation { 170 name = "${self.name}-tests"; 171 inherit (self) src; 172 173 preCheck = '' 174 export HOME=$(mktemp -d) 175 export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}" 176 export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins"; 177 export QT_QPA_PLATFORM=offscreen 178 179 rm Orange -rf 180 cp -r ${self}/${python.sitePackages}/Orange . 181 chmod +w -R . 182 183 substituteInPlace Orange/classification/tests/test_xgb_cls.py \ 184 --replace test_learners mk_test_learners 185 186 substituteInPlace Orange/modelling/tests/test_xgb.py \ 187 --replace test_learners mk_test_learners 188 189 substituteInPlace Orange/**/tests/*.py \ 190 --replace test_filename filename_test 191 192 # TODO: debug why orange is crashing on GC, may be a upstream issue 193 chmod +x Orange/__init__.py 194 echo "import gc; gc.disable()" | tee -a Orange/__init__.py 195 196 ''; 197 198 nativeBuildInputs = [ 199 pytestCheckHook 200 pytest-qt 201 ]; 202 203 postCheck = '' 204 touch $out 205 ''; 206 207 doBuild = false; 208 doInstall = false; 209 210 buildInputs = [ self ]; 211 }; 212 }; 213 214 meta = with lib; { 215 description = "Data mining and visualization toolbox for novice and expert alike"; 216 homepage = "https://orangedatamining.com/"; 217 changelog = "https://github.com/biolab/orange3/blob/${version}/CHANGELOG.md"; 218 license = with licenses; [ gpl3Plus ]; 219 maintainers = with maintainers; [ lucasew ]; 220 mainProgram = "orange-canvas"; 221 }; 222 }; 223in 224self