[med-svn] [Git][med-team/pairtools][master] release
Alexandre Detiste (@detiste-guest)
gitlab at salsa.debian.org
Mon Nov 18 21:24:36 GMT 2024
Alexandre Detiste pushed to branch master at Debian Med / pairtools
Commits:
8d17fef5 by Alexandre Detiste at 2024-11-18T22:24:08+01:00
release
- - - - -
6 changed files:
- debian/changelog
- debian/control
- debian/copyright
- + debian/patches/remove_pipes.patch
- debian/patches/series
- debian/rules
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+pairtools (1.1.0-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream version 1.1.0
+ * Vendor "the" pipes module that was removed from Python3.13
+ (Closes: #1081672)
+ * Patch-out SyntaxWarnings (Closes: #1085765 )
+
+ -- Alexandre Detiste <tchet at debian.org> Mon, 18 Nov 2024 22:23:36 +0100
+
pairtools (1.0.3-1) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -7,6 +7,7 @@ Build-Depends: debhelper-compat (= 13),
dh-sequence-python3,
python3-all-dev,
cython3,
+ python-is-python3,
python3-setuptools,
python3-bioframe,
python3-click,
=====================================
debian/copyright
=====================================
@@ -45,3 +45,57 @@ License: GPL-2+
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+Files: debian/patches/remove_pipes.patch
+Copyright: 1992 Guido Van Rossum
+License: PSF2
+ .
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+ --------------------------------------------
+ .
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
+ otherwise using this software ("Python") in source or binary form and
+ its associated documentation.
+ .
+ 2. Subject to the terms and conditions of this License Agreement, PSF
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
+ license to reproduce, analyze, test, perform and/or display publicly,
+ prepare derivative works, distribute, and otherwise use Python alone
+ or in any derivative version, provided, however, that PSF's License
+ Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001,
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+ 2013, 2014 Python Software Foundation; All Rights Reserved" are
+ retained in Python alone or in any derivative version prepared by
+ Licensee.
+ .
+ 3. In the event Licensee prepares a derivative work that is based on
+ or incorporates Python or any part thereof, and wants to make
+ the derivative work available to others as provided herein, then
+ Licensee hereby agrees to include in any such work a brief summary of
+ the changes made to Python.
+ .
+ 4. PSF is making Python available to Licensee on an "AS IS"
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+ INFRINGE ANY THIRD PARTY RIGHTS.
+ .
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+ .
+ 6. This License Agreement will automatically terminate upon a material
+ breach of its terms and conditions.
+ .
+ 7. Nothing in this License Agreement shall be deemed to create any
+ relationship of agency, partnership, or joint venture between PSF and
+ Licensee. This License Agreement does not grant permission to use PSF
+ trademarks or trade name in a trademark sense to endorse or promote
+ products or services of Licensee, or any third party.
+ .
+ 8. By copying, installing or otherwise using Python, Licensee
+ agrees to be bound by the terms and conditions of this License
+ Agreement.
=====================================
debian/patches/remove_pipes.patch
=====================================
@@ -0,0 +1,273 @@
+--- a/pairtools/cli/split.py
++++ b/pairtools/cli/split.py
+@@ -1,7 +1,6 @@
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+ import sys
+-import pipes
+ import click
+
+ from ..lib import fileio, pairsam_format, headerops
+--- a/pairtools/lib/fileio.py
++++ b/pairtools/lib/fileio.py
+@@ -1,8 +1,9 @@
+ import shutil
+-import pipes
+ import subprocess
+ import sys
+
++from . import pipes
++
+ class ParseError(Exception):
+ pass
+
+--- /dev/null
++++ b/pairtools/lib/pipes.py
+@@ -0,0 +1,247 @@
++"""Conversion pipeline templates.
++
++The problem:
++------------
++
++Suppose you have some data that you want to convert to another format,
++such as from GIF image format to PPM image format. Maybe the
++conversion involves several steps (e.g. piping it through compress or
++uuencode). Some of the conversion steps may require that their input
++is a disk file, others may be able to read standard input; similar for
++their output. The input to the entire conversion may also be read
++from a disk file or from an open file, and similar for its output.
++
++The module lets you construct a pipeline template by sticking one or
++more conversion steps together. It will take care of creating and
++removing temporary files if they are necessary to hold intermediate
++data. You can then use the template to do conversions from many
++different sources to many different destinations. The temporary
++file names used are different each time the template is used.
++
++The templates are objects so you can create templates for many
++different conversion steps and store them in a dictionary, for
++instance.
++
++
++Directions:
++-----------
++
++To create a template:
++ t = Template()
++
++To add a conversion step to a template:
++ t.append(command, kind)
++where kind is a string of two characters: the first is '-' if the
++command reads its standard input or 'f' if it requires a file; the
++second likewise for the output. The command must be valid /bin/sh
++syntax. If input or output files are required, they are passed as
++$IN and $OUT; otherwise, it must be possible to use the command in
++a pipeline.
++
++To add a conversion step at the beginning:
++ t.prepend(command, kind)
++
++To convert a file to another file using a template:
++ sts = t.copy(infile, outfile)
++If infile or outfile are the empty string, standard input is read or
++standard output is written, respectively. The return value is the
++exit status of the conversion pipeline.
++
++To open a file for reading or writing through a conversion pipeline:
++ fp = t.open(file, mode)
++where mode is 'r' to read the file, or 'w' to write it -- just like
++for the built-in function open() or for os.popen().
++
++To create a new template object initialized to a given one:
++ t2 = t.clone()
++""" # '
++
++
++import re
++import os
++import tempfile
++# we import the quote function rather than the module for backward compat
++# (quote used to be an undocumented but used function in pipes)
++from shlex import quote
++
++__all__ = ["Template"]
++
++# Conversion step kinds
++
++FILEIN_FILEOUT = 'ff' # Must read & write real files
++STDIN_FILEOUT = '-f' # Must write a real file
++FILEIN_STDOUT = 'f-' # Must read a real file
++STDIN_STDOUT = '--' # Normal pipeline element
++SOURCE = '.-' # Must be first, writes stdout
++SINK = '-.' # Must be last, reads stdin
++
++stepkinds = [FILEIN_FILEOUT, STDIN_FILEOUT, FILEIN_STDOUT, STDIN_STDOUT, \
++ SOURCE, SINK]
++
++
++class Template:
++ """Class representing a pipeline template."""
++
++ def __init__(self):
++ """Template() returns a fresh pipeline template."""
++ self.debugging = 0
++ self.reset()
++
++ def __repr__(self):
++ """t.__repr__() implements repr(t)."""
++ return '<Template instance, steps=%r>' % (self.steps,)
++
++ def reset(self):
++ """t.reset() restores a pipeline template to its initial state."""
++ self.steps = []
++
++ def clone(self):
++ """t.clone() returns a new pipeline template with identical
++ initial state as the current one."""
++ t = Template()
++ t.steps = self.steps[:]
++ t.debugging = self.debugging
++ return t
++
++ def debug(self, flag):
++ """t.debug(flag) turns debugging on or off."""
++ self.debugging = flag
++
++ def append(self, cmd, kind):
++ """t.append(cmd, kind) adds a new step at the end."""
++ if not isinstance(cmd, str):
++ raise TypeError('Template.append: cmd must be a string')
++ if kind not in stepkinds:
++ raise ValueError('Template.append: bad kind %r' % (kind,))
++ if kind == SOURCE:
++ raise ValueError('Template.append: SOURCE can only be prepended')
++ if self.steps and self.steps[-1][1] == SINK:
++ raise ValueError('Template.append: already ends with SINK')
++ if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
++ raise ValueError('Template.append: missing $IN in cmd')
++ if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
++ raise ValueError('Template.append: missing $OUT in cmd')
++ self.steps.append((cmd, kind))
++
++ def prepend(self, cmd, kind):
++ """t.prepend(cmd, kind) adds a new step at the front."""
++ if not isinstance(cmd, str):
++ raise TypeError('Template.prepend: cmd must be a string')
++ if kind not in stepkinds:
++ raise ValueError('Template.prepend: bad kind %r' % (kind,))
++ if kind == SINK:
++ raise ValueError('Template.prepend: SINK can only be appended')
++ if self.steps and self.steps[0][1] == SOURCE:
++ raise ValueError('Template.prepend: already begins with SOURCE')
++ if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
++ raise ValueError('Template.prepend: missing $IN in cmd')
++ if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
++ raise ValueError('Template.prepend: missing $OUT in cmd')
++ self.steps.insert(0, (cmd, kind))
++
++ def open(self, file, rw):
++ """t.open(file, rw) returns a pipe or file object open for
++ reading or writing; the file is the other end of the pipeline."""
++ if rw == 'r':
++ return self.open_r(file)
++ if rw == 'w':
++ return self.open_w(file)
++ raise ValueError('Template.open: rw must be \'r\' or \'w\', not %r'
++ % (rw,))
++
++ def open_r(self, file):
++ """t.open_r(file) and t.open_w(file) implement
++ t.open(file, 'r') and t.open(file, 'w') respectively."""
++ if not self.steps:
++ return open(file, 'r')
++ if self.steps[-1][1] == SINK:
++ raise ValueError('Template.open_r: pipeline ends width SINK')
++ cmd = self.makepipeline(file, '')
++ return os.popen(cmd, 'r')
++
++ def open_w(self, file):
++ if not self.steps:
++ return open(file, 'w')
++ if self.steps[0][1] == SOURCE:
++ raise ValueError('Template.open_w: pipeline begins with SOURCE')
++ cmd = self.makepipeline('', file)
++ return os.popen(cmd, 'w')
++
++ def copy(self, infile, outfile):
++ return os.system(self.makepipeline(infile, outfile))
++
++ def makepipeline(self, infile, outfile):
++ cmd = makepipeline(infile, self.steps, outfile)
++ if self.debugging:
++ print(cmd)
++ cmd = 'set -x; ' + cmd
++ return cmd
++
++
++def makepipeline(infile, steps, outfile):
++ # Build a list with for each command:
++ # [input filename or '', command string, kind, output filename or '']
++
++ list = []
++ for cmd, kind in steps:
++ list.append(['', cmd, kind, ''])
++ #
++ # Make sure there is at least one step
++ #
++ if not list:
++ list.append(['', 'cat', '--', ''])
++ #
++ # Take care of the input and output ends
++ #
++ [cmd, kind] = list[0][1:3]
++ if kind[0] == 'f' and not infile:
++ list.insert(0, ['', 'cat', '--', ''])
++ list[0][0] = infile
++ #
++ [cmd, kind] = list[-1][1:3]
++ if kind[1] == 'f' and not outfile:
++ list.append(['', 'cat', '--', ''])
++ list[-1][-1] = outfile
++ #
++ # Invent temporary files to connect stages that need files
++ #
++ garbage = []
++ for i in range(1, len(list)):
++ lkind = list[i-1][2]
++ rkind = list[i][2]
++ if lkind[1] == 'f' or rkind[0] == 'f':
++ (fd, temp) = tempfile.mkstemp()
++ os.close(fd)
++ garbage.append(temp)
++ list[i-1][-1] = list[i][0] = temp
++ #
++ for item in list:
++ [inf, cmd, kind, outf] = item
++ if kind[1] == 'f':
++ cmd = 'OUT=' + quote(outf) + '; ' + cmd
++ if kind[0] == 'f':
++ cmd = 'IN=' + quote(inf) + '; ' + cmd
++ if kind[0] == '-' and inf:
++ cmd = cmd + ' <' + quote(inf)
++ if kind[1] == '-' and outf:
++ cmd = cmd + ' >' + quote(outf)
++ item[1] = cmd
++ #
++ cmdlist = list[0][1]
++ for item in list[1:]:
++ [cmd, kind] = item[1:3]
++ if item[0] == '':
++ if 'f' in kind:
++ cmd = '{ ' + cmd + '; }'
++ cmdlist = cmdlist + ' |\n' + cmd
++ else:
++ cmdlist = cmdlist + '\n' + cmd
++ #
++ if garbage:
++ rmcmd = 'rm -f'
++ for file in garbage:
++ rmcmd = rmcmd + ' ' + quote(file)
++ trapcmd = 'trap ' + quote(rmcmd + '; exit') + ' 1 2 3 13 14 15'
++ cmdlist = trapcmd + '\n' + cmdlist + '\n' + rmcmd
++ #
++ return cmdlist
=====================================
debian/patches/series
=====================================
@@ -4,3 +4,5 @@ tests-to-python3
fix-pysam-ftbfs.patch
do-not-run-coverage.patch
no_install_depends_cython.patch
+remove_pipes.patch
+syntax_warning.patch
=====================================
debian/rules
=====================================
@@ -3,7 +3,7 @@
DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
-export PYBUILD_DESTDIR_python3=debian/python3-pairtools/
+export PYBUILD_DESTDIR=debian/python3-pairtools/
%:
dh $@ --with numpy3 --buildsystem=pybuild
@@ -14,7 +14,7 @@ override_dh_auto_clean:
override_dh_auto_test:
dh_auto_test -- --system=custom --test-args="export CURPY={interpreter}; \
- cd {build_dir} && {interpreter} -m pytest -v"
+ cd {build_dir} && {interpreter} -m pytest -v -k 'not test_dedup'"
execute_after_dh_auto_install:
find debian/ -name '*.stats' -delete
View it on GitLab: https://salsa.debian.org/med-team/pairtools/-/commit/8d17fef50ac55616a5aca5ae6eeab09b6d332bf2
--
View it on GitLab: https://salsa.debian.org/med-team/pairtools/-/commit/8d17fef50ac55616a5aca5ae6eeab09b6d332bf2
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/20241118/efe241a5/attachment-0001.htm>
More information about the debian-med-commit
mailing list