From 616bcc9c0b71de1cae271fa37ef8829872c92773 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 15 Nov 2021 15:12:50 +0000 Subject: gnu: python-scanpy: Run tests conditionally. * gnu/packages/bioinformatics.scm (python-scanpy)[arguments]: Respect TESTS? argument. --- gnu/packages/bioinformatics.scm | 81 +++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c5a1215442..2ffe7f7f9f 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -11996,47 +11996,48 @@ implementation differs in these ways: wheel (string-append "--prefix=" out))) (find-files "dist" "\\.whl$"))))) (replace 'check - (lambda* (#:key inputs #:allow-other-keys) - ;; These tests require Internet access. - (delete-file-recursively "scanpy/tests/notebooks") - (delete-file "scanpy/tests/test_clustering.py") - (delete-file "scanpy/tests/test_datasets.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. - (delete-file "scanpy/tests/test_embedding_plots.py") - (delete-file "scanpy/tests/test_preprocessing.py") - (delete-file "scanpy/tests/test_read_10x.py") - - ;; TODO: these fail with TypingError and "Use of unsupported - ;; NumPy function 'numpy.split'". - (delete-file "scanpy/tests/test_metrics.py") - - ;; The following tests requires 'scanorama', which isn't - ;; packaged yet. - (delete-file "scanpy/tests/external/test_scanorama_integrate.py") + (lambda* (#:key tests? inputs #:allow-other-keys) + (when tests? + ;; These tests require Internet access. + (delete-file-recursively "scanpy/tests/notebooks") + (delete-file "scanpy/tests/test_clustering.py") + (delete-file "scanpy/tests/test_datasets.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. + (delete-file "scanpy/tests/test_embedding_plots.py") + (delete-file "scanpy/tests/test_preprocessing.py") + (delete-file "scanpy/tests/test_read_10x.py") + + ;; TODO: these fail with TypingError and "Use of unsupported + ;; NumPy function 'numpy.split'". + (delete-file "scanpy/tests/test_metrics.py") + + ;; The following tests requires 'scanorama', which isn't + ;; packaged yet. + (delete-file "scanpy/tests/external/test_scanorama_integrate.py") - (setenv "PYTHONPATH" - (string-append (getcwd) ":" - (assoc-ref inputs "python-anndata:source") ":" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-vv" - "-k" - ;; Plot tests that fail. - (string-append "not test_dotplot_matrixplot_stacked_violin" - " and not test_violin_without_raw" - " and not test_correlation" - " and not test_scatterplots" - " and not test_scatter_embedding_add_outline_vmin_vmax_norm" - " and not test_paga" - " and not test_paga_compare" - - ;; These try to connect to the network - " and not test_plot_rank_genes_groups_gene_symbols" - " and not test_pca_chunked" - " and not test_pca_sparse" - " and not test_pca_reproducible"))))))) + (setenv "PYTHONPATH" + (string-append (getcwd) ":" + (assoc-ref inputs "python-anndata:source") ":" + (getenv "PYTHONPATH"))) + (invoke "pytest" "-vv" + "-k" + ;; Plot tests that fail. + (string-append "not test_dotplot_matrixplot_stacked_violin" + " and not test_violin_without_raw" + " and not test_correlation" + " and not test_scatterplots" + " and not test_scatter_embedding_add_outline_vmin_vmax_norm" + " and not test_paga" + " and not test_paga_compare" + + ;; These try to connect to the network + " and not test_plot_rank_genes_groups_gene_symbols" + " and not test_pca_chunked" + " and not test_pca_sparse" + " and not test_pca_reproducible")))))))) (propagated-inputs `(("python-anndata" ,python-anndata) ("python-h5py" ,python-h5py) -- cgit v1.2.3