[med-svn] [Git][med-team/pairtools][master] 2 commits: Add patch to take python3 interpreter as different during testing, if CURPY...
Nilesh Patra (@nilesh)
gitlab at salsa.debian.org
Sun Jan 1 12:36:14 GMT 2023
Nilesh Patra pushed to branch master at Debian Med / pairtools
Commits:
b4cc6c71 by Nilesh Patra at 2023-01-01T17:49:48+05:30
Add patch to take python3 interpreter as different during testing, if CURPY var is set at runtime; helps run build time tests for all supported pyvers
- - - - -
c1bcd84e by Nilesh Patra at 2023-01-01T17:51:26+05:30
A'ight lads, let's party now finally
- - - - -
3 changed files:
- debian/changelog
- debian/patches/tests-to-python3
- debian/rules
Changes:
=====================================
debian/changelog
=====================================
@@ -14,13 +14,16 @@ pairtools (1.0.2-1) unstable; urgency=medium
* Move doc/examples/* installation to dedicated examples package
* Add patch to not run coverage tests. It makes no sense to
run them downstream.
+ * Add patch to take python3 interpreter as different during
+ testing, if CURPY var is set at runtime; helps run build time
+ tests for all supported pyvers
[ Andreas Tille]
* Fix clean target
* Build-Depends: python3-pandas, python3-pysam, python3-scipy, libhts-dev,
python3-yaml <!nocheck>
- -- Nilesh Patra <nilesh at debian.org> Sun, 01 Jan 2023 10:52:19 +0530
+ -- Nilesh Patra <nilesh at debian.org> Sun, 01 Jan 2023 17:51:23 +0530
pairtools (0.3.0-3.2) unstable; urgency=medium
=====================================
debian/patches/tests-to-python3
=====================================
@@ -1,320 +1,467 @@
Description: Tests to Python3
-Author: Antoni Villalonga i Noceras <antoni at friki.cat>
-Last-Update: Wed, 18 Jun 2020 22:31:00 +0200
-
+Author: Antoni Villalonga i Noceras <antoni at friki.cat>, Nilesh Patra <nilesh at debian.org>
+Last-Update: Sun, Jan 1, 2023
--- a/tests/test_merge.py
+++ b/tests/test_merge.py
-@@ -22,7 +22,7 @@
+@@ -4,6 +4,8 @@
+ import subprocess
+ import pytest
+
++from common_py import getpyvers
++currpy = getpyvers()
+
+ import tempfile
+
+@@ -22,7 +24,7 @@
try:
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"sort",
-@@ -34,7 +34,7 @@
+@@ -34,7 +36,7 @@
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"sort",
-@@ -54,7 +54,7 @@
+@@ -54,7 +56,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"merge",
-@@ -102,7 +102,7 @@
+@@ -102,7 +104,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"merge",
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
-@@ -20,7 +20,7 @@
+@@ -6,6 +6,9 @@
+
+ import subprocess
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -20,7 +23,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"parse",
-@@ -64,7 +64,7 @@
+@@ -64,7 +67,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"parse",
--- a/tests/test_select.py
+++ b/tests/test_select.py
-@@ -13,7 +13,7 @@
+@@ -5,6 +5,9 @@
+ import pytest
+ from pairtools.lib import pairsam_format
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+ mock_pairsam_path = os.path.join(testdir, "data", "mock.pairsam")
+ mock_chromsizes_path = os.path.join(testdir, "data", "mock.chrom.sizes")
+@@ -13,7 +16,7 @@
def test_preserve():
try:
result = subprocess.check_output(
- ["python", "-m", "pairtools", "select", "True", mock_pairsam_path],
-+ ["python3", "-m", "pairtools", "select", "True", mock_pairsam_path],
++ [currpy, "-m", "pairtools", "select", "True", mock_pairsam_path],
).decode("ascii")
except subprocess.CalledProcessError as e:
print(e.output)
-@@ -35,7 +35,7 @@
+@@ -35,7 +38,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"select",
-@@ -68,7 +68,7 @@
+@@ -68,7 +71,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"select",
-@@ -101,7 +101,7 @@
+@@ -101,7 +104,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"select",
-@@ -136,7 +136,7 @@
+@@ -136,7 +139,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"select",
-@@ -169,7 +169,7 @@
+@@ -169,7 +172,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"select",
-@@ -221,7 +221,7 @@
+@@ -221,7 +224,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"select",
--- a/tests/test_sort.py
+++ b/tests/test_sort.py
-@@ -11,7 +11,7 @@
+@@ -4,6 +4,9 @@
+ import subprocess
+ import pytest
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -11,7 +14,7 @@
mock_pairsam_path = os.path.join(testdir, "data", "mock.pairsam")
try:
result = subprocess.check_output(
- ["python", "-m", "pairtools", "sort", mock_pairsam_path],
-+ ["python3", "-m", "pairtools", "sort", mock_pairsam_path],
++ [currpy, "-m", "pairtools", "sort", mock_pairsam_path],
).decode("ascii")
except subprocess.CalledProcessError as e:
print(e.output)
--- a/tests/test_split.py
+++ b/tests/test_split.py
-@@ -19,7 +19,7 @@
+@@ -5,6 +5,9 @@
+ import pytest
+ import tempfile
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+ mock_pairsam_path = os.path.join(testdir, "data", "mock.pairsam")
+
+@@ -19,7 +22,7 @@
try:
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"split",
--- a/tests/test_stats.py
+++ b/tests/test_stats.py
-@@ -12,7 +12,7 @@
+@@ -5,6 +5,9 @@
+ import numpy as np
+ import yaml
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -12,7 +15,7 @@
mock_pairsam_path = os.path.join(testdir, "data", "mock.4stats.pairs")
try:
result = subprocess.check_output(
- ["python", "-m", "pairtools", "stats", "--yaml", mock_pairsam_path],
-+ ["python3", "-m", "pairtools", "stats", "--yaml", mock_pairsam_path],
++ [currpy, "-m", "pairtools", "stats", "--yaml", mock_pairsam_path],
).decode("ascii")
except subprocess.CalledProcessError as e:
print(e.output)
-@@ -65,7 +65,7 @@
+@@ -65,7 +68,7 @@
try:
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"stats",
-@@ -78,7 +78,7 @@
+@@ -78,7 +81,7 @@
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"stats",
-@@ -90,7 +90,7 @@
+@@ -90,7 +93,7 @@
)
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"stats",
-@@ -103,7 +103,7 @@
+@@ -103,7 +106,7 @@
)
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"stats",
-@@ -116,7 +116,7 @@
+@@ -116,7 +119,7 @@
)
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"stats",
--- a/tests/test_flip.py
+++ b/tests/test_flip.py
-@@ -13,7 +13,7 @@
+@@ -4,6 +4,9 @@
+ import subprocess
+ import pytest
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+ mock_pairs_path = os.path.join(testdir, "data", "mock.4flip.pairs")
+ mock_chromsizes_path = os.path.join(testdir, "data", "mock.chrom.sizes")
+@@ -13,7 +16,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"flip",
--- a/tests/test_markasdup.py
+++ b/tests/test_markasdup.py
-@@ -11,7 +11,7 @@
+@@ -4,6 +4,9 @@
+ import subprocess
+ import pytest
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -11,7 +14,7 @@
mock_pairsam_path = os.path.join(testdir, "data", "mock.pairsam")
try:
result = subprocess.check_output(
- ["python", "-m", "pairtools", "markasdup", mock_pairsam_path],
-+ ["python3", "-m", "pairtools", "markasdup", mock_pairsam_path],
++ [currpy, "-m", "pairtools", "markasdup", mock_pairsam_path],
).decode("ascii")
except subprocess.CalledProcessError as e:
print(e.output)
--- a/tests/test_dedup.py
+++ b/tests/test_dedup.py
-@@ -32,7 +32,7 @@
+@@ -5,6 +5,9 @@
+ import pytest
+ import tempfile
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+ tmpdir = tempfile.TemporaryDirectory()
+@@ -32,7 +35,7 @@
try:
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"dedup",
-@@ -49,7 +49,7 @@
+@@ -49,7 +52,7 @@
)
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"dedup",
-@@ -68,7 +68,7 @@
+@@ -68,7 +71,7 @@
)
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"dedup",
--- a/tests/test_filterbycov.py
+++ b/tests/test_filterbycov.py
-@@ -37,7 +37,7 @@
+@@ -5,6 +5,9 @@
+ import pytest
+ import tempfile
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+ mock_pairs_path_filterbycov = os.path.join(testdir, "data", "mock.4filterbycov.pairs")
+@@ -37,7 +40,7 @@
for p in params:
subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"filterbycov",
--- a/tests/test_header.py
+++ b/tests/test_header.py
-@@ -22,7 +22,7 @@
+@@ -5,6 +5,9 @@
+
+ import subprocess
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -22,7 +25,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"header",
--- a/tests/test_parse2.py
+++ b/tests/test_parse2.py
-@@ -15,7 +15,7 @@
+@@ -6,6 +6,9 @@
+
+ import subprocess
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -15,7 +18,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"parse2",
-@@ -75,7 +75,7 @@
+@@ -75,7 +78,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"parse2",
--- a/tests/test_restrict.py
+++ b/tests/test_restrict.py
-@@ -16,7 +16,7 @@
+@@ -6,6 +6,9 @@
+
+ import subprocess
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -16,7 +19,7 @@
try:
result = subprocess.check_output(
[
- "python",
-+ "python3",
++ currpy,
"-m",
"pairtools",
"restrict",
--- a/tests/test_scaling.py
+++ b/tests/test_scaling.py
-@@ -13,7 +13,7 @@
+@@ -6,6 +6,9 @@
+ import pandas as pd
+ import io
+
++from common_py import getpyvers
++currpy = getpyvers()
++
+ testdir = os.path.dirname(os.path.realpath(__file__))
+
+
+@@ -13,7 +16,7 @@
mock_pairsam_path = os.path.join(testdir, "data", "mock.pairsam")
try:
result = subprocess.check_output(
- ["python", "-m", "pairtools", "scaling", mock_pairsam_path],
-+ ["python3", "-m", "pairtools", "scaling", mock_pairsam_path],
++ [currpy, "-m", "pairtools", "scaling", mock_pairsam_path],
).decode("ascii")
except subprocess.CalledProcessError as e:
print(e.output)
+--- /dev/null
++++ b/tests/common_py.py
+@@ -0,0 +1,6 @@
++import os
++
++def getpyvers():
++ if 'CURPY' in os.environ:
++ return os.getenv('CURPY')
++ return 'python3'
=====================================
debian/rules
=====================================
@@ -12,5 +12,9 @@ override_dh_auto_clean:
dh_auto_clean
rm -f pairtools/lib/*.c pairtools/lib/regions.cpp
+override_dh_auto_test:
+ dh_auto_test -- --system=custom --test-args="export CURPY={interpreter}; \
+ cd {build_dir} && {interpreter} -m pytest -v"
+
execute_after_dh_auto_install:
find debian/ -name '*.stats' -delete
View it on GitLab: https://salsa.debian.org/med-team/pairtools/-/compare/5a7934bb85b02a9f871a5bd717ae9449bafa49b9...c1bcd84ea92880889248754f03c4270c1cd7c0ca
--
View it on GitLab: https://salsa.debian.org/med-team/pairtools/-/compare/5a7934bb85b02a9f871a5bd717ae9449bafa49b9...c1bcd84ea92880889248754f03c4270c1cd7c0ca
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/20230101/ecabcc86/attachment-0001.htm>
More information about the debian-med-commit
mailing list