[PATCH 00/22] Add Spyder

  • Open
  • quality assurance status badge
Details
3 participants
  • Lars-Dominik Braun
  • Nicolas Goaziou
  • Vinicius Monego
Owner
unassigned
Submitted by
Vinicius Monego
Severity
normal
V
V
Vinicius Monego wrote on 20 Apr 2021 07:19
(address . guix-patches@gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420051907.470294-1-monego@posteo.net
Hello Guix.

This series adds the Spyder IDE with all testing dependencies. The spyder package still has some rough edges: there is a warning about the parso version on startup, I had to disable the tests and there's a bug when importing numpy from a script (seems to be an issue with the numpy version). See


. Everything else seems to work after brief testing.

I didn't check if the qtconsole, watchdog and qdarkstyle updates would break other packages though.

Vinicius Monego (22):
gnu: Add python-spyder-kernels.
gnu: Add python-textdistance.
gnu: Add python-three-merge.
gnu: Add python-pyls-black.
gnu: Add python-pyls-spyder.
gnu: python-watchdog: Update to 1.0.2.
gnu: python-qtconsole: Update to 5.0.3.
gnu: python-qtconsole: Enable tests.
gnu: Add python-tinycss.
gnu: Add python-qstylizer.
gnu: python-language-server: Enable tests.
gnu: Add python-pytest-qt.
gnu: Add python-qtawesome.
gnu: Add python-qtsass.
gnu: python-qdarkstyle: Update to 3.0.2.
gnu: Add python-easyprocess.
gnu: Add python-entrypoint2.
gnu: Add python-pyvirtualdisplay.
gnu: Add python-pytest-xvfb.
gnu: python-diff-match-patch: Update to 20200713.
gnu: python-language-server: Relax dependency versions.
gnu: Add spyder.

gnu/local.mk | 3 +-
gnu/packages/python-check.scm | 76 ++++++-
gnu/packages/python-web.scm | 45 ++++-
gnu/packages/python-xyz.scm | 366 +++++++++++++++++++++++++++++++---
gnu/packages/spyder.scm | 229 ++++++++++++++++++++++
5 files changed, 693 insertions(+), 30 deletions(-)
create mode 100644 gnu/packages/spyder.scm

--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 01/22] gnu: Add python-spyder-kernels.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-1-monego@posteo.net
* gnu/packages/spyder.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register new file.
---
gnu/local.mk | 3 +-
gnu/packages/spyder.scm | 94 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/spyder.scm

Toggle diff (119 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 50b11a8ca2..94f468e743 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -38,7 +38,7 @@
# Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
# Copyright © 2020 Martin Becze <mjbecze@riseup.net>
# Copyright © 2020 Malte Frank Gerdes <mate.f.gerdes@gmail.com>
-# Copyright © 2020 Vinicius Monego <monego@posteo.net>
+# Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
# Copyright © 2021 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
# Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
#
@@ -518,6 +518,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/speech.scm \
%D%/packages/sphinx.scm \
%D%/packages/spice.scm \
+ %D%/packages/spyder.scm \
%D%/packages/sqlite.scm \
%D%/packages/squirrel.scm \
%D%/packages/ssh.scm \
diff --git a/gnu/packages/spyder.scm b/gnu/packages/spyder.scm
new file mode 100644
index 0000000000..9983066803
--- /dev/null
+++ b/gnu/packages/spyder.scm
@@ -0,0 +1,90 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages spyder)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix build-system python)
+ #:use-module (guix git-download)
+ #:use-module (guix packages)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages check)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages python-science)
+ #:use-module (gnu packages python-xyz))
+
+(define-public python-spyder-kernels
+ (package
+ (name "python-spyder-kernels")
+ (version "2.0.1")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/spyder-ide/spyder-kernels/")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lxa2s577dd3v8gslk7nzk5ck42gbnqa52dp9cw852n8rv988g4c"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ ;; Tests require write permission.
+ (add-before 'check 'change-home
+ (lambda _
+ (setenv "HOME" "/tmp")
+ #t))
+ (replace 'check
+ (lambda _
+ ;; Disable failing tests.
+ (invoke "python" "-m" "pytest" "-k"
+ (string-append "not test_cwd_in_sys_path"
+ " and not test_dask_multiprocessing"
+ " and not test_runfile"
+ " and not test_umr_reload_modules")))))))
+ (propagated-inputs
+ `(("python-cloudpickle" ,python-cloudpickle)
+ ("python-decorator" ,python-decorator)
+ ("python-ipykernel" ,python-ipykernel)
+ ("python-ipython" ,python-ipython)
+ ("python-jupyter-client" ,python-jupyter-client)
+ ("python-pyzmq" ,python-pyzmq)
+ ("python-wurlitzer" ,python-wurlitzer)))
+ (native-inputs
+ `(("python-codecov" ,python-codecov)
+ ("python-cython" ,python-cython)
+ ("python-dask" ,python-dask)
+ ("python-flaky" ,python-flaky)
+ ("python-matplotlib" ,python-matplotlib)
+ ("python-mock" ,python-mock)
+ ("python-numpy" ,python-numpy)
+ ("python-pandas" ,python-pandas)
+ ("python-pillow" ,python-pillow)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-scipy" ,python-scipy)
+ ("python-xarray" ,python-xarray)))
+ (home-page "https://github.com/spyder-ide/spyder-kernels")
+ (synopsis "Jupyter kernels for Spyder's console")
+ (description
+ "This package provides Jupyter kernels for use with the consoles of
+Spyder, the Scientific Python Development Environment.")
+ (license license:expat)))
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 02/22] gnu: Add python-textdistance.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-2-monego@posteo.net
* gnu/packages/python-xyz.scm (python-textdistance): New variable.
---
gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c01993ecd7..e908070a62 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7667,6 +7667,43 @@ features useful for text console applications.")
supports @code{readline} shortcuts.")
(license license:expat)))
+(define-public python-textdistance
+ (package
+ (name "python-textdistance")
+ (version "4.2.1")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/life4/textdistance")
+ (commit (string-append "v." version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1g17i356fnny4k6hjr2ayy9k77jbvd6zzmngws2kbrnvhss1wgwf"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'delete-external-test
+ (lambda _
+ ;; All tests in this file require external libraries.
+ (delete-file "tests/test_external.py")
+ #t)))))
+ (native-inputs
+ `(("python-hypothesis" ,python-hypothesis)
+ ("python-isort" ,python-isort)
+ ("python-numpy" ,python-numpy)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-tabulate" ,python-tabulate)))
+ (home-page "https://github.com/life4/textdistance")
+ (synopsis "Compute distance between the two texts")
+ (description "@code{textdistance} is a pure Python library for comparing
+distance between two or more sequences by many algorithms.")
+ (license license:expat)))
+
(define-public python-urwidtrees
(package
(name "python-urwidtrees")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 03/22] gnu: Add python-three-merge.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-3-monego@posteo.net
* gnu/packages/python-xyz.scm (python-three-merge): New variable.
---
gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e908070a62..a8fb9d9cbc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8095,6 +8095,40 @@ solve linear problems.")
algorithm.")
(license license:asl2.0)))
+(define-public python-three-merge
+ (package
+ (name "python-three-merge")
+ (version "0.1.1")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/spyder-ide/three-merge")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1fw28swh6jq4myr09j7gv68l241b8vwg470ak5xv0x4xwh2a1m86"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"))
+ (propagated-inputs
+ `(("python-diff-match-patch" ,python-diff-match-patch)))
+ (native-inputs
+ `(("python-flaky" ,python-flaky)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-pytest-timeout" ,python-pytest-timeout)))
+ (home-page "https://github.com/spyder-ide/three-merge")
+ (synopsis "Library for merging two strings with respect to a base one")
+ (description
+ "This package provides a Python library to perform a 3-way merge between
+strings, based on @code{diff-match-patch}. This library performs merges at a
+character level, as opposed to most VCS systems, which opt for a line-based
+approach.")
+ (license license:expat)))
+
(define-public snakemake
(package
(name "snakemake")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 04/22] gnu: Add python-pyls-black.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-4-monego@posteo.net
* gnu/packages/python-xyz.scm (python-pyls-black): New variable.
---
gnu/packages/python-xyz.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a8fb9d9cbc..ae18466686 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -965,6 +965,39 @@ concepts.")
(define-public python2-h5py
(package-with-python2 python-h5py))
+(define-public python-pyls-black
+ (package
+ (name "python-pyls-black")
+ (version "0.4.6")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rupert/pyls-black/")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0cjf0mjn156qp0x6md6mncs31hdpzfim769c2lixaczhyzwywqnj"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"))
+ (propagated-inputs
+ `(("python-black" ,python-black)
+ ("python-language-server"
+ ,python-language-server)
+ ("python-toml" ,python-toml)))
+ (native-inputs
+ `(("python-flake8" ,python-flake8)
+ ("python-isort" ,python-isort)
+ ("python-mypy" ,python-mypy)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (home-page "https://github.com/rupert/pyls-black")
+ (synopsis "Black plugin for the Python Language Server")
+ (description "Black plugin for the Python Language Server.")
+ (license license:expat)))
+
(define-public python-sh
(package
(name "python-sh")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 05/22] gnu: Add python-pyls-spyder.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-5-monego@posteo.net
* gnu/packages/spyder.scm (python-pyls-spyder): New variable.
---
gnu/packages/spyder.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (41 lines)
diff --git a/gnu/packages/spyder.scm b/gnu/packages/spyder.scm
index 9983066803..b1b10f6eb8 100644
--- a/gnu/packages/spyder.scm
+++ b/gnu/packages/spyder.scm
@@ -92,3 +92,34 @@ These kernels can launched either through Spyder itself or in an independent
Python session, and allow for interactive or file-based execution of Python
code inside Spyder.")
(license license:expat)))
+
+(define-public python-pyls-spyder
+ (package
+ (name "python-pyls-spyder")
+ (version "0.3.2")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/spyder-ide/pyls-spyder/")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qj0xc2n8hx6883rhl2mn5jrf421paqqwhzivn739z5wh5ssw99z"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (propagated-inputs
+ `(("python-language-server"
+ ,python-language-server)))
+ (home-page "https://github.com/spyder-ide/pyls-spyder")
+ (synopsis "Spyder extensions for the Python Language Server")
+ (description
+ "This package provides Spyder-specific extras for the Language Server
+Protocol (LSP) on Python, such as document symbol searching and others.")
+ (license license:expat)))
+
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 06/22] gnu: python-watchdog: Update to 1.0.2.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-6-monego@posteo.net
* gnu/packages/python-xyz.scm (python-watchdog): Update to 1.0.2.
[arguments]: Enable all tests, pass "pytest" to #:test-target.
[native-inputs]: Add python-pytest, python-pytest-runner.
---
gnu/packages/python-xyz.scm | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ae18466686..3e349d4bca 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22268,29 +22268,25 @@ files. These files are used to translate strings in android apps.")
(define-public python-watchdog
(package
(name "python-watchdog")
- (version "0.9.0")
+ (version "1.0.2")
(source
(origin
(method url-fetch)
(uri (pypi-uri "watchdog" version))
(sha256
(base32
- "07cnvvlpif7a6cg4rav39zq8fxa5pfqawchr46433pij0y6napwn"))))
+ "10l9r2nnk7gfh5asn4crvpa9kz83ng0zn5pzww7jnff06lmbqv1p"))))
(build-system python-build-system)
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-before 'check 'remove-failing
- (lambda _
- (delete-file "tests/test_inotify_buffer.py")
- (delete-file "tests/test_snapshot_diff.py")
- #t)))))
+ `(#:test-target "pytest"))
(propagated-inputs
`(("python-argh" ,python-argh)
("python-pathtools" ,python-pathtools)
("python-pyyaml" ,python-pyyaml)))
(native-inputs
- `(("python-pytest-cov" ,python-pytest-cov)
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-runner" ,python-pytest-runner)
("python-pytest-timeout" ,python-pytest-timeout)))
(home-page "https://github.com/gorakhargosh/watchdog")
(synopsis "File system events monitoring")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 07/22] gnu: python-qtconsole: Update to 5.0.3.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-7-monego@posteo.net
* gnu/packages/python-xyz.scm (python-qtconsole): Update to 5.0.3.
[propagated-inputs]: Add python-pyqt, python-qtpy.
---
gnu/packages/python-xyz.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3e349d4bca..852920db6e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10731,14 +10731,14 @@ Jupyter kernels such as IJulia and IRKernel.")
(define-public python-qtconsole
(package
(name "python-qtconsole")
- (version "4.4.3")
+ (version "5.0.3")
(source
(origin
(method url-fetch)
(uri (pypi-uri "qtconsole" version))
(sha256
(base32
- "1b03n1ixzscm0jw97l4dq5iy4fslnqxq5bb8287xb7n2a1gs26xw"))))
+ "0b91mb655pbn85cnikvhcl40is8w4hni2jjc00p478nj0xba74f0"))))
(build-system python-build-system)
(arguments
;; XXX: Tests are disabled, because this package needs python-ipython 7,
@@ -10755,7 +10755,9 @@ Jupyter kernels such as IJulia and IRKernel.")
#t)))))
(propagated-inputs
`(("python-ipykernel" ,python-ipykernel)
- ("python-ipython" ,python-ipython)))
+ ("python-ipython" ,python-ipython)
+ ("python-pyqt" ,python-pyqt)
+ ("python-qtpy" ,python-qtpy)))
(native-inputs
`(("python-pytest" ,python-pytest)))
(home-page "https://jupyter.org")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 08/22] gnu: python-qtconsole: Enable tests.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-8-monego@posteo.net
* gnu/packages/python-xyz.scm (python-qtconsole)[arguments]: Enable tests and
skip a failing test.
[native-inputs]: Add python-flaky.
---
gnu/packages/python-xyz.scm | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

Toggle diff (39 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 852920db6e..891aa344f1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10741,17 +10741,15 @@ Jupyter kernels such as IJulia and IRKernel.")
"0b91mb655pbn85cnikvhcl40is8w4hni2jjc00p478nj0xba74f0"))))
(build-system python-build-system)
(arguments
- ;; XXX: Tests are disabled, because this package needs python-ipython 7,
- ;; but we only have the LTS version 5.x. This means that there might be
- ;; runtime errors, but since this is a dependency of the Jupyter package,
- ;; and Jupyter can be used without the qtconsole we can overlook this for
- ;; now.
- `(#:tests? #f
- #:phases
+ `(#:phases
(modify-phases %standard-phases
(add-before 'check 'pre-check
(lambda _
(setenv "QT_QPA_PLATFORM" "offscreen")
+
+ ;; Skip failing test.
+ (substitute* "qtconsole/tests/test_jupyter_widget.py"
+ (("test_other_output") "_test_other_output"))
#t)))))
(propagated-inputs
`(("python-ipykernel" ,python-ipykernel)
@@ -10759,7 +10757,8 @@ Jupyter kernels such as IJulia and IRKernel.")
("python-pyqt" ,python-pyqt)
("python-qtpy" ,python-qtpy)))
(native-inputs
- `(("python-pytest" ,python-pytest)))
+ `(("python-flaky" ,python-flaky)
+ ("python-pytest" ,python-pytest)))
(home-page "https://jupyter.org")
(synopsis "Jupyter Qt console")
(description "This package provides a Qt-based console for Jupyter with
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 09/22] gnu: Add python-tinycss.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-9-monego@posteo.net
* gnu/packages/python-web.scm (python-tinycss): New variable.
---
This package is deprecated by the author but it's required by qstylizer.

gnu/packages/python-web.scm | 45 ++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)

Toggle diff (65 lines)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 1e57165509..8b9c223a41 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -37,7 +37,7 @@
;;; Copyright © 2020 Holger Peters <holger.peters@posteo.de>
;;; Copyright © 2020 Noisytoot <noisytoot@gmail.com>
;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
-;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
@@ -4557,6 +4557,49 @@ library to create slugs from unicode strings while keeping it DRY.")
(description "Generate complex HTML+JS pages with Python")
(license license:expat)))
+(define-public python-tinycss
+ (package
+ (name "python-tinycss")
+ (version "0.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "tinycss" version))
+ (sha256
+ (base32 "0vkifr595h28ymkjhrswwf0bm23lhznh5f44xyp7x7jy1ssnyc0j"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-flake8-isort
+ ;; Flake8 and isort tests fail.
+ (lambda _
+ (substitute* "setup.cfg" ((" --flake8 --isort") ""))
+ #t))
+ (replace 'check
+ (lambda _
+ ;; Disable failing test.
+ (invoke "python" "-m" "pytest" "-k"
+ "not test_speedups"))))))
+ (native-inputs
+ `(("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-flake8" ,python-pytest-flake8)
+ ("python-pytest-isort" ,python-pytest-isort)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (home-page "https://tinycss.readthedocs.io/")
+ (synopsis "Complete yet simple CSS parser for Python")
+ (description
+ "@code{tinycss} is a complete yet simple CSS parser for Python. It
+supports the full syntax and error handling for CSS 2.1 as well as some CSS 3
+modules:
+
+@itemize
+@item CSS Color 3
+@item CSS Fonts 3
+@item CSS Paged Media 3
+@end itemize")
+ (license license:bsd-3)))
+
(define-public python-tinycss2
(package
(name "python-tinycss2")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 10/22] gnu: Add python-qstylizer.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-10-monego@posteo.net
* gnu/packages/python-xyz.scm (python-qstylizer): New variable.
---
gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (51 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 891aa344f1..b76171de57 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11118,6 +11118,44 @@ for atomic file system operations.")
(define-public python2-atomicwrites
(package-with-python2 python-atomicwrites))
+(define-public python-qstylizer
+ (package
+ (name "python-qstylizer")
+ (version "0.1.10")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/blambright/qstylizer")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0zvkn6g1dn51kkw33v8qrlnwlmf5h6sw1ay3bh14ifjr8b9xsjjz"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'set-pbr-version
+ (lambda _
+ (setenv "PBR_VERSION" "3.0.1"))))))
+ (native-inputs
+ `(("python-pbr" ,python-pbr)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-catchlog" ,python-pytest-catchlog)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-mock" ,python-pytest-mock)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-pytest-xdist" ,python-pytest-xdist)))
+ (propagated-inputs
+ `(("python-inflection" ,python-inflection)
+ ("python-tinycss" ,python-tinycss)))
+ (home-page "https://github.com/blambright/qstylizer")
+ (synopsis "Qt stylesheet generation utility for PyQt/PySide")
+ (description "@code{qstylizer} is a Python package designed to help with
+the construction of PyQt/PySide stylesheets.")
+ (license license:expat)))
+
(define-public python-click-threading
(package
(name "python-click-threading")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 11/22] gnu: python-language-server: Enable tests.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-11-monego@posteo.net
* gnu/packages/python-xyz.scm (python-language-server): Enable tests.
[arguments]: Add phases to enable tests.
[propagated-inputs]: Add python-flake8.
---
gnu/packages/python-xyz.scm | 11 +++++++++++
1 file changed, 11 insertions(+)

Toggle diff (28 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b76171de57..6e2ac8b87b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4301,10 +4301,21 @@ Server (PLS).")
(base32
"1c0pnk2aibfhfaanrs0a5gkabkvz81gj20z7r0152b7fcx5ci14r"))))
(build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'set-HOME
+ (lambda _ (setenv "HOME" "/tmp") #t))
+ (replace 'check
+ (lambda _
+ ;; Disable failing test.
+ (invoke "python" "-m" "pytest" "-k"
+ "not test_pyqt_completion"))))))
(propagated-inputs
`(("python-autopep8" ,python-autopep8)
("python-configparser" ,python-configparser)
("python-pydocstyle" ,python-pydocstyle)
+ ("python-flake8" ,python-flake8)
("python-future" ,python-future)
("python-jedi" ,python-jedi)
("python-jsonrpc-server" ,python-jsonrpc-server)
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 12/22] gnu: Add python-pytest-qt.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-12-monego@posteo.net
* gnu/packages/python-check.scm (python-pytest-qt): New variable.
---
gnu/packages/python-check.scm | 39 ++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index bde836a931..db09197d41 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -7,7 +7,7 @@
;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
-;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
@@ -36,6 +36,7 @@
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages qt)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (guix utils)
@@ -1029,6 +1030,42 @@ variables in the @file{pytest.ini} file.")
libraries.")
(license license:expat)))
+(define-public python-pytest-qt
+ (package
+ (name "python-pytest-qt")
+ (version "3.3.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pytest-qt" version))
+ (sha256
+ (base32 "09c9psfn3zigpaw1l1cmynpa3csxa49wc2ih5lzl24skdkw0njvi"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'set-qpa
+ (lambda _
+ (setenv "QT_QPA_PLATFORM" "offscreen")
+ #t)))))
+ (propagated-inputs
+ `(("python-pyqt" ,python-pyqt)))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-setuptools-scm" ,python-setuptools-scm)))
+ (home-page "https://github.com/pytest-dev/pytest-qt")
+ (synopsis "Pytest support for PyQt and PySide applications")
+ (description
+ "@code{pytest-qt} is a Pytest plugin that allows programmers to write
+tests for PyQt5 and PySide2 applications.
+
+The main usage is to use the @code{qtbot} fixture, responsible for handling
+@code{qApp} creation as needed and provides methods to simulate user
+interaction, like key presses and mouse clicks.")
+ (license license:expat)))
+
(define-public python-codacy-coverage
(package
(name "python-codacy-coverage")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 13/22] gnu: Add python-qtawesome.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-13-monego@posteo.net
* gnu/packages/python-xyz.scm (python-qtawesome): New variable.
---
gnu/packages/python-xyz.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6e2ac8b87b..5c7fd02289 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11167,6 +11167,39 @@ for atomic file system operations.")
the construction of PyQt/PySide stylesheets.")
(license license:expat)))
+(define-public python-qtawesome
+ (package
+ (name "python-qtawesome")
+ (version "1.0.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "QtAwesome" version))
+ (sha256
+ (base32 "11yqvy9qajdkqxa6aisqs9b0nn0a67yr5s5l31yn83gmqiddj7bp"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'set-qpa
+ (lambda _
+ (setenv "QT_QPA_PLATFORM" "offscreen")
+ #t)))))
+ (native-inputs
+ `(("python-pyqt" ,python-pyqt)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-qt" ,python-pytest-qt)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (propagated-inputs
+ `(("python-qtpy" ,python-qtpy)))
+ (home-page "https://github.com/spyder-ide/qtawesome")
+ (synopsis "FontAwesome icons in PyQt and PySide applications")
+ (description
+ "QtAwesome enables iconic fonts such as Font Awesome and Elusive Icons in
+PyQt and PySide applications.")
+ (license license:expat)))
+
(define-public python-click-threading
(package
(name "python-click-threading")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 14/22] gnu: Add python-qtsass.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-14-monego@posteo.net
* gnu/packages/python-xyz.scm (python-qtsass): New variable.
---
gnu/packages/python-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5c7fd02289..28c89f71a1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24409,6 +24409,47 @@ query Watchman to discover file changes.")
environment.")
(license license:expat)))
+(define-public python-qtsass
+ (package
+ (name "python-qtsass")
+ (version "0.3.0")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/spyder-ide/qtsass/")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "09s04aa14d8jqbh71clrb5y7vcmkxlp94mwmvzrkxahry3bk03cb"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ ;; Tests need to read and write files.
+ (add-before 'check 'make-git-checkout-writable
+ (lambda _
+ (for-each make-file-writable (find-files "."))
+ #t)))))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (propagated-inputs
+ `(("python-libsass" ,python-libsass)))
+ (home-page "https://github.com/spyder-ide/qtsass")
+ (synopsis "Compile SCSS files to valid Qt stylesheets")
+ (description
+ "Besides being used in web development, CSS is also the way to stylize
+Qt-based desktop applications. However, Qt's CSS has a few variations that
+prevent the direct use of SASS compiler.
+
+The purpose of this tool is to fill the gap between SASS and Qt-CSS by
+handling those variations.")
+ (license license:expat)))
+
(define-public python-qdarkstyle
(package
(name "python-qdarkstyle")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 15/22] gnu: python-qdarkstyle: Update to 3.0.2.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-15-monego@posteo.net
* gnu/packages/python-xyz.scm (python-qdarkstyle): Update to 3.0.2.
[propagated-inputs]: Add python-qtsass, python-watchdog.
---
gnu/packages/python-xyz.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 28c89f71a1..0d51b2ba33 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24453,14 +24453,14 @@ handling those variations.")
(define-public python-qdarkstyle
(package
(name "python-qdarkstyle")
- (version "2.8.1")
+ (version "3.0.2")
(source
(origin
(method url-fetch)
(uri (pypi-uri "QDarkStyle" version))
(sha256
(base32
- "0883vzg35fzpyl1aiijzpfcdfvpq5vi325w0m7xkx7nxplh02fym"))))
+ "1bn7v39aqivcaqw5r72aba2zpkhq244qx0gijxrjkvj0bz7lklam"))))
(build-system python-build-system)
(arguments
`(;; Fails unable to detect valid Qt bindings even when
@@ -24468,7 +24468,9 @@ handling those variations.")
#:tests? #f))
(propagated-inputs
`(("python-helpdev" ,python-helpdev)
- ("python-qtpy" ,python-qtpy)))
+ ("python-qtpy" ,python-qtpy)
+ ("python-qtsass" ,python-qtsass)
+ ("python-watchdog" ,python-watchdog)))
(home-page
"https://github.com/ColinDuquesnoy/QDarkStyleSheet")
(synopsis
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 16/22] gnu: Add python-easyprocess.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-16-monego@posteo.net
* gnu/packages/python-xyz.scm (python-easyprocess): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0d51b2ba33..0de54212cc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14539,6 +14539,26 @@ etc.")
(package/inherit base
(name "ptpython2"))))
+(define-public python-easyprocess
+ (package
+ (name "python-easyprocess")
+ (version "0.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "EasyProcess" version))
+ (sha256
+ (base32 "115rzzr0hx4af4m6krf7dxn8851n4l8jfxahjzjc2r0zq2m8v57v"))))
+ (build-system python-build-system)
+ (arguments
+ ;; Tests require pyvirtualdisplay, which requires this package.
+ `(#:tests? #f))
+ (home-page "https://github.com/ponty/easyprocess")
+ (synopsis "Python subprocess interface")
+ (description
+ "@code{easyprocess} is an easy to use Python subprocess interface.")
+ (license license:bsd-3)))
+
(define-public python-stem
(package
(name "python-stem")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 17/22] gnu: Add python-entrypoint2.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-17-monego@posteo.net
* gnu/packages/python-xyz.scm (python-entrypoint2): New variable.
---
gnu/packages/python-xyz.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0de54212cc..0d554cd765 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14559,6 +14559,31 @@ etc.")
"@code{easyprocess} is an easy to use Python subprocess interface.")
(license license:bsd-3)))
+(define-public python-entrypoint2
+ (package
+ (name "python-entrypoint2")
+ (version "0.2.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "entrypoint2" version))
+ (sha256
+ (base32 "1qyxq54r2fbh09ab5sffbxajy8arbk6czxz5lq3ccr9qrypw6w27"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"))
+ (native-inputs
+ `(("python-easyprocess" ,python-easyprocess)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (home-page "https://github.com/ponty/entrypoint2")
+ (synopsis "Command-line interface for Python modules")
+ (description
+ "@code{entrypoint2} is an easy to use command-line interface for Python
+modules based on @code{argparse}. It translates function signature and
+documentation to argparse configuration.")
+ (license license:bsd-3)))
+
(define-public python-stem
(package
(name "python-stem")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 18/22] gnu: Add python-pyvirtualdisplay.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-18-monego@posteo.net
* gnu/packages/python-xyz.scm (python-pyvirtualdisplay): New variable.
---
gnu/packages/python-xyz.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0d554cd765..f104a0a049 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14584,6 +14584,35 @@ modules based on @code{argparse}. It translates function signature and
documentation to argparse configuration.")
(license license:bsd-3)))
+(define-public python-pyvirtualdisplay
+ (package
+ (name "python-pyvirtualdisplay")
+ (version "2.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyVirtualDisplay" version))
+ (sha256
+ (base32 "1z2fzgiw3xv3m1d9ppn53g07zhnpj05addiz56sm6ircxibnjk4x"))))
+ (build-system python-build-system)
+ (arguments
+ ;; Tests fail with:
+ ;; FileNotFoundError: [Errno 2] No such file or directory: 'Xvnc'.
+ `(#:tests? #f))
+ (native-inputs
+ `(("python-entrypoint2" ,python-entrypoint2)
+ ("python-psutil" ,python-psutil)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (propagated-inputs
+ `(("python-easyprocess" ,python-easyprocess)
+ ("python-pillow" ,python-pillow)))
+ (home-page "https://github.com/ponty/pyvirtualdisplay")
+ (synopsis "Python wrapper for Xvfb, Xephyr and Xvnc")
+ (description
+ "@code{pyvirtualdisplay} is a Python wrapper for Xvfb, Xephyr and Xvnc.")
+ (license license:bsd-3)))
+
(define-public python-stem
(package
(name "python-stem")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 21/22] gnu: python-language-server: Relax dependency versions.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-21-monego@posteo.net
* gnu/packages/python-xyz.scm (python-language-server)[arguments]: Add phase
to relax pycodestyle and pyflakes version.
---
gnu/packages/python-xyz.scm | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (19 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c9da5c3b64..fe33d0df99 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4304,6 +4304,12 @@ Server (PLS).")
(arguments
`(#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'relax-deps
+ (lambda _
+ (substitute* "setup.py" (("pycodestyle>=2.6.0,<2.7.0")
+ "pycodestyle"))
+ (substitute* "setup.py" (("pyflakes>=2.2.0,<2.3.0") "pyflakes"))
+ #t))
(add-before 'check 'set-HOME
(lambda _ (setenv "HOME" "/tmp") #t))
(replace 'check
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 19/22] gnu: Add python-pytest-xvfb.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-19-monego@posteo.net
* gnu/packages/python-check.scm (python-pytest-xvfb): New variable.
---
gnu/packages/python-check.scm | 37 +++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index db09197d41..427b32c5cf 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -39,6 +39,7 @@
#:use-module (gnu packages qt)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
+ #:use-module (gnu packages xorg)
#:use-module (guix utils)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
@@ -831,6 +832,42 @@ for the @code{pytest} framework.")
rounds that are calibrated to the chosen timer.")
(license license:bsd-2)))
+(define-public python-pytest-xvfb
+ (package
+ (name "python-pytest-xvfb")
+ (version "2.0.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pytest-xvfb" version))
+ (sha256
+ (base32 "1kyq5rg27dsnj7dc6x9y7r8vwf8rc88y2ppnnw6r96alw0nn9fn4"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:test-target "pytest"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'prepare-tests
+ (lambda _
+ (system "Xvfb &")
+ (setenv "DISPLAY" ":0")
+
+ ;; This test is meant to run on Windows.
+ (delete-file "tests/test_xvfb_windows.py")
+ #t)))))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("xorg-server" ,xorg-server-for-tests)))
+ (propagated-inputs
+ `(("python-pyvirtualdisplay"
+ ,python-pyvirtualdisplay)))
+ (home-page "https://github.com/The-Compiler/pytest-xvfb")
+ (synopsis "Pytest plugin to run Xvfb for tests")
+ (description
+ "This package provides a Pytest plugin to run Xvfb for tests.")
+ (license license:expat)))
+
(define-public python-pytest-services
(package
(name "python-pytest-services")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 20/22] gnu: python-diff-match-patch: Update to 20200713.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-20-monego@posteo.net
* gnu/packages/python-xyz.scm (python-diff-match-patch): Update to 20200713.
[arguments]: Enable tests.
[home-page]: Update to GitHub.
---
gnu/packages/python-xyz.scm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f104a0a049..c9da5c3b64 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16683,16 +16683,22 @@ make common patterns shorter and easier.")
(define-public python-diff-match-patch
(package
(name "python-diff-match-patch")
- (version "20121119")
+ (version "20200713")
(source
(origin
(method url-fetch)
(uri (pypi-uri "diff-match-patch" version))
(sha256
(base32
- "0k1f3v8nbidcmmrk65m7h8v41jqi37653za9fcs96y7jzc8mdflx"))))
+ "063s8zcxz787xfg7d1wxpqh59fxg3iz85ww9zhyz4vaqm80mlvys"))))
(build-system python-build-system)
- (home-page "https://code.google.com/p/google-diff-match-patch")
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (invoke "python" "-m" "unittest" "diff_match_patch.tests"))))))
+ (home-page "https://github.com/diff-match-patch-python/diff-match-patch")
(synopsis "Synchronize plain text")
(description "Diff Match and Patch libraries offer robust algorithms to
perform the operations required for synchronizing plain text.")
--
2.31.1
V
V
Vinicius Monego wrote on 20 Apr 2021 07:22
[PATCH 22/22] gnu: Add spyder.
(address . 47906@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
20210420052246.470690-22-monego@posteo.net
* gnu/packages/spyder.scm (spyder): New variable.
---
gnu/packages/spyder.scm | 110 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 109 insertions(+), 1 deletion(-)

Toggle diff (130 lines)
diff --git a/gnu/packages/spyder.scm b/gnu/packages/spyder.scm
index b1b10f6eb8..ee0c0d34dc 100644
--- a/gnu/packages/spyder.scm
+++ b/gnu/packages/spyder.scm
@@ -22,10 +22,17 @@
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (gnu packages)
+ #:use-module (gnu packages bioinformatics)
#:use-module (gnu packages check)
+ #:use-module (gnu packages databases)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-check)
+ #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-science)
- #:use-module (gnu packages python-xyz))
+ #:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages sphinx))
(define-public python-spyder-kernels
(package
@@ -123,3 +130,104 @@ code inside Spyder.")
Protocol (LSP) on Python, such as document symbol searching and others.")
(license license:expat)))
+(define-public spyder
+ (package
+ (name "spyder")
+ (version "5.0.1")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/spyder-ide/spyder/")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0pn6kl0jw9zcv8lbk1v90rlrvb3mvjvx6g0x55vv5fydn61nadc5"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ;TODO: Enable tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'preparations
+ (lambda _
+ ;; Delete bundled dependencies since we have all of them.
+ (delete-file-recursively "external-deps")
+
+ ;; Relax some dependency versions.
+ (substitute* "setup.py" (("jedi==0.17.2") "jedi"))
+ (substitute* "setup.py" (("parso==0.7.0") "parso"))
+ (substitute* "setup.py" (("qdarkstyle==3.0.2") "qdarkstyle"))
+ (substitute* "setup.py" (("'pyqt5<5.13',") ""))
+ (substitute* "setup.py" (("'pyqtwebengine<5.13',") ""))
+ #t))
+ ;; Ensure that QtWebEngineProcess is found by the executable.
+ (add-after 'wrap 'wrap-qt-process-path
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin/spyder"))
+ (qt-process-path (string-append
+ (assoc-ref inputs "qtwebengine")
+ "/lib/qt5/libexec/QtWebEngineProcess")))
+ (wrap-program bin
+ `("QTWEBENGINEPROCESS_PATH" = (,qt-process-path)))
+ #t)))
+ ;; Ensure that icons are found at runtime.
+ (add-after 'install 'wrap-executable
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (wrap-program (string-append out "/bin/spyder")
+ `("QT_PLUGIN_PATH" prefix
+ ,(list (string-append (assoc-ref inputs "qtsvg")
+ "/lib/qt5/plugins/")))))
+ #t)))))
+ (inputs
+ `(("python-atomicwrites" ,python-atomicwrites)
+ ("python-chardet" ,python-chardet)
+ ("python-cloudpickle" ,python-cloudpickle)
+ ("python-cookiecutter" ,python-cookiecutter)
+ ("python-diff-match-patch"
+ ,python-diff-match-patch)
+ ("python-intervaltree" ,python-intervaltree)
+ ("python-ipython" ,python-ipython)
+ ("python-jedi" ,python-jedi)
+ ("python-jsonschema" ,python-jsonschema)
+ ("python-keyring" ,python-keyring)
+ ("python-language-server"
+ ,python-language-server)
+ ("python-nbconvert" ,python-nbconvert)
+ ("python-numpydoc" ,python-numpydoc)
+ ("python-parso" ,python-parso)
+ ("python-pexpect" ,python-pexpect)
+ ("python-pickleshare" ,python-pickleshare)
+ ("python-psutil" ,python-psutil)
+ ("python-pygments" ,python-pygments)
+ ("python-pylint" ,python-pylint)
+ ("python-pyls-black" ,python-pyls-black)
+ ("python-pyls-spyder" ,python-pyls-spyder)
+ ("python-pyqt" ,python-pyqt)
+ ("python-pyqtwebengine" ,python-pyqtwebengine)
+ ("python-pyxdg" ,python-pyxdg)
+ ("python-pyzmq" ,python-pyzmq)
+ ("python-qdarkstyle" ,python-qdarkstyle)
+ ("python-qstylizer" ,python-qstylizer)
+ ("python-qtawesome" ,python-qtawesome)
+ ("python-qtconsole" ,python-qtconsole)
+ ("python-qtpy" ,python-qtpy)
+ ("python-sphinx" ,python-sphinx)
+ ("python-spyder-kernels" ,python-spyder-kernels)
+ ("python-textdistance" ,python-textdistance)
+ ("python-three-merge" ,python-three-merge)
+ ("python-watchdog" ,python-watchdog)
+ ("qtsvg" ,qtsvg)
+ ("qtwebengine" ,qtwebengine)))
+ (home-page "https://www.spyder-ide.org/")
+ (synopsis "Scientific Python Development Environment")
+ (description
+ "Spyder is a scientific environment written in Python, for Python, and
+designed by and for scientists, engineers and data analysts. It offers a
+unique combination of the advanced editing, analysis, debugging, and profiling
+functionality of a comprehensive development tool with the data exploration,
+interactive execution, deep inspection, and visualization capabilities of a
+scientific package.")
+ (license license:expat)))
--
2.31.1
L
L
Lars-Dominik Braun wrote on 28 Apr 2021 14:49
Re: [bug#47906] [PATCH 13/22] gnu: Add python-qtawesome.
(name . Vinicius Monego)(address . monego@posteo.net)(address . 47906@debbugs.gnu.org)
YIlZxyGHaUhycr9/@noor.fritz.box
Hi,

Toggle quote (1 lines)
> * gnu/packages/python-xyz.scm (python-qtawesome): New variable.
as far as I see this package bundles font-awesome version 5, which is
not FSDG-free per https://bugs.gnu.org/32916,so from my understanding
it cannot be included in Guix (which is a shame).

Cheers,
Lars
V
V
Vinicius Monego wrote on 29 Apr 2021 18:07
(name . Lars-Dominik Braun)(address . lars@6xq.net)(address . 47906@debbugs.gnu.org)
87k0ol5b1h.fsf@posteo.net
Lars-Dominik Braun writes:

Toggle quote (3 lines)
> Hi,
>

Hello,

Toggle quote (8 lines)
>> * gnu/packages/python-xyz.scm (python-qtawesome): New variable.
> as far as I see this package bundles font-awesome version 5, which is
> not FSDG-free per https://bugs.gnu.org/32916, so from my understanding
> it cannot be included in Guix (which is a shame).
>
> Cheers,
> Lars

Interesting, I saw that package in Debian (also Spyder is there) and
assumed it was free.

Upon inspecting the Debian package further I found that it sets the
SYSTEM_FONTS variable. Those fonts are in the packages
fonts-elusive-icons and fonts-font-awesome, the latter having the version
"5.0.10+really4.7.0~dfsg-4.1". Seems to be a way to pretend that
fontawesome4 is fontawesome5.

Maybe we can do something similar, but I do not have the time to
investigate this for now. Could the patches not related to spyder be
applied in the meantime? I can send a v2 with a selection if that makes
it easier.
L
L
Lars-Dominik Braun wrote on 2 May 2021 16:32
(name . Vinicius Monego)(address . monego@posteo.net)(address . 47906@debbugs.gnu.org)
YI64FY0IzezahvvP@noor.fritz.box
Hi Vinicius,

Toggle quote (2 lines)
> Interesting, I saw that package in Debian (also Spyder is there) and
> assumed it was free.
it simply ships the font files inside python-qtawesome-common. I don’t
know why it depends on fonts-font-awesome.

Toggle quote (5 lines)
> Upon inspecting the Debian package further I found that it sets the
> SYSTEM_FONTS variable. Those fonts are in the packages
> fonts-elusive-icons and fonts-font-awesome, the latter having the version
> "5.0.10+really4.7.0~dfsg-4.1". Seems to be a way to pretend that
> fontawesome4 is fontawesome5.
Looking at the source code this variable does nothing at all. It still
tries to load the bundled (missing) fonts inside __init__.py and fails.
I tried replacing the font paths, which works, but then icons are
missing in spyder, because they are not present in fontawesome 4.7.

Toggle quote (2 lines)
> Could the patches not related to spyder be applied in the meantime? I
> can send a v2 with a selection if that makes it easier.
Sure, a v2 shouldn’t be necessary, I have everything in git, but I’ll
need to test the package upgrades first.

Cheers,
Lars
L
L
Lars-Dominik Braun wrote on 8 May 2021 11:30
(name . Vinicius Monego)(address . monego@posteo.net)(address . 47906@debbugs.gnu.org)
YJZaUvAMOaIOZ8M9@noor.fritz.box
Hi,

I pushed the package additions with
commit dd05a93743bef6bb946d03cd0c665e3b1d62a116. The upgrades
(python-diff-match-patch for example) seem to break other packages
unfortunately and I don’t have time to investigate.

Lars
N
N
Nicolas Goaziou wrote on 26 May 2021 23:46
Re: [bug#47906] [PATCH 00/22] Add Spyder
(name . Vinicius Monego)(address . monego@posteo.net)(address . 47906@debbugs.gnu.org)
87cztddv8l.fsf@nicolasgoaziou.fr
Hello,

Vinicius Monego <monego@posteo.net> writes:

Toggle quote (2 lines)
> This series adds the Spyder IDE with all testing dependencies.

I tried to build Spyder but python-qtawesome fails to build with the
following error message. Do you know where it could come from?

Toggle snippet (87 lines)
============================= test session starts ==============================
platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
PySide2 5.14.2.3 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
rootdir: /tmp/guix-build-python-qtawesome-1.0.2.drv-0/QtAwesome-1.0.2
plugins: qt-3.3.0
collected 5 items

qtawesome/tests/test_icon_browser.py .FF [ 60%]
qtawesome/tests/test_qtawesome.py .. [100%]

=================================== FAILURES ===================================
__________________________________ test_copy ___________________________________

qtbot = <pytestqt.qtbot.QtBot object at 0x7fffef9dc1c0>
browser = <qtawesome.icon_browser.IconBrowser object at 0x7fffeffb4790>

def test_copy(qtbot, browser):
"""
Ensure the copy UX works
"""
clipboard = QtWidgets.QApplication.instance().clipboard()
clipboard.setText('')
assert clipboard.text() == ""
# Enter a search term and press enter
> qtbot.keyClicks(browser._lineEdit, 'google')

qtawesome/tests/test_icon_browser.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<PyQt5.QtWidgets.QLineEdit object at 0x7fffeffb4ca0>, 'google')
kwargs = {}

def result(*args, **kwargs):
> return qtest_method(*args, **kwargs)
E TypeError: 'PySide2.QtTest.QTest.keyClicks' called with wrong argument types:
E PySide2.QtTest.QTest.keyClicks(QLineEdit, str)
E Supported signatures:
E PySide2.QtTest.QTest.keyClicks(PySide2.QtWidgets.QWidget, str, PySide2.QtCore.Qt.KeyboardModifiers = PySide2.QtCore.Qt.KeyboardModifier.NoModifier, int = -1)

/gnu/store/ni4pqis58imdjnlj9r29ig2ki0ry29ir-python-pytest-qt-3.3.0/lib/python3.8/site-packages/pytestqt/qtbot.py:626: TypeError
_________________________________ test_filter __________________________________

qtbot = <pytestqt.qtbot.QtBot object at 0x7fffef9e1850>
browser = <qtawesome.icon_browser.IconBrowser object at 0x7fffeffb44c0>

def test_filter(qtbot, browser):
"""
Ensure the filter UX works
"""
initRowCount = browser._listView.model().rowCount()
assert initRowCount > 0
# Enter a search term
> qtbot.keyClicks(browser._lineEdit, 'google')

qtawesome/tests/test_icon_browser.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<PyQt5.QtWidgets.QLineEdit object at 0x7fffef987790>, 'google')
kwargs = {}

def result(*args, **kwargs):
> return qtest_method(*args, **kwargs)
E TypeError: 'PySide2.QtTest.QTest.keyClicks' called with wrong argument types:
E PySide2.QtTest.QTest.keyClicks(QLineEdit, str)
E Supported signatures:
E PySide2.QtTest.QTest.keyClicks(PySide2.QtWidgets.QWidget, str, PySide2.QtCore.Qt.KeyboardModifiers = PySide2.QtCore.Qt.KeyboardModifier.NoModifier, int = -1)

/gnu/store/ni4pqis58imdjnlj9r29ig2ki0ry29ir-python-pytest-qt-3.3.0/lib/python3.8/site-packages/pytestqt/qtbot.py:626: TypeError
=============================== warnings summary ===============================
qtawesome/tests/test_icon_browser.py::test_browser_init
qtawesome/tests/test_icon_browser.py::test_browser_init
qtawesome/tests/test_icon_browser.py::test_copy
qtawesome/tests/test_icon_browser.py::test_copy
qtawesome/tests/test_icon_browser.py::test_filter
qtawesome/tests/test_icon_browser.py::test_filter
/tmp/guix-build-python-qtawesome-1.0.2.drv-0/QtAwesome-1.0.2/qtawesome/icon_browser.py:170: DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
self.setGridSize(QtCore.QSize(tileWidth, tileWidth))

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================== 2 failed, 3 passed, 6 warnings in 0.38s ====================
command "python" "-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "pytest" failed with status 1

Note that most of the packages in this patch set have been applied already.

Regards,
--
Nicolas Goaziou
V
?