gnu: python-scanpy: Run tests conditionally.

* gnu/packages/bioinformatics.scm (python-scanpy)[arguments]: Respect TESTS?
argument.
This commit is contained in:
Ricardo Wurmus 2021-11-15 15:12:50 +00:00
parent 46432cceeb
commit 616bcc9c0b
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -11996,47 +11996,48 @@ (define-public python-scanpy
wheel (string-append "--prefix=" out))) wheel (string-append "--prefix=" out)))
(find-files "dist" "\\.whl$"))))) (find-files "dist" "\\.whl$")))))
(replace 'check (replace 'check
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key tests? inputs #:allow-other-keys)
;; These tests require Internet access. (when tests?
(delete-file-recursively "scanpy/tests/notebooks") ;; These tests require Internet access.
(delete-file "scanpy/tests/test_clustering.py") (delete-file-recursively "scanpy/tests/notebooks")
(delete-file "scanpy/tests/test_datasets.py") (delete-file "scanpy/tests/test_clustering.py")
(delete-file "scanpy/tests/test_score_genes.py") (delete-file "scanpy/tests/test_datasets.py")
(delete-file "scanpy/tests/test_highly_variable_genes.py") (delete-file "scanpy/tests/test_score_genes.py")
(delete-file "scanpy/tests/test_highly_variable_genes.py")
;; TODO: I can't get the plotting tests to work, even with Xvfb. ;; TODO: I can't get the plotting tests to work, even with Xvfb.
(delete-file "scanpy/tests/test_embedding_plots.py") (delete-file "scanpy/tests/test_embedding_plots.py")
(delete-file "scanpy/tests/test_preprocessing.py") (delete-file "scanpy/tests/test_preprocessing.py")
(delete-file "scanpy/tests/test_read_10x.py") (delete-file "scanpy/tests/test_read_10x.py")
;; TODO: these fail with TypingError and "Use of unsupported ;; TODO: these fail with TypingError and "Use of unsupported
;; NumPy function 'numpy.split'". ;; NumPy function 'numpy.split'".
(delete-file "scanpy/tests/test_metrics.py") (delete-file "scanpy/tests/test_metrics.py")
;; The following tests requires 'scanorama', which isn't ;; The following tests requires 'scanorama', which isn't
;; packaged yet. ;; packaged yet.
(delete-file "scanpy/tests/external/test_scanorama_integrate.py") (delete-file "scanpy/tests/external/test_scanorama_integrate.py")
(setenv "PYTHONPATH" (setenv "PYTHONPATH"
(string-append (getcwd) ":" (string-append (getcwd) ":"
(assoc-ref inputs "python-anndata:source") ":" (assoc-ref inputs "python-anndata:source") ":"
(getenv "PYTHONPATH"))) (getenv "PYTHONPATH")))
(invoke "pytest" "-vv" (invoke "pytest" "-vv"
"-k" "-k"
;; Plot tests that fail. ;; Plot tests that fail.
(string-append "not test_dotplot_matrixplot_stacked_violin" (string-append "not test_dotplot_matrixplot_stacked_violin"
" and not test_violin_without_raw" " and not test_violin_without_raw"
" and not test_correlation" " and not test_correlation"
" and not test_scatterplots" " and not test_scatterplots"
" and not test_scatter_embedding_add_outline_vmin_vmax_norm" " and not test_scatter_embedding_add_outline_vmin_vmax_norm"
" and not test_paga" " and not test_paga"
" and not test_paga_compare" " and not test_paga_compare"
;; These try to connect to the network ;; These try to connect to the network
" and not test_plot_rank_genes_groups_gene_symbols" " and not test_plot_rank_genes_groups_gene_symbols"
" and not test_pca_chunked" " and not test_pca_chunked"
" and not test_pca_sparse" " and not test_pca_sparse"
" and not test_pca_reproducible"))))))) " and not test_pca_reproducible"))))))))
(propagated-inputs (propagated-inputs
`(("python-anndata" ,python-anndata) `(("python-anndata" ,python-anndata)
("python-h5py" ,python-h5py) ("python-h5py" ,python-h5py)