[med-svn] [Git][med-team/python-dnaio][upstream] New upstream version 0.5.2

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Tue Sep 21 16:33:42 BST 2021



Nilesh Patra pushed to branch upstream at Debian Med / python-dnaio


Commits:
cff60c89 by Nilesh Patra at 2021-09-21T20:59:22+05:30
New upstream version 0.5.2
- - - - -


5 changed files:

- .github/workflows/ci.yml
- + CHANGES.rst
- − buildwheels.sh
- src/dnaio/_core.pyx
- tests/test_internal.py


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -53,15 +53,22 @@ jobs:
     - uses: actions/checkout at v2
       with:
         fetch-depth: 0  # required for setuptools_scm
+    - name: Build wheels
+      uses: pypa/cibuildwheel at v2.1.1
+      with:
+        output-dir: dist/
+      env:
+        CIBW_BUILD: "cp3*-manylinux_x86_64"
+        CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
+        CIBW_ENVIRONMENT: "CFLAGS=-g0"
     - name: Set up Python
       uses: actions/setup-python at v2
       with:
         python-version: 3.7
     - name: Make distributions
       run: |
-        python -m pip install Cython
-        python setup.py sdist
-        ./buildwheels.sh
+        python -m pip install build
+        python -m build --sdist
         ls -l dist/
     - name: Publish to PyPI
       uses: pypa/gh-action-pypi-publish at v1.4.1


=====================================
CHANGES.rst
=====================================
@@ -0,0 +1,8 @@
+=========
+Changelog
+=========
+
+v0.5.2 (2021-09-07)
+-------------------
+
+* Issue #7: Ignore a trailing "3" in the read id


=====================================
buildwheels.sh deleted
=====================================
@@ -1,47 +0,0 @@
-#!/bin/bash
-#
-# Build manylinux wheels. Based on the example at
-# <https://github.com/pypa/python-manylinux-demo>
-#
-# It is best to run this in a fresh clone of the repository!
-#
-# Run this within the repository root:
-#   ./buildwheels.sh
-#
-# The wheels will be put into the dist/ subdirectory.
-
-set -xeuo pipefail
-
-manylinux=quay.io/pypa/manylinux2010_x86_64
-
-# For convenience, if this script is called from outside of a docker container,
-# it starts a container and runs itself inside of it.
-if ! grep -q docker /proc/1/cgroup && ! test -d /opt/python; then
-  # We are not inside a container
-  docker pull ${manylinux}
-  exec docker run --rm -v $(pwd):/io ${manylinux} /io/$0
-fi
-
-if ! test -d /io/dist; then
-  mkdir /io/dist
-  chown --reference=/io/setup.py /io/dist
-fi
-
-# Strip binaries (copied from multibuild)
-STRIP_FLAGS=${STRIP_FLAGS:-"-Wl,-strip-all"}
-export CFLAGS="${CFLAGS:-$STRIP_FLAGS}"
-export CXXFLAGS="${CXXFLAGS:-$STRIP_FLAGS}"
-
-for PYBIN in /opt/python/cp3[6789]-*/bin; do
-    ${PYBIN}/pip wheel --no-deps /io/ -w wheelhouse/
-done
-ls wheelhouse/
-
-# Bundle external shared libraries into the wheels
-for whl in wheelhouse/*.whl; do
-    auditwheel repair "$whl" --plat manylinux1_x86_64 -w repaired/
-done
-
-# Created files are owned by root, so fix permissions.
-chown -R --reference=/io/setup.py repaired/
-mv repaired/*.whl /io/dist/


=====================================
src/dnaio/_core.pyx
=====================================
@@ -297,16 +297,17 @@ def fastq_iter(file, sequence_class, Py_ssize_t buffer_size):
 def record_names_match(header1: str, header2: str):
     """
     Check whether the sequence record ids id1 and id2 are compatible, ignoring a
-    suffix of '1' or '2'. Some old paired-end reads have names that end in '/1'
-    and '/2'. Also, the fastq-dump tool (used for converting SRA files to FASTQ)
-    appends a .1 and .2 to paired-end reads if option -I is used.
+    suffix of '1', '2' or '3'. This exception allows to check some old
+    paired-end reads that have names ending in '/1' and '/2'. Also, the
+    fastq-dump tool (used for converting SRA files to FASTQ) appends '.1', '.2'
+    and sometimes '.3' to paired-end reads if option -I is used.
     """
-    # TODO optimize this a bit more
     cdef:
         str name1, name2
+
     name1 = header1.split()[0]
     name2 = header2.split()[0]
-    if name1[-1:] in '12' and name2[-1:] in '12':
+    if name1 and name2 and name1[-1] in '123' and name2[-1] in '123':
         name1 = name1[:-1]
         name2 = name2[:-1]
     return name1 == name2


=====================================
tests/test_internal.py
=====================================
@@ -470,10 +470,30 @@ class TestPairedSequenceReader:
     def test_record_names_match(self):
         match = record_names_match
         assert match('abc', 'abc')
+        assert match('abc def', 'abc')
+        assert match('abc def', 'abc ghi')
+        assert match('abc', 'abc ghi')
+        assert not match('abc', 'xyz')
+
+    def test_record_names_match_with_ignored_trailing_12(self):
+        match = record_names_match
         assert match('abc/1', 'abc/2')
         assert match('abc.1', 'abc.2')
         assert match('abc1', 'abc2')
-        assert not match('abc', 'xyz')
+        assert match('abc2', 'abc1')
+        assert match('abc1 def', 'abc1 ghi')
+        assert match('abc1 def', 'abc2 ghi')
+        assert match('abc2 def', 'abc1 ghi')
+        assert not match('abc1', 'abc4')
+        assert not match('abc1', 'abc')
+        assert not match('abc', 'abc1')
+        assert not match('abc', 'abc2')
+
+    def test_record_names_match_with_ignored_trailing_123(self):
+        match = record_names_match
+        assert match('abc/1', 'abc/3')
+        assert match('abc.1 def', 'abc.3 ghi')
+        assert match('abc.3 def', 'abc.1 ghi')
 
     def test_missing_partner1(self):
         s1 = BytesIO(b'')



View it on GitLab: https://salsa.debian.org/med-team/python-dnaio/-/commit/cff60c893524d4f79047681b05d78641608e8b34

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-dnaio/-/commit/cff60c893524d4f79047681b05d78641608e8b34
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/20210921/75ff0c63/attachment-0001.htm>


More information about the debian-med-commit mailing list