diff -Nru atropos-1.1.29+dfsg/atropos/commands/trim/writers.py atropos-1.1.31+dfsg/atropos/commands/trim/writers.py --- atropos-1.1.29+dfsg/atropos/commands/trim/writers.py 2020-12-07 03:57:01.000000000 +0000 +++ atropos-1.1.31+dfsg/atropos/commands/trim/writers.py 2021-06-05 04:44:45.000000000 +0000 @@ -8,7 +8,7 @@ class Writers(object): """Manages writing to one or more outputs. - + Args: force_create: Whether empty output files should be created. """ @@ -16,16 +16,16 @@ self.writers = {} self.force_create = force_create self.suffix = None - + def get_writer(self, file_desc, compressed=False): """Create the writer for a file descriptor if it does not already exist. - + Args: file_desc: File descriptor. If `compressed==True`, this is a tuple (path, mode), otherwise it's only a path. compressed: Whether data has already been compressed. - + Returns: The writer. """ @@ -33,7 +33,7 @@ path, mode = file_desc else: path = file_desc - + if path not in self.writers: if self.suffix: real_path = add_suffix_to_path(path, self.suffix) @@ -44,12 +44,12 @@ self.writers[path] = open_output(real_path, mode) else: self.writers[path] = xopen(real_path, "w") - + return self.writers[path] - + def write_result(self, result, compressed=False): """Write results to output. - + Args: result: Dict with keys being file descriptors and values being data (either bytes or strings). Strings are expected to already have @@ -58,11 +58,11 @@ """ for file_desc, data in result.items(): self.write(file_desc, data, compressed) - + def write(self, file_desc, data, compressed=False): """Write data to output. If the specified path has not been seen before, the output is opened. - + Args: file_desc: File descriptor. If `compressed==True`, this is a tuple (path, mode), otherwise it's only a path. @@ -70,13 +70,13 @@ compressed: Whether data has already been compressed. """ self.get_writer(file_desc, compressed).write(data) - + def close(self): """Close all outputs. """ for path in self.force_create: if path not in self.writers and path != STDOUT: - with open_output(path, "w"): + with xopen(path, "w"): pass for writer in self.writers.values(): if writer not in (sys.stdout, sys.stderr): @@ -84,7 +84,7 @@ class Formatters(object): """Manages multiple formatters. - + Args: output: The output file name template. seq_formatter_args: Additional arguments to pass to the formatter @@ -98,10 +98,10 @@ self.mux_formatters = {} self.info_formatters = [] self.discarded = 0 - + def add_seq_formatter(self, filter_type, file1, file2=None): """Add a formatter. - + Args: filter_type: The type of filter that triggers writing with the formatter. @@ -109,13 +109,13 @@ """ self.seq_formatters[filter_type] = create_seq_formatter( file1, file2, **self.seq_formatter_args) - + def add_info_formatter(self, formatter): """Add a formatter for one of the delimited detail files (rest, info, wildcard). """ self.info_formatters.append(formatter) - + def get_mux_formatter(self, name): """Returns the formatter associated with the given name (barcode) when running in multiplexed mode. @@ -126,7 +126,7 @@ self.mux_formatters[name] = create_seq_formatter( path, **self.seq_formatter_args) return self.mux_formatters[name] - + def get_seq_formatters(self): """Returns a set containing all formatters that have handled at least one record. @@ -134,11 +134,11 @@ return ( set(f for f in self.seq_formatters.values() if f.written > 0) | set(f for f in self.mux_formatters.values() if f.written > 0)) - + def format(self, result, dest, read1, read2=None): """Format read(s) and add to a result dict. Also writes info records to any registered info formatters. - + Args: result: The result dict. dest: The destination (filter type). @@ -152,12 +152,12 @@ self.seq_formatters[dest].format(result, read1, read2) else: self.discarded += 1 - + for fmtr in self.info_formatters: fmtr.format(result, read1) if read2: fmtr.format(result, read2) - + def summarize(self): """Returns a summary dict. """ @@ -171,7 +171,7 @@ class DelimFormatter(object): """Base class for formatters that write to a delimited file. - + Args: path: The output file path. delim: The field delimiter. @@ -179,12 +179,12 @@ def __init__(self, path, delim=' '): self.path = path self.delim = delim - + def format(self, result, read): """Format a read and add it to `result`. """ raise NotImplementedError() - + def _format(self, result, fields): result[self.path].append("".join(( self.delim.join(str(f) for f in fields), @@ -204,7 +204,7 @@ """ def __init__(self, path): super(InfoFormatter, self).__init__(path, delim='\t') - + def format(self, result, read): if read.match: for match_info in read.match_info: diff -Nru atropos-1.1.29+dfsg/atropos/_version.py atropos-1.1.31+dfsg/atropos/_version.py --- atropos-1.1.29+dfsg/atropos/_version.py 2020-12-07 03:57:01.000000000 +0000 +++ atropos-1.1.31+dfsg/atropos/_version.py 2021-06-05 04:44:45.000000000 +0000 @@ -23,8 +23,8 @@ # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = " (HEAD -> 1.1, tag: 1.1.29)" - git_full = "99388da335616157d140bd385343f98626f0aa6e" + git_refnames = " (tag: 1.1.31)" + git_full = "916a0bfbc18149bbefb83ccff9fe2a0807415807" keywords = {"refnames": git_refnames, "full": git_full} return keywords diff -Nru atropos-1.1.29+dfsg/debian/changelog atropos-1.1.31+dfsg/debian/changelog --- atropos-1.1.29+dfsg/debian/changelog 2022-01-28 13:11:11.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/changelog 2022-04-04 17:23:19.000000000 +0000 @@ -1,21 +1,43 @@ -atropos (1.1.29+dfsg-1ubuntu1) jammy; urgency=medium +atropos (1.1.31+dfsg-3) unstable; urgency=medium - * Python 3.10 compatibility: import from collections.abc + * Team Upload. + [ Mohammed Bilal ] + * Initialize autopkgtest - -- Graham Inggs Fri, 28 Jan 2022 13:11:11 +0000 + [ Nilesh Patra ] + * d/control: B-D on python3-all-dev instead of python3-dev in + order to build extensions for all supported versions + * d/t/control: Update test deps + * d/t/run-unit-test: Do not test inplace, rather in AUTOPKGTEST_TMP -atropos (1.1.29+dfsg-1build1) jammy; urgency=medium + -- Nilesh Patra Mon, 04 Apr 2022 22:53:19 +0530 - * No-change rebuild with Python 3.10 as default version +atropos (1.1.31+dfsg-2) unstable; urgency=medium - -- Graham Inggs Thu, 13 Jan 2022 19:03:12 +0000 + * Team upload. + * Add python3.10.patch. (Closes: #1008635) + * Cleanup d/patches/. -atropos (1.1.29+dfsg-1) unstable; urgency=medium + -- Étienne Mollier Tue, 29 Mar 2022 23:21:04 +0200 - * Team upload. - * New upstream version. +atropos (1.1.31+dfsg-1) unstable; urgency=medium + + [ Steffen Moeller ] + * New upstream version + * Set upstream metadata fields: Bug-Database, Bug-Submit. + * Added patch to not use SCM version detection + + [ Andreas Tille ] + * Fix watchfile to detect new versions on github + * Standards-Version: 4.6.0 (routine-update) + * debhelper-compat 13 (routine-update) + * Add salsa-ci file (routine-update) + * Rules-Requires-Root: no (routine-update) + * Provice sensible name for uscan + * Enable builds with Python3.9 + * Set upstream metadata fields: Repository, Repository-Browse. - -- Steffen Moeller Wed, 09 Dec 2020 22:29:55 +0100 + -- Andreas Tille Wed, 02 Feb 2022 08:02:34 +0100 atropos (1.1.24+dfsg-1) unstable; urgency=medium diff -Nru atropos-1.1.29+dfsg/debian/control atropos-1.1.31+dfsg/debian/control --- atropos-1.1.29+dfsg/debian/control 2022-01-28 12:39:41.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/control 2022-04-04 17:15:12.000000000 +0000 @@ -1,21 +1,25 @@ Source: atropos -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Med Packaging Team +Maintainer: Debian Med Packaging Team Uploaders: Andreas Tille Section: science Priority: optional -Build-Depends: debhelper-compat (= 12), +Build-Depends: debhelper-compat (= 13), dh-python, cython3, - python3-dev, + python3-all-dev, python3-setuptools, + python3-setuptools-scm, + python3-wheel, + python3-loguru, + python3-xphyle, python3-pytest , python3-jinja2 , python3-pysam -Standards-Version: 4.4.1 +Standards-Version: 4.6.0 Vcs-Browser: https://salsa.debian.org/med-team/atropos Vcs-Git: https://salsa.debian.org/med-team/atropos.git Homepage: https://github.com/jdidion/atropos +Rules-Requires-Root: no Package: atropos Architecture: any diff -Nru atropos-1.1.29+dfsg/debian/patches/python3.10.patch atropos-1.1.31+dfsg/debian/patches/python3.10.patch --- atropos-1.1.29+dfsg/debian/patches/python3.10.patch 2022-01-28 12:38:53.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/patches/python3.10.patch 2022-04-04 16:57:45.000000000 +0000 @@ -1,9 +1,13 @@ -Description: Python 3.10 compatibility -Author: Graham Inggs -Last-Update: 2022-01-28 - ---- a/atropos/util/__init__.py -+++ b/atropos/util/__init__.py +Description: query modules from collections.abc instead of plain collections. + This fixes test failures when running on Python 3.10. +Author: Étienne Mollier +Bug-Debian: https://bugs.debian.org/1008635 +Forwarded: no +Last-Update: 2022-03-29 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- atropos.orig/atropos/util/__init__.py ++++ atropos/atropos/util/__init__.py @@ -1,6 +1,7 @@ """Widely useful utility methods. """ @@ -13,8 +17,8 @@ from datetime import datetime import errno import functools ---- a/atropos/commands/base.py -+++ b/atropos/commands/base.py +--- atropos.orig/atropos/commands/base.py ++++ atropos/atropos/commands/base.py @@ -1,6 +1,6 @@ """Common classes/functions used in commands. """ @@ -23,8 +27,8 @@ import copy import platform import sys ---- a/atropos/commands/trim/__init__.py -+++ b/atropos/commands/trim/__init__.py +--- atropos.orig/atropos/commands/trim/__init__.py ++++ atropos/atropos/commands/trim/__init__.py @@ -1,6 +1,7 @@ """Implementation of the 'trim' command. """ diff -Nru atropos-1.1.29+dfsg/debian/salsa-ci.yml atropos-1.1.31+dfsg/debian/salsa-ci.yml --- atropos-1.1.29+dfsg/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/salsa-ci.yml 2022-04-04 16:57:45.000000000 +0000 @@ -0,0 +1,4 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru atropos-1.1.29+dfsg/debian/tests/control atropos-1.1.31+dfsg/debian/tests/control --- atropos-1.1.29+dfsg/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/tests/control 2022-04-04 17:13:34.000000000 +0000 @@ -0,0 +1,3 @@ +Tests: run-unit-test +Depends: @, python3-all, python3-pytest +Restrictions: allow-stderr diff -Nru atropos-1.1.29+dfsg/debian/tests/run-unit-test atropos-1.1.31+dfsg/debian/tests/run-unit-test --- atropos-1.1.29+dfsg/debian/tests/run-unit-test 1970-01-01 00:00:00.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/tests/run-unit-test 2022-04-04 17:04:41.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +pkg=atropos +CUR_DIR=`pwd` + +export LC_ALL=C.UTF-8 +if [ "${AUTOPKGTEST_TMP}" = "" ] ; then + AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) + trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM +fi + +cp -a ${CUR_DIR}/tests $AUTOPKGTEST_TMP +cd $AUTOPKGTEST_TMP + +for py in $(py3versions -s 2> /dev/null) +do + $py -m pytest -v +done + diff -Nru atropos-1.1.29+dfsg/debian/upstream/metadata atropos-1.1.31+dfsg/debian/upstream/metadata --- atropos-1.1.29+dfsg/debian/upstream/metadata 2020-12-09 21:29:55.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/upstream/metadata 2022-04-04 16:57:45.000000000 +0000 @@ -1,23 +1,25 @@ Reference: - - Author: John P. Didion and Marcel Martin and Francis S. Collins - Title: > + Author: John P. Didion and Marcel Martin and Francis S. Collins + Title: > Atropos: specific, sensitive, and speedy trimming of sequencing reads - Journal: PeerJ - Year: 2017 - Volume: 5 - Pages: e3720 - DOI: 10.7717/peerj.3720 - PMID: 28875074 - URL: https://peerj.com/articles/3720/ - eprint: https://peerj.com/articles/3720.pdf + Journal: PeerJ + Year: 2017 + Volume: 5 + Pages: e3720 + DOI: 10.7717/peerj.3720 + PMID: 28875074 + URL: https://peerj.com/articles/3720/ + eprint: https://peerj.com/articles/3720.pdf Registry: - - Name: OMICtools - Entry: OMICS_20869 - - Name: bio.tools - Entry: atropos - - Name: SciCrunch - Entry: NA - - Name: conda:bioconda - Entry: atropos +- Name: OMICtools + Entry: OMICS_20869 +- Name: bio.tools + Entry: atropos +- Name: SciCrunch + Entry: NA +- Name: conda:bioconda + Entry: atropos Bug-Database: https://github.com/jdidion/atropos/issues Bug-Submit: https://github.com/jdidion/atropos/issues/new +Repository: https://github.com/jdidion/atropos.git +Repository-Browse: https://github.com/jdidion/atropos diff -Nru atropos-1.1.29+dfsg/debian/watch atropos-1.1.31+dfsg/debian/watch --- atropos-1.1.29+dfsg/debian/watch 2020-12-09 21:29:55.000000000 +0000 +++ atropos-1.1.31+dfsg/debian/watch 2022-04-04 16:57:45.000000000 +0000 @@ -1,8 +1,4 @@ version=4 -# To only be presented with version 1.x -#opts="repacksuffix=+dfsg,uversionmangle=s/-alpha\./~a/,dversionmangle=auto,repack,compression=xz" \ -# https://github.com/jdidion/atropos/releases .*/archive/v?(1[0-9.]*)@ARCHIVE_EXT@ - -opts="repacksuffix=+dfsg,dversionmangle=auto,repack,compression=xz" \ - https://github.com/jdidion/atropos/releases .*/archive/v?@ANY_VERSION@@ARCHIVE_EXT@ +opts="repacksuffix=+dfsg,uversionmangle=s/-alpha\./~a/,dversionmangle=auto,repack,compression=xz,filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \ + https://github.com/jdidion/atropos/tags .*/v?(\d[\d.]+)@ARCHIVE_EXT@ diff -Nru atropos-1.1.29+dfsg/Makefile atropos-1.1.31+dfsg/Makefile --- atropos-1.1.29+dfsg/Makefile 2020-12-07 03:57:01.000000000 +0000 +++ atropos-1.1.31+dfsg/Makefile 2021-06-05 04:44:45.000000000 +0000 @@ -62,7 +62,7 @@ -H "Content-Type:application/json" \ -H "Authorization: token $(token)" \ https://api.github.com/repos/$(repo)/releases \ - -d '{"tag_name":"$(version)","target_commitish": "master","name": "$(version)","body": "$(desc)","draft": false,"prerelease": false}' + -d '{"tag_name":"$(version)","target_commitish": "1.1","name": "$(version)","body": "$(desc)","draft": false,"prerelease": false}' # build a package with the files needed to run the workflows workflow: Binary files /tmp/tmpaxm7whz0/WVY7qlkgJQ/atropos-1.1.29+dfsg/tests/cut/empty.fastq.gz and /tmp/tmpaxm7whz0/MpptPK9DRI/atropos-1.1.31+dfsg/tests/cut/empty.fastq.gz differ diff -Nru atropos-1.1.29+dfsg/tests/test_paired.py atropos-1.1.31+dfsg/tests/test_paired.py --- atropos-1.1.29+dfsg/tests/test_paired.py 2020-12-07 03:57:01.000000000 +0000 +++ atropos-1.1.31+dfsg/tests/test_paired.py 2021-06-05 04:44:45.000000000 +0000 @@ -1,4 +1,5 @@ # coding: utf-8 +import gzip import os import shutil from unittest import TestCase @@ -610,10 +611,15 @@ @pytest.mark.timeout(10) def test_issue122(self): + # test that the empty fastq.gz files are valid gzip files + def callback(aligner, infiles, outfiles, result): + for out in outfiles: + with gzip.open(out) as z: + assert z.read() == "" run_paired( "--threads 2 --preserve-order --no-default-adapters -a TTAGACATAT -A CAGTGGAGTA", in1="empty.fastq", in2="empty.fastq", - expected1="empty.fastq", - expected2="empty.fastq", - ) \ No newline at end of file + expected1="empty.fastq.gz", + expected2="empty.fastq.gz", + ) diff -Nru atropos-1.1.29+dfsg/tests/utils.py atropos-1.1.31+dfsg/tests/utils.py --- atropos-1.1.29+dfsg/tests/utils.py 2020-12-07 03:57:01.000000000 +0000 +++ atropos-1.1.31+dfsg/tests/utils.py 2021-06-05 04:44:45.000000000 +0000 @@ -2,11 +2,13 @@ from contextlib import contextmanager from importlib import import_module import os +from subprocess import check_output, CalledProcessError import sys +import tempfile import traceback import urllib.request from atropos.commands import get_command - +from atropos.io import xopen @contextmanager def redirect_stderr(): @@ -39,19 +41,27 @@ def files_equal(path1, path2): - # return os.system("diff -u {0} {1}".format(path1, path2)) == 0 - with open(path1, 'r') as i1, open(path2, 'r') as i2: - print("<[{}]>".format(i1.read())) - print("<[{}]>".format(i2.read())) - from subprocess import check_output, CalledProcessError - + temp1 = tempfile.mkstemp()[1] + temp2 = tempfile.mkstemp()[1] try: - check_output("diff -u {0} {1}".format(path1, path2), shell=True) + with xopen(path1, 'r') as i1, xopen(path2, 'r') as i2: + # write contents to temp files in case the files are compressed + content1 = i1.read() + content2 = i2.read() + print("<[{}]>".format(content1)) + print("<[{}]>".format(content2)) + with open(temp1, "w") as out: + out.write(content1) + with open(temp2, "w") as out: + out.write(content2) + check_output("diff -u {0} {1}".format(temp1, temp2), shell=True) return True - except CalledProcessError as e: print("Diff: <{}>".format(e.output.decode("utf-8"))) return False + finally: + os.remove(temp1) + os.remove(temp2) def run(