diff mbox series

[bug#47976,10/10] gnu: Add orange.

Message ID 20210423172816.73579-10-monego@posteo.net
State Accepted
Headers show
Series Add Orange | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Vinicius Monego April 23, 2021, 5:28 p.m. UTC
* gnu/packages/orange.scm (orange): New variable.
---
 gnu/packages/orange.scm | 88 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

Comments

Leo Famulari April 23, 2021, 7:25 p.m. UTC | #1
On Fri, Apr 23, 2021 at 05:28:16PM +0000, Vinicius Monego wrote:
> * gnu/packages/orange.scm (orange): New variable.
> +         (add-after 'unpack 'preparations
> +           (lambda _
> +             ;; Delete test that opens an outgoing connection.
> +             (delete-file "Orange/tests/test_url_reader.py")

Okay.

> +             ;; This is a binary file and it breaks runpath validation.
> +             (delete-file "Orange/tests/datasets/binary-blob.tab")
> +             ;; Skip the test which uses that binary file.
> +             (substitute* "Orange/tests/test_txt_reader.py"
> +               (("test_read_nonutf8_encoding") "_test_read_nonutf8_encoding"))

If 'binary-blob.tab' is software, we should remove it in an origin
snippet. If it's just data, then it's fine to do it like this.

> +             ;; Relax some dependency versions.
> +             (substitute* "requirements-gui.txt" (("PyQtWebEngine>=5.12") ""))

Isn't this unecessary? We have PyQtWebEngine 5.15.2.

> +             (substitute* "requirements-core.txt"
> +               (("httpx>=0.14.0,<0.17") "httpx"))

And for this, we have 0.16.1.
Vinicius Monego April 23, 2021, 9:04 p.m. UTC | #2
Leo Famulari writes:

>> +             ;; This is a binary file and it breaks runpath validation.
>> +             (delete-file "Orange/tests/datasets/binary-blob.tab")
>> +             ;; Skip the test which uses that binary file.
>> +             (substitute* "Orange/tests/test_txt_reader.py"
>> +               (("test_read_nonutf8_encoding") "_test_read_nonutf8_encoding"))
>
> If 'binary-blob.tab' is software, we should remove it in an origin
> snippet. If it's just data, then it's fine to do it like this.
>

It is just data.

>> +             ;; Relax some dependency versions.
>> +             (substitute* "requirements-gui.txt" (("PyQtWebEngine>=5.12") ""))
>
> Isn't this unecessary? We have PyQtWebEngine 5.15.2.
>

There's something with pyqtwebengine not being found. The check phase
will fail to find it if I don't remove it from requirements. The same
happened in the Spyder package, but in that case the executable would
complain. I'm not sure why this happens.

>> +             (substitute* "requirements-core.txt"
>> +               (("httpx>=0.14.0,<0.17") "httpx"))
>
> And for this, we have 0.16.1.

Ok, 0.17 has been out for a while now and I have an update for it, but
did not submit yet. I will leave this substitution for later then.
Leo Famulari April 23, 2021, 9:15 p.m. UTC | #3
On Fri, Apr 23, 2021 at 09:04:22PM +0000, Vinicius Monego wrote:
> Ok, 0.17 has been out for a while now and I have an update for it, but
> did not submit yet. I will leave this substitution for later then.

We don't usually relax version restrictions to use non-approved
versions. The program will have to be changed upstream to work with
httpx 0.17. So, this substitution should be removed from the patch.
diff mbox series

Patch

diff --git a/gnu/packages/orange.scm b/gnu/packages/orange.scm
index 5713516e58..f70bd83c47 100644
--- a/gnu/packages/orange.scm
+++ b/gnu/packages/orange.scm
@@ -22,6 +22,11 @@ 
   #:use-module (guix download)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages graph)
+  #:use-module (gnu packages machine-learning)
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt))
@@ -101,6 +106,89 @@  data-mining application.")
 GUI based workflow.  It is primarily used in the Orange framework.")
     (license license:gpl3+)))
 
+(define-public orange
+  (package
+    (name "orange")
+    (version "3.28.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "Orange3" version))
+       (sha256
+        (base32 "1ac4xjjkx06z10hl7k0zh1z3qhkl5vng15l9jkpkmck9spinbzil"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda _
+             ;; Delete test that opens an outgoing connection.
+             (delete-file "Orange/tests/test_url_reader.py")
+             ;; This is a binary file and it breaks runpath validation.
+             (delete-file "Orange/tests/datasets/binary-blob.tab")
+             ;; Skip the test which uses that binary file.
+             (substitute* "Orange/tests/test_txt_reader.py"
+               (("test_read_nonutf8_encoding") "_test_read_nonutf8_encoding"))
+             ;; Relax some dependency versions.
+             (substitute* "requirements-gui.txt" (("PyQtWebEngine>=5.12") ""))
+             (substitute* "requirements-core.txt"
+               (("httpx>=0.14.0,<0.17") "httpx"))
+             #t))
+         (add-before 'check 'set-HOME
+           ;; Tests need a writable home.
+           (lambda _ (setenv "HOME" "/tmp") #t))
+         (add-after 'install 'wrap-executable
+           ;; Ensure that icons are found at runtime.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (wrap-program (string-append out "/bin/orange-canvas")
+                 `("QT_PLUGIN_PATH" prefix
+                   ,(list (string-append (assoc-ref inputs "qtsvg")
+                                         "/lib/qt5/plugins/")))))
+             #t)))))
+    (native-inputs
+     `(("python-cython" ,python-cython)))
+    (inputs
+     `(("python-anyqt" ,python-anyqt)
+       ("python-baycomp" ,python-baycomp)
+       ("python-bottleneck" ,python-bottleneck)
+       ("python-chardet" ,python-chardet)
+       ("python-httpx" ,python-httpx)
+       ("python-joblib" ,python-joblib)
+       ("python-keyring" ,python-keyring)
+       ("python-keyrings.alt" ,python-keyrings.alt)
+       ("python-louvain" ,python-python-louvain)
+       ("python-matplotlib" ,python-matplotlib)
+       ("python-networkx" ,python-networkx)
+       ("python-numpy" ,python-numpy)
+       ("python-openpyxl" ,python-openpyxl)
+       ("python-opentsne" ,python-opentsne)
+       ("python-orange-canvas-core"
+        ,python-orange-canvas-core)
+       ("python-orange-widget-base"
+        ,python-orange-widget-base)
+       ("python-pandas" ,python-pandas)
+       ("python-pyqt" ,python-pyqt)
+       ("python-pyqtgraph" ,python-pyqtgraph)
+       ("python-pyqtwebengine" ,python-pyqtwebengine)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-requests" ,python-requests)
+       ("python-scikit-learn" ,python-scikit-learn)
+       ("python-scipy" ,python-scipy)
+       ("python-serverfiles" ,python-serverfiles)
+       ("python-xlrd" ,python-xlrd)
+       ("python-xlsxwriter" ,python-xlsxwriter)
+       ("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)
+       ("xdg-utils" ,xdg-utils)))
+    (home-page "https://orangedatamining.com/")
+    (synopsis "Component-based data mining framework")
+    (description
+     "Orange is a graphical toolkit for machine learning, data analysis and
+visualization based on the Qt framework.  It is easy to use and enables rapid
+experimenting with its tools.")
+    (license license:gpl3+)))
+
 (define-public python-serverfiles
   (package
     (name "python-serverfiles")