2023-10-09 19:29:22 +00:00
{ lib
, baycomp
, bottleneck
, buildPythonPackage
, chardet
, copyDesktopItems
2024-04-21 15:54:59 +00:00
, pythonRelaxDepsHook
2023-10-09 19:29:22 +00:00
, cython
2024-04-21 15:54:59 +00:00
, catboost
, xgboost
2023-10-09 19:29:22 +00:00
, fetchFromGitHub
, fetchurl
, httpx
, joblib
, keyring
, keyrings-alt
, makeDesktopItem
, matplotlib
, nix-update-script
, numpy
, oldest-supported-numpy
, openpyxl
, opentsne
, orange-canvas-core
, orange-widget-base
, pandas
, pyqtgraph
, pyqtwebengine
, python
, python-louvain
, pythonOlder
, pyyaml
, qt5
, qtconsole
, recommonmark
, requests
, scikit-learn
, scipy
, serverfiles
, setuptools
, sphinx
, wheel
, xlrd
, xlsxwriter
} :
let
self = buildPythonPackage rec {
pname = " o r a n g e 3 " ;
2023-11-16 04:20:00 +00:00
version = " 3 . 3 6 . 2 " ;
2024-04-21 15:54:59 +00:00
pyproject = true ;
2023-10-09 19:29:22 +00:00
disabled = pythonOlder " 3 . 7 " ;
src = fetchFromGitHub {
owner = " b i o l a b " ;
repo = " o r a n g e 3 " ;
rev = " r e f s / t a g s / ${ version } " ;
2023-11-16 04:20:00 +00:00
hash = " s h a 2 5 6 - v 9 l k 5 v G h B a R 2 P H Z + J q 0 h y 1 W a C s b e L e + v Z l T a H B k f a c U = " ;
2023-10-09 19:29:22 +00:00
} ;
postPatch = ''
substituteInPlace pyproject . toml \
2024-04-21 15:54:59 +00:00
- - replace-fail ' cython >= 3 . 0 ' ' cython'
# disable update checking
echo - e " d e f c h e c k _ f o r _ u p d a t e s ( ) : \n \t p a s s " > > Orange/canvas/__main__.py
2023-10-09 19:29:22 +00:00
'' ;
nativeBuildInputs = [
copyDesktopItems
2024-04-21 15:54:59 +00:00
pythonRelaxDepsHook
2023-10-09 19:29:22 +00:00
oldest-supported-numpy
2024-04-21 15:54:59 +00:00
cython
2023-10-09 19:29:22 +00:00
qt5 . wrapQtAppsHook
recommonmark
setuptools
sphinx
wheel
] ;
enableParallelBuilding = true ;
2024-04-21 15:54:59 +00:00
pythonRelaxDeps = [ " s c i k i t - l e a r n " ] ;
2023-10-09 19:29:22 +00:00
propagatedBuildInputs = [
numpy
scipy
chardet
2024-04-21 15:54:59 +00:00
catboost
xgboost
2023-10-09 19:29:22 +00:00
openpyxl
opentsne
qtconsole
2024-04-21 15:54:59 +00:00
setuptools
2023-10-09 19:29:22 +00:00
bottleneck
matplotlib
joblib
requests
keyring
scikit-learn
pandas
pyqtwebengine
serverfiles
orange-canvas-core
python-louvain
xlrd
xlsxwriter
httpx
pyqtgraph
orange-widget-base
keyrings-alt
pyyaml
baycomp
] ;
# 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 ;
2024-04-21 15:54:59 +00:00
# FIXME: pythonRelaxDeps is not relaxing the scikit-learn version constraint, had to disable this
dontCheckRuntimeDeps = true ;
2023-10-09 19:29:22 +00:00
pythonImportsCheck = [ " O r a n g e " " O r a n g e . d a t a . _ v a r i a b l e " ] ;
desktopItems = [
( makeDesktopItem {
name = " o r a n g e " ;
exec = " o r a n g e - c a n v a s " ;
desktopName = " O r a n g e D a t a M i n i n g " ;
genericName = " D a t a M i n i n g S u i t e " ;
comment = " E x p l o r e , a n a l y z e , a n d v i s u a l i z e y o u r d a t a " ;
icon = " o r a n g e - c a n v a s " ;
mimeTypes = [ " a p p l i c a t i o n / x - e x t e n s i o n - o w s " ] ;
categories = [ " S c i e n c e " " E d u c a t i o n " " A r t i f i c i a l I n t e l l i g e n c e " " D a t a V i s u a l i z a t i o n " " N u m e r i c a l A n a l y s i s " " Q t " ] ;
keywords = [ " M a c h i n e L e a r n i n g " " S c i e n t i f i c V i s u a l i z a t i o n " " S t a t i s t i c a l A n a l y s i s " ] ;
} )
] ;
postInstall = ''
wrapProgram $ out/bin/orange-canvas \
" ${ " $ " } { q t W r a p p e r A r g s [ @ ] } "
mkdir - p $ out/share/icons/hicolor / { 2 5 6 x256 , 4 8 x48 } /apps
cp distribute/icon-256.png $ out/share/icons/hicolor/256x256/apps/orange-canvas.png
cp distribute/icon-48.png $ out/share/icons/hicolor/48x48/apps/orange-canvas.png
'' ;
passthru = {
updateScript = nix-update-script { } ;
tests . unittests = self . overridePythonAttrs ( old : {
pname = " ${ old . pname } - t e s t s " ;
format = " o t h e r " ;
preCheck = ''
export HOME = $ ( mktemp - d )
export QT_PLUGIN_PATH = " ${ qt5 . qtbase . bin } / ${ qt5 . qtbase . qtPluginPrefix } "
export QT_QPA_PLATFORM_PLUGIN_PATH = " ${ qt5 . qtbase . bin } / l i b / q t - ${ qt5 . qtbase . version } / p l u g i n s " ;
export QT_QPA_PLATFORM = offscreen
rm Orange - rf
cp - r $ { self } / $ { python . sitePackages } /Orange .
chmod + w - R .
rm Orange/tests/test_url_reader.py # uses network
rm Orange/tests/test_ada_boost.py # broken: The 'base_estimator' parameter of AdaBoostRegressor must be an object implementing 'fit' and 'predict' or a str among {'deprecated'}. Got None instead.
'' ;
checkPhase = ''
runHook preCheck
$ { python . interpreter } - m unittest - b - v ./Orange /* */ test * . py
runHook postCheck
'' ;
postInstall = " " ;
doBuild = false ;
doInstall = false ;
nativeBuildInputs = [ self ] ++ old . nativeBuildInputs ;
} ) ;
} ;
meta = with lib ; {
description = " D a t a m i n i n g a n d v i s u a l i z a t i o n t o o l b o x f o r n o v i c e a n d e x p e r t a l i k e " ;
homepage = " h t t p s : / / o r a n g e d a t a m i n i n g . c o m / " ;
changelog = " h t t p s : / / g i t h u b . c o m / b i o l a b / o r a n g e 3 / b l o b / ${ version } / C H A N G E L O G . m d " ;
license = with licenses ; [ gpl3Plus ] ;
maintainers = with maintainers ; [ lucasew ] ;
mainProgram = " o r a n g e - c a n v a s " ;
} ;
} ;
in
self