[med-svn] [Git][med-team/python-scanpy][master] 5 commits: Mark some more tests that eventually depend on internet access

Diane Trout (@diane) gitlab at salsa.debian.org
Tue Nov 9 22:13:20 GMT 2021



Diane Trout pushed to branch master at Debian Med / python-scanpy


Commits:
3803d0fa by Diane Trout at 2021-11-09T14:01:56-08:00
Mark some more tests that eventually depend on internet access

- - - - -
68905247 by Diane Trout at 2021-11-09T14:02:21-08:00
Add required skmisc build-dependency

- - - - -
0f4fb704 by Diane Trout at 2021-11-09T14:02:59-08:00
install files needed to run test environment

Scanpy's installer doesn't install them but pybuild needs them to run tests

- - - - -
71e3713f by Diane Trout at 2021-11-09T14:04:08-08:00
Skip some tests

mostly due to missing dependencies, though
test_seurat_v3_mean_var_output_with_batchkey ran my system out of
memory

- - - - -
94eaf931 by Diane Trout at 2021-11-09T14:12:27-08:00
autopkgtest runner

- - - - -


7 changed files:

- debian/control
- + debian/patches/mark-tests-need-internet.patch
- debian/patches/series
- + debian/pybuild.testfiles
- debian/rules
- + debian/tests/control
- + debian/tests/run-test


Changes:

=====================================
debian/control
=====================================
@@ -18,6 +18,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-tqdm,
                python3-importlib-metadata,
                python3-sklearn,
+               python3-skmisc,
                python3-statsmodels,
                python3-patsy,
                python3-networkx,


=====================================
debian/patches/mark-tests-need-internet.patch
=====================================
@@ -0,0 +1,20 @@
+--- a/scanpy/tests/test_plotting.py
++++ b/scanpy/tests/test_plotting.py
+@@ -829,6 +829,7 @@
+         # TODO: add other rank_genes_groups plots here once they work
+     ),
+ )
++ at pytest.mark.internet
+ def test_plot_rank_genes_groups_gene_symbols(
+     gene_symbols_adatas, func, check_same_image
+ ):
+--- a/scanpy/tests/test_datasets.py
++++ b/scanpy/tests/test_datasets.py
+@@ -118,6 +118,7 @@
+     assert output == str(image_path) + ': image/tiff'
+ 
+ 
++ at pytest.mark.internet
+ def test_download_failure():
+     from urllib.error import HTTPError
+ 


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 import_sc_sce_on_r.patch
+mark-tests-need-internet.patch


=====================================
debian/pybuild.testfiles
=====================================
@@ -0,0 +1,3 @@
+pyproject.toml
+scanpy/_utils/compute/__init__.py
+scanpy/_utils/compute/is_constant.py
\ No newline at end of file


=====================================
debian/rules
=====================================
@@ -15,11 +15,18 @@ override_dh_auto_clean:
 #	dh_auto_clean
 	${RM} -rf .pybuild __pycache__ scanpy/tests/__pycache__ scanpy/__pycache__
 
+# Needs louvain package
+export EXCLUDED_TESTS=test_cluster_subset or test_louvain_basic or test_partition_type or test_neighbors_key_obsp or test_rank_genes_groups_logreg or test_paga_paul15_subsampled or test_clustering_subset
+# ran out of memory
+EXCLUDED_TESTS += or test_seurat_v3_mean_var_output_with_batchkey
+# external tests
+EXCLUDED_TESTS += or test_harmony_timeseries or test_scanorama or test_scrublet
+
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	cp -a debian/data data
 	PYBUILD_SYSTEM=custom \
-	PYBUILD_TEST_ARGS="pytest-3 -rx  --ignore=scanpy/tests/_images -cov=scanpy --cov=tests --cov=docs_src --cov-report=term-missing:skip-covered -o console_output_style=progress" \
+	PYBUILD_TEST_ARGS="pytest-3 -rx -v -k \"not ( $(EXCLUDED_TESTS) ) \" --ignore=scanpy/tests/_images -cov=scanpy --cov=tests --cov=docs_src --cov-report=term-missing:skip-covered -o console_output_style=progress" \
 	dh_auto_test
 endif
 


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,10 @@
+Tests: run-test
+Restrictions: needs-root
+Depends: @,
+ flit,
+ python3-dask,
+ python3-leidenalg,
+ python3-pytest,
+# still needs to be packaged
+# python3-zappy,
+ python3-zarr,


=====================================
debian/tests/run-test
=====================================
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+
+set -e 
+
+if [ -z "$AUTOPKGTEST_NORMAL_USER" ];
+    then AUTOPKGTEST_NORMAL_USER=nobody
+fi
+
+cp $(pwd)/scanpy/datasets/{*.h5ad,*.txt} /usr/lib/python3/dist-packages/scanpy/datasets
+cp -r $(pwd)/scanpy/tests /usr/lib/python3/dist-packages/scanpy/
+cp -r $(pwd)/scanpy/sim_models /usr/lib/python3/dist-packages/scanpy/
+cp pyproject.toml conftest.py "$AUTOPKGTEST_TMP"
+
+# Needs louvian
+EXCLUDED_TESTS="test_cluster_subset or test_louvain_basic or test_partition_type or test_neighbors_key_obsp or test_rank_genes_groups_logreg or test_paga_paul15_subsampled"
+# needs write permission to test directory
+EXCLUDED_TESTS="$EXCLUDED_TESTS or test_embedding_plots or test_plotting or test_pbmc3k"
+# needs scanorama
+EXCLUDED_TESTS="$EXCLUDED_TESTS or test_scanorama_integrate"
+# Ignore packaging tests when installed
+EXCLUDED_TESTS="$EXCLUDED_TESTS or test_package_structure"
+chmod 1777 "$AUTOPKGTEST_TMP"
+
+for py in $(py3versions -r 2>/dev/null); do
+   cd "$AUTOPKGTEST_TMP"
+   echo "Using user $AUTOPKGTEST_NORMALUSER"
+   echo "Testing with $py:"
+   http_proxy= runuser -u $AUTOPKGTEST_NORMAL_USER -- $py -m pytest -v -k "not $EXCLUDED_TESTS" --pyargs scanpy
+done
+
+rm -r /usr/lib/python3/dist-packages/scanpy/tests
+rm -r /usr/lib/python3/dist-packages/scanpy/sim_models
+rm /usr/lib/python3/dist-packages/scanpy/datasets/{*.h5ad,*.txt}



View it on GitLab: https://salsa.debian.org/med-team/python-scanpy/-/compare/c35e79f02beadbc5fc87785f36ffcd0757703e60...94eaf9310490ffab17a2cc33667bbcffaebfffd7

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-scanpy/-/compare/c35e79f02beadbc5fc87785f36ffcd0757703e60...94eaf9310490ffab17a2cc33667bbcffaebfffd7
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211109/ae8083e6/attachment-0001.htm>


More information about the debian-med-commit mailing list