2023-10-09 19:29:22 +00:00
{ lib
, baycomp
, bottleneck
, buildPythonPackage
, chardet
, copyDesktopItems
, cython
, 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-01-02 11:29:13 +00:00
format = " s e t u p t o o l s " ;
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 \
- - replace " s e t u p t o o l s > = 4 1 . 0 . 0 , < 5 0 . 0 " " s e t u p t o o l s "
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
'' ;
nativeBuildInputs = [
copyDesktopItems
cython
oldest-supported-numpy
qt5 . wrapQtAppsHook
recommonmark
setuptools
sphinx
wheel
] ;
enableParallelBuilding = true ;
propagatedBuildInputs = [
numpy
scipy
chardet
openpyxl
opentsne
qtconsole
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 ;
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