mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-14 15:10:16 -05:00
gnu: python-sqlalchemy: Run tests in parallel via xdist.
* gnu/packages/databases.scm (python-sqlalchemy)[phases]: Use gexps. {check}: Run tests in parallel; skip slow test_memusage. * gnu/packages/databases.scm (python2-sqlalchemy): Adjust to avoid xdist.
This commit is contained in:
parent
1f5f4cc1a2
commit
72d292eac0
1 changed files with 30 additions and 9 deletions
|
@ -32,7 +32,7 @@
|
||||||
;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
|
;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
|
||||||
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
|
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
|
||||||
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
|
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
|
||||||
;;; Copyright © 2018, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2018, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
|
;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
|
||||||
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
|
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
|
||||||
;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
|
;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
|
||||||
|
@ -3367,16 +3367,21 @@ (define-public python-sqlalchemy
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list python-cython ; for C extensions
|
(list python-cython ; for C extensions
|
||||||
python-pytest python-mock)) ; for tests
|
python-pytest python-mock python-pytest-xdist)) ; for tests
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
(list python-greenlet))
|
(list python-greenlet))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:phases
|
(list
|
||||||
(modify-phases %standard-phases
|
#:phases
|
||||||
(replace 'check
|
#~(modify-phases %standard-phases
|
||||||
(lambda* (#:key tests? #:allow-other-keys)
|
(replace 'check
|
||||||
(when tests?
|
(lambda* (#:key tests? #:allow-other-keys)
|
||||||
(invoke "py.test")))))))
|
(when tests?
|
||||||
|
(invoke "pytest" "-vv"
|
||||||
|
"-n" (number->string (parallel-job-count))
|
||||||
|
;; The memory usage tests are very expensive and run in
|
||||||
|
;; sequence; skip them.
|
||||||
|
"-k" "not test_memusage.py")))))))
|
||||||
(home-page "https://www.sqlalchemy.org")
|
(home-page "https://www.sqlalchemy.org")
|
||||||
(synopsis "Database abstraction library")
|
(synopsis "Database abstraction library")
|
||||||
(description
|
(description
|
||||||
|
@ -3388,7 +3393,23 @@ (define-public python-sqlalchemy
|
||||||
(license license:x11)))
|
(license license:x11)))
|
||||||
|
|
||||||
(define-public python2-sqlalchemy
|
(define-public python2-sqlalchemy
|
||||||
(package-with-python2 python-sqlalchemy))
|
(let ((base (package-with-python2 python-sqlalchemy)))
|
||||||
|
(package
|
||||||
|
(inherit base)
|
||||||
|
(arguments
|
||||||
|
(substitute-keyword-arguments (package-arguments base)
|
||||||
|
((#:phases phases)
|
||||||
|
#~(modify-phases #$phases
|
||||||
|
(replace 'check
|
||||||
|
(lambda* (#:key tests? #:allow-other-keys)
|
||||||
|
(when tests?
|
||||||
|
(invoke "pytest" "-vv"
|
||||||
|
;; The memory usage tests are very expensive and run in
|
||||||
|
;; sequence; skip them.
|
||||||
|
"-k" "not test_memusage.py"))))))))
|
||||||
|
;; Do not use pytest-xdist, which is broken for Python 2.
|
||||||
|
(native-inputs (modify-inputs (package-native-inputs base)
|
||||||
|
(delete "python-pytest-xdist"))))))
|
||||||
|
|
||||||
(define-public python-sqlalchemy-stubs
|
(define-public python-sqlalchemy-stubs
|
||||||
(package
|
(package
|
||||||
|
|
Loading…
Reference in a new issue