orange.scm 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages orange)
  19. #:use-module ((guix licenses) #:prefix license:)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix build-system python)
  23. #:use-module (gnu packages)
  24. #:use-module (gnu packages freedesktop)
  25. #:use-module (gnu packages graph)
  26. #:use-module (gnu packages machine-learning)
  27. #:use-module (gnu packages python-crypto)
  28. #:use-module (gnu packages python-science)
  29. #:use-module (gnu packages python-web)
  30. #:use-module (gnu packages python-xyz)
  31. #:use-module (gnu packages qt))
  32. (define-public python-orange-canvas-core
  33. (package
  34. (name "python-orange-canvas-core")
  35. (version "0.1.19")
  36. (source
  37. (origin
  38. (method url-fetch)
  39. (uri (pypi-uri "orange-canvas-core" version))
  40. (sha256
  41. (base32 "03wav2msfm32y8zwq69v1v6qyh1ld76xla2z60avf49yhbwjgwal"))))
  42. (build-system python-build-system)
  43. (arguments
  44. `(#:phases
  45. (modify-phases %standard-phases
  46. (add-before 'check 'check-setup
  47. (lambda _
  48. ;; This test fails with: RuntimeError: Event loop is closed.
  49. (substitute* "orangecanvas/application/tests/test_mainwindow.py"
  50. (("test_help_requests") "_test_help_requests"))
  51. (setenv "HOME" "/tmp")
  52. (setenv "QT_QPA_PLATFORM" "offscreen")
  53. #t)))))
  54. (propagated-inputs
  55. `(("python-anyqt" ,python-anyqt)
  56. ("python-cachecontrol" ,python-cachecontrol)
  57. ("python-commonmark" ,python-commonmark)
  58. ("python-dictdiffer" ,python-dictdiffer)
  59. ("python-docutils" ,python-docutils)
  60. ("python-pyqt" ,python-pyqt)
  61. ("python-qasync" ,python-qasync)
  62. ("python-requests" ,python-requests)))
  63. (home-page "https://github.com/biolab/orange-canvas-core")
  64. (synopsis "Core component of Orange Canvas")
  65. (description
  66. "Orange Canvas Core is a framework for building graphical user interfaces
  67. for editing workflows. It is a component used to build the Orange Canvas
  68. data-mining application.")
  69. (license license:gpl3)))
  70. (define-public python-orange-widget-base
  71. (package
  72. (name "python-orange-widget-base")
  73. (version "4.12.0")
  74. (source
  75. (origin
  76. (method url-fetch)
  77. (uri (pypi-uri "orange-widget-base" version))
  78. (sha256
  79. (base32 "13sy3s8rdqs3i3ghixljpqvnfz81qmbb0kqlasw39zvf39qc22kz"))))
  80. (build-system python-build-system)
  81. (arguments
  82. `(;; unittest fails to load one test, all other tests are passing:
  83. ;; AttributeError: module 'orangewidget' has no attribute 'version'.
  84. #:tests? #f
  85. #:phases
  86. (modify-phases %standard-phases
  87. (add-before 'check 'check-setup
  88. (lambda _
  89. (setenv "HOME" "/tmp")
  90. (setenv "QT_QPA_PLATFORM" "offscreen")
  91. #t)))))
  92. (propagated-inputs
  93. `(("python-anyqt" ,python-anyqt)
  94. ("python-matplotlib" ,python-matplotlib)
  95. ("python-orange-canvas-core"
  96. ,python-orange-canvas-core)
  97. ("python-pyqtgraph" ,python-pyqtgraph)))
  98. (home-page "https://github.com/biolab/orange-widget-base")
  99. (synopsis "Base Widget for Orange Canvas")
  100. (description
  101. "Orange Widget Base provides a base widget component for a interactive
  102. GUI based workflow. It is primarily used in the Orange framework.")
  103. (license license:gpl3+)))
  104. (define-public orange
  105. (package
  106. (name "orange")
  107. (version "3.28.0")
  108. (source
  109. (origin
  110. (method url-fetch)
  111. (uri (pypi-uri "Orange3" version))
  112. (sha256
  113. (base32 "1ac4xjjkx06z10hl7k0zh1z3qhkl5vng15l9jkpkmck9spinbzil"))))
  114. (build-system python-build-system)
  115. (arguments
  116. `(#:phases
  117. (modify-phases %standard-phases
  118. (add-after 'unpack 'preparations
  119. (lambda _
  120. ;; Delete test that opens an outgoing connection.
  121. (delete-file "Orange/tests/test_url_reader.py")
  122. ;; This is a binary data file and it breaks runpath validation.
  123. (delete-file "Orange/tests/datasets/binary-blob.tab")
  124. ;; Skip the test which uses that binary file.
  125. (substitute* "Orange/tests/test_txt_reader.py"
  126. (("test_read_nonutf8_encoding") "_test_read_nonutf8_encoding"))
  127. ;; We use a correct version of PyQtWebEngine, but the build scripts
  128. ;; consider it incorrect anyways. Remove the constraint entirely to
  129. ;; work around this bug.
  130. (substitute* "requirements-gui.txt" (("PyQtWebEngine>=5.12") ""))
  131. #t))
  132. (add-before 'check 'set-HOME
  133. ;; Tests need a writable home.
  134. (lambda _ (setenv "HOME" "/tmp") #t))
  135. (add-after 'install 'wrap-executable
  136. ;; Ensure that icons are found at runtime.
  137. (lambda* (#:key inputs outputs #:allow-other-keys)
  138. (let ((out (assoc-ref outputs "out")))
  139. (wrap-program (string-append out "/bin/orange-canvas")
  140. `("QT_PLUGIN_PATH" prefix
  141. ,(list (string-append (assoc-ref inputs "qtsvg")
  142. "/lib/qt5/plugins/")))))
  143. #t)))))
  144. (native-inputs
  145. `(("python-cython" ,python-cython)))
  146. (inputs
  147. `(("python-anyqt" ,python-anyqt)
  148. ("python-baycomp" ,python-baycomp)
  149. ("python-bottleneck" ,python-bottleneck)
  150. ("python-chardet" ,python-chardet)
  151. ("python-httpx" ,python-httpx)
  152. ("python-joblib" ,python-joblib)
  153. ("python-keyring" ,python-keyring)
  154. ("python-keyrings.alt" ,python-keyrings.alt)
  155. ("python-louvain" ,python-louvain)
  156. ("python-matplotlib" ,python-matplotlib)
  157. ("python-networkx" ,python-networkx)
  158. ("python-numpy" ,python-numpy)
  159. ("python-openpyxl" ,python-openpyxl)
  160. ("python-opentsne" ,python-opentsne)
  161. ("python-orange-canvas-core"
  162. ,python-orange-canvas-core)
  163. ("python-orange-widget-base"
  164. ,python-orange-widget-base)
  165. ("python-pandas" ,python-pandas)
  166. ("python-pyqt" ,python-pyqt)
  167. ("python-pyqtgraph" ,python-pyqtgraph)
  168. ("python-pyqtwebengine" ,python-pyqtwebengine)
  169. ("python-pyyaml" ,python-pyyaml)
  170. ("python-requests" ,python-requests)
  171. ("python-scikit-learn" ,python-scikit-learn)
  172. ("python-scipy" ,python-scipy)
  173. ("python-serverfiles" ,python-serverfiles)
  174. ("python-xlrd" ,python-xlrd)
  175. ("python-xlsxwriter" ,python-xlsxwriter)
  176. ("qtbase" ,qtbase-5)
  177. ("qtsvg" ,qtsvg)
  178. ("xdg-utils" ,xdg-utils)))
  179. (home-page "https://orangedatamining.com/")
  180. (synopsis "Component-based data mining framework")
  181. (description
  182. "Orange is a component-based, graphical framework for machine learning,
  183. data analysis, data mining and data visualization.")
  184. (license license:gpl3+)))
  185. (define-public python-serverfiles
  186. (package
  187. (name "python-serverfiles")
  188. (version "0.3.1")
  189. (source
  190. (origin
  191. (method url-fetch)
  192. (uri (pypi-uri "serverfiles" version))
  193. (sha256
  194. (base32 "1qgbzgnaxj4wsp2rdas53qxsh0j7xpibq25w6lviwyaqwwrgq42y"))))
  195. (build-system python-build-system)
  196. (propagated-inputs
  197. `(("python-requests" ,python-requests)))
  198. (home-page "https://github.com/biolab/serverfiles")
  199. (synopsis "Utility to access files on a HTTP server and store them locally")
  200. (description
  201. "This package provides an utility that accesses files on a HTTP server
  202. and stores them locally for reuse. It is primarily used by the Orange
  203. framework.")
  204. (license license:gpl3+)))