Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Please unblock package python3-defaults First, apologies for this late unblock request. I'd been focused on getting python2.7/python-defaults updated and thought one of my co-maintainers had taken care of this already. Changelog below is annotated with why I think this should be unblocked. python3-defaults (3.2.3-6) unstable; urgency=low [ Piotr Ożarowski ] * dh_python3 - ignore empty files while trying to normalize shebangs This fixed build failures, so there are likely packages that built since this was uploaded to Sid that won't build in Wheezy. - mention the right file (debian/py3dist-overrides) while warning about guessed dependency - thanks to Sebastian Ramacher for the patch (Closes: #685067) Trivial documentation fix. Not critical, but good to have and certainly not worth a TPU upload to avoid. - fix generating dependencies when maximum version is specified (Closes: #687060) This fixed build failures, so there are likely packages that built since this was uploaded to Sid that won't build in Wheezy. * py3versions.py: fix parsing DEBPYTHON3_SUPPORTED env. variable (versions should be separated using comma, as in debian_defaults config file) This is similar to the change that was just part of the python-defaults unblock. It's here for tests. There are packages that use the env variable, but all maintained by p1otr and he'd checked they work with this change. To stay in line with the way pyversions.py will work in Wheezy, this should go in. * py3versions, debpython: close previously opened files - thanks to Dmitry Shachnev for the patch (Closes: #686587) This is a bug. Not critical, but not worth a TPU upload to avoid. [ Dmitry Shachnev ] [ Barry Warsaw ] * py3clean: Don't remove everything in the __pycache__ directory for system site package directories. Prevents bogus cleaning of unrelated *.pyc files. Original patch by Dmitry, with review, clean up, small modifications, and additional comments by Barry. (Closes: #685167) This is a significant bug that should be fixed. [ Barry Warsaw ] * dh_python3: Rework calculation of extension tags to add support for Python 3.3's different suffixes, and to allow for unadorned .so files to assume they are built with the default Python 3 version. Closes: 672178 This is not essential for Wheezy, but will make working with python3.3 much easier for people that want to do it. I think it's worth making the change to make Wheezy a better platform for Python 3 development. * README.derivatives: It is no longer necessary to edit debian/py3versions.py since the values are taken from debian_defaults. Also added some text on how to separate the specification when multiple versions are supported. * Makefile: Fix the nosetests3 command. Closes: 690259 These don't directly impact the way the package works and are nice to have. Not worth uploading to TPU to avoid. -- Piotr Ożarowski <pi...@debian.org> Sun, 21 Oct 2012 21:29:45 +0200 This has been in Sid for several months without issue. At this point the risks of not including it (because packages have built against it) is, in my opinion, greater than the risk of including it. unblock python3-defaults/3.2.3-6
diff -Nru python3-defaults-3.2.3/debian/changelog python3-defaults-3.2.3/debian/changelog --- python3-defaults-3.2.3/debian/changelog 2012-08-02 17:54:48.000000000 -0400 +++ python3-defaults-3.2.3/debian/changelog 2012-10-21 15:29:47.000000000 -0400 @@ -1,3 +1,39 @@ +python3-defaults (3.2.3-6) unstable; urgency=low + + [ Piotr Ożarowski ] + * dh_python3 + - ignore empty files while trying to normalize shebangs + - mention the right file (debian/py3dist-overrides) while warning about + guessed dependency - thanks to Sebastian Ramacher for the patch + (Closes: #685067) + - fix generating dependencies when maximum version is specified + (Closes: #687060) + * py3versions.py: fix parsing DEBPYTHON3_SUPPORTED env. variable + (versions should be separated using comma, as in debian_defaults + config file) + * py3versions, debpython: close previously opened files - thanks to Dmitry + Shachnev for the patch (Closes: #686587) + + [ Dmitry Shachnev ] + [ Barry Warsaw ] + * py3clean: Don't remove everything in the __pycache__ directory for + system site package directories. Prevents bogus cleaning of unrelated + *.pyc files. Original patch by Dmitry, with review, clean up, small + modifications, and additional comments by Barry. (Closes: #685167) + + [ Barry Warsaw ] + * dh_python3: Rework calculation of extension tags to add support for + Python 3.3's different suffixes, and to allow for unadorned .so files + to assume they are built with the default Python 3 version. + Closes: 672178 + * README.derivatives: It is no longer necessary to edit + debian/py3versions.py since the values are taken from + debian_defaults. Also added some text on how to separate the + specification when multiple versions are supported. + * Makefile: Fix the nosetests3 command. Closes: 690259 + + -- Piotr Ożarowski <pi...@debian.org> Sun, 21 Oct 2012 21:29:45 +0200 + python3-defaults (3.2.3-5) unstable; urgency=low * dh_python3: diff -Nru python3-defaults-3.2.3/debian/py3versions.py python3-defaults-3.2.3/debian/py3versions.py --- python3-defaults-3.2.3/debian/py3versions.py 2012-06-30 11:05:51.000000000 -0400 +++ python3-defaults-3.2.3/debian/py3versions.py 2012-10-21 15:24:45.000000000 -0400 @@ -92,8 +92,9 @@ else: return _unsupported_versions -_supported_versions = ["python%s" % ver for ver in \ - os.environ.get('DEBPYTHON3_SUPPORTED', '').split()] +_supported_versions = ["python%s" % ver.strip() for ver in + os.environ.get('DEBPYTHON3_SUPPORTED', '').split(',') + if ver.strip()] def supported_versions(version_only=False): global _supported_versions if not _supported_versions: @@ -179,8 +180,9 @@ version = None sversion = None section = None - for line in open(fn, encoding='utf-8'): - line = line.strip() + with open(fn, encoding='utf-8') as controlfile: + lines = [line.strip() for line in controlfile] + for line in lines: if line == '': if pkg == 'Source': break diff -Nru python3-defaults-3.2.3/debpython/debhelper.py python3-defaults-3.2.3/debpython/debhelper.py --- python3-defaults-3.2.3/debpython/debhelper.py 2012-08-02 17:41:17.000000000 -0400 +++ python3-defaults-3.2.3/debpython/debhelper.py 2012-10-13 10:14:30.000000000 -0400 @@ -102,7 +102,8 @@ for when, templates in autoscripts.items(): fn = "debian/%s.%s.debhelper" % (package, when) if exists(fn): - data = open(fn, 'r').read() + with open(fn, 'r') as datafile: + data = datafile.read() else: data = '' @@ -114,7 +115,8 @@ "autoscripts/%s" % tpl_name) if not exists(fpath): fpath = "/usr/share/debhelper/autoscripts/%s" % tpl_name - tpl = open(fpath, 'r').read() + with open(fpath, 'r') as tplfile: + tpl = tplfile.read() if self.options.compile_all and args: # TODO: should args be checked to contain dir name? tpl = tpl.replace('#PACKAGE#', '') @@ -137,7 +139,8 @@ continue fn = "debian/%s.substvars" % package if exists(fn): - data = open(fn, 'r').read() + with open(fn, 'r') as datafile: + data = datafile.read() else: data = '' for name, values in substvars.items(): diff -Nru python3-defaults-3.2.3/debpython/depends.py python3-defaults-3.2.3/debpython/depends.py --- python3-defaults-3.2.3/debpython/depends.py 2012-07-12 18:41:16.000000000 -0400 +++ python3-defaults-3.2.3/debpython/depends.py 2012-10-14 18:02:59.000000000 -0400 @@ -20,7 +20,7 @@ import logging from debpython.pydist import parse_pydep, guess_dependency -from debpython.version import DEFAULT, SUPPORTED, getver, vrepr, vrange_str +from debpython.version import DEFAULT, SUPPORTED, vrepr, vrange_str # minimum version required for py3compile/py3clean: MINPYCDEP = 'python3 (>= 3.2.3-3~)' @@ -86,35 +86,35 @@ def parse(self, stats, options): log.debug('generating dependencies for package %s', self.package) - - if options.vrange: - maxv = None - dbgpkg = self.package.endswith('-dbg') - tpl = 'python3-dbg' if dbgpkg else 'python3' - # additional Depends to block python3 package transitions - minv = options.vrange[0] - if len(options.vrange) > 1: - maxv = options.vrange[-1] + dbgpkg = self.package.endswith('-dbg') + tpl = 'python3-dbg' if dbgpkg else 'python3' + vtpl = 'python%d.%d-dbg' if dbgpkg else 'python%d.%d' + vrange = options.vrange + + if vrange and vrange != (None, None): + minv = vrange[0] + maxv = vrange[1] # note it's an open interval (i.e. do not add 1 here!) + if minv == maxv: + self.depend(vtpl % minv) + minv = maxv = None if minv: - self.depend("%s (>= %d.%d)" % \ + self.depend("%s (>= %d.%d)" % (tpl, minv[0], minv[1])) if maxv: - self.depend("%s (<< %d.%d)" % \ + self.depend("%s (<< %d.%d)" % (tpl, maxv[0], maxv[1])) if stats['ext']: # TODO: what about extensions with stable ABI? - dbgpkg = self.package.endswith('-dbg') - tpl = 'python3-dbg' if dbgpkg else 'python3' - # additional Depends to block python3 package transitions sorted_vers = sorted(stats['ext']) minv = sorted_vers[0] maxv = sorted_vers[-1] + #self.depend('|'.join(vtpl % i for i in stats['ext'])) if minv <= DEFAULT: - self.depend("%s (>= %d.%d)" % \ + self.depend("%s (>= %d.%d)" % (tpl, minv[0], minv[1])) if maxv >= DEFAULT: - self.depend("%s (<< %d.%d)" % \ + self.depend("%s (<< %d.%d)" % (tpl, maxv[0], maxv[1] + 1)) # make sure py3compile binary is available @@ -129,33 +129,39 @@ for v in versions: if v in SUPPORTED: - self.depend("python%d.%d" % v) + self.depend(vtpl % v) else: log.info('dependency on python%s (from shebang) ignored' ' - it\'s not supported anymore', vrepr(v)) # /usr/bin/python3 shebang → add python3 to Depends if any(True for i, v in details.get('shebangs', []) if v is None): - self.depend('python3') + self.depend(tpl) - if details.get('compile', False): + if details.get('compile'): self.depend(MINPYCDEP) args = '' - if details.get('ext', False): - # use smallest and largest version to set range + if details.get('ext'): extensions = sorted(details['ext']) - vr = (extensions[0], extensions[-1]) - else: # no extension - vr = options.vrange - if vr: - args += "-V %s" % vrange_str(vr) - if details.get('ext', False): - self.depend('|'.join("python%s" %\ - vrepr(i) for i in details['ext'])) - else: # pure modules only - if vr[0]: # minimum version specified - self.depend("python3 (>= %s)" % vrepr(vr[0])) - if vr[1]: # maximum version specified - self.depend("python3 (<< %s)" % vrepr(vr[1] + 1)) + #self.depend('|'.join(vtpl % i for i in extensions)) + args += "-V %s" % vrange_str((extensions[0], extensions[-1])) + if len(extensions) == 1: + self.depend(vtpl % extensions[0]) + else: + self.depend("%s (>= %d.%d)" % (tpl, extensions[0][0], + extensions[0][1])) + self.depend("%s (<< %d.%d)" % (tpl, + extensions[-1][0], extensions[-1][1] + 1)) + elif vrange and vrange != (None, None): + args += "-V %s" % vrange_str(vrange) + if vrange[0] == vrange[1]: + self.depend("python%d.%d" % vrange[0]) + else: + if vrange[0]: # minimum version specified + self.depend("python3 (>= %s)" % vrepr(vrange[0])) + if vrange[1]: # maximum version specified + self.depend("python3 (<< %s)" % + vrepr((vrange[1][0], + int(vrange[1][1]) + 1))) for pattern in options.regexpr or []: args += " -X '%s'" % pattern.replace("'", r"'\''") diff -Nru python3-defaults-3.2.3/debpython/pydist.py python3-defaults-3.2.3/debpython/pydist.py --- python3-defaults-3.2.3/debpython/pydist.py 2012-06-30 15:24:06.000000000 -0400 +++ python3-defaults-3.2.3/debpython/pydist.py 2012-10-13 10:02:27.000000000 -0400 @@ -168,7 +168,7 @@ pname = sensible_pname(name) log.warn('Cannot find installed package that provides %s. ' 'Using %s as package name. Please add "%s correct_package_name" ' - 'line to debian/pydist-overrides to override it if this is incorrect.', + 'line to debian/py3dist-overrides to override it if this is incorrect.', name, pname, safe_name(name)) return pname diff -Nru python3-defaults-3.2.3/debpython/tools.py python3-defaults-3.2.3/debpython/tools.py --- python3-defaults-3.2.3/debpython/tools.py 2012-08-02 17:21:19.000000000 -0400 +++ python3-defaults-3.2.3/debpython/tools.py 2012-09-05 18:07:22.000000000 -0400 @@ -99,6 +99,9 @@ try: with open(fpath, 'rb') as fp: fcontent = fp.readlines() + if not fcontent: + log.info('fix_shebang: ignoring empty file: %s', fpath) + return None try: first_line = str(fcontent[0], 'utf8') except UnicodeDecodeError: diff -Nru python3-defaults-3.2.3/debpython/version.py python3-defaults-3.2.3/debpython/version.py --- python3-defaults-3.2.3/debpython/version.py 2012-06-30 12:00:32.000000000 -0400 +++ python3-defaults-3.2.3/debpython/version.py 2012-10-14 15:33:09.000000000 -0400 @@ -26,6 +26,8 @@ from configparser import ConfigParser from types import GeneratorType +# TODO: class Version; Version.next + # will be overriden via debian_defaults file few lines later SUPPORTED = [(3, 2)] DEFAULT = (3, 2) diff -Nru python3-defaults-3.2.3/dh_python3 python3-defaults-3.2.3/dh_python3 --- python3-defaults-3.2.3/dh_python3 2012-06-30 14:57:12.000000000 -0400 +++ python3-defaults-3.2.3/dh_python3 2012-10-21 15:15:24.000000000 -0400 @@ -47,9 +47,17 @@ log = logging.getLogger(__name__) os.umask(0o22) -# tag that will be added to .so files without one -EXTENSION_TAG = 'cpython-%smu' -DBG_EXTENSION_TAG = 'cpython-%sdmu' +# Tag that will be added to .so files without one. Because these values are +# different between versions of Python 3 (e.g. 3.2 has dmu but 3.3 only has +# dm), this maps vrepr()'s to extension templates. +EXTENSION_TAGS = { + '3.2': 'cpython-%smu', + '3.3': 'cpython-%sm', + } +DBG_EXTENSION_TAGS = { + '3.2': 'cpython-%sdmu', + '3.3': 'cpython-%sdm', + } TAG_RE = re.compile(r'-([0-9]{2})[^-.]*\.so$') # naming conventions used in the file: @@ -132,17 +140,24 @@ ### PACKAGE DETAILS ############################################ def tagged_extname(fname, version, dbg_package=False): """Return tagged extension name for given file & version.""" - vers = vrepr(version) # make sure it's a string - vers = vers.replace('.', '') + extkey = vrepr(version) # make sure it's a string + vers = extkey.replace('.', '') if vers == '3': - # assume .so files without tag in /usr/lib/python3/ are build for Python 3.2 - vers = '32' + # Assume that .so files without tags in /usr/lib/python3 are built for + # the default Python 3 version. + extkey = '.'.join(str(digit) for digit in DEFAULT) + vers = extkey.replace('.', '') + try: + ext_tag = EXTENSION_TAGS[extkey] + dbg_tag = DBG_EXTENSION_TAGS[extkey] + except KeyError: + raise ValueError('No known tag for Python version {}'.format(extkey)) if fname.endswith('_d.so'): - fname = "%s.%s.so" % (fname[:-5], DBG_EXTENSION_TAG % vers) + fname = "%s.%s.so" % (fname[:-5], dbg_tag % vers) elif dbg_package: - fname = "%s.%s.so" % (fname[:-3], DBG_EXTENSION_TAG % vers) + fname = "%s.%s.so" % (fname[:-3], dbg_tag % vers) else: - fname = "%s.%s.so" % (fname[:-3], EXTENSION_TAG % vers) + fname = "%s.%s.so" % (fname[:-3], ext_tag % vers) return fname diff -Nru python3-defaults-3.2.3/Makefile python3-defaults-3.2.3/Makefile --- python3-defaults-3.2.3/Makefile 2012-06-30 15:32:33.000000000 -0400 +++ python3-defaults-3.2.3/Makefile 2012-10-13 07:58:20.000000000 -0400 @@ -35,7 +35,7 @@ # TESTS nose: - nosetests-3 --with-doctest --with-coverage + nosetests3 --with-doctest --with-coverage tests: nose make -C tests diff -Nru python3-defaults-3.2.3/py3clean python3-defaults-3.2.3/py3clean --- python3-defaults-3.2.3/py3clean 2012-07-13 00:50:51.000000000 -0400 +++ python3-defaults-3.2.3/py3clean 2012-09-19 18:11:02.000000000 -0400 @@ -24,9 +24,10 @@ import logging import optparse import sys +# glob1() is not in the public documentation, UTSL. from glob import glob1 from os import environ, remove, rmdir -from os.path import dirname, exists, join +from os.path import dirname, basename, exists, join, splitext sys.path.insert(1, '/usr/share/python3/') from debpython import files as dpf from debpython.version import SUPPORTED, getver, vrepr @@ -72,16 +73,23 @@ def destroyer(magic_tag=None): # ;-) """Remove every .py[co] file associated to received .py file. - :param magic_tag: if None, removes __pycache__ directories, - if False, removes python3.1's .pyc files only, - otherwise removes given magic tag from __pycache__ directory - :type magic_tag: None or False or str""" + :param magic_tag: + * If None, removes all associated .py[co] files from __pycache__ + directory. If the resulting directory is empty, and is not a system + site package, then the directory is also removed. + * If False, removes python3.1's .pyc files only + * Otherwise removes given magic tag from __pycache__ directory. If + the resulting directory is empty, and is not a system site package, + then the directory is also removed. + :type magic_tag: None or False or str + """ if magic_tag is None: - # remove all files in __pycache__ directory + # remove compiled files in __pycache__ directory def find_files_to_remove(pyfile): - directory = "%s/__pycache__/" % dirname(pyfile) - for fn in glob1(directory, '*'): + directory = join(dirname(pyfile), '__pycache__') + fnames = "%s.*" % splitext(basename(pyfile))[0] + for fn in glob1(directory, fnames): yield join(directory, fn) # remove "classic" .pyc files as well for filename in ("%sc" % pyfile, "%so" % pyfile): @@ -98,8 +106,9 @@ # remove .pyc files for no longer needed magic tags def find_files_to_remove(pyfile): - directory = "%s/__pycache__/" % dirname(pyfile) - for fn in glob1(directory, "*.%s.py[co]" % magic_tag): + directory = join(dirname(pyfile), '__pycache__') + fname = splitext(basename(pyfile))[0] + for fn in glob1(directory, "%s.%s.py[co]" % (fname, magic_tag)): yield join(directory, fn) def myremove(fname): diff -Nru python3-defaults-3.2.3/pydist/dist_fallback python3-defaults-3.2.3/pydist/dist_fallback --- python3-defaults-3.2.3/pydist/dist_fallback 2012-01-09 16:44:09.000000000 -0500 +++ python3-defaults-3.2.3/pydist/dist_fallback 2012-10-14 18:24:25.000000000 -0400 @@ -1,5 +1,21 @@ setuptools python3-pkg-resources +PyStemmer python3-stemmer PyYAML python3-yaml +beautifulsoup4 python3-bs4 +bpython bpython3 +dkimpy python3-dkim +dnspython3 python3-dnspython +ipython ipython3 +pyOpenSSL python3-openssl py_postgresql python3-postgresql +pycrypto python3-crypto pydns python3-dns +pyenchant python3-enchant +pyepr python3-epr +pyserial python3-serial +pyspf python3-spf python3_libgearman python3-gearman.libgearman +pytz python3-tz +pyzmq python3-zmq +shatag shatag +zeroinstall_injector zeroinstall-injector diff -Nru python3-defaults-3.2.3/README.derivatives python3-defaults-3.2.3/README.derivatives --- python3-defaults-3.2.3/README.derivatives 2012-01-09 16:44:09.000000000 -0500 +++ python3-defaults-3.2.3/README.derivatives 2012-10-13 07:58:20.000000000 -0400 @@ -1,7 +1,8 @@ How to change a list of supported Python versions? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* Open debian/debian_defaults file and change `supported-versions` variable +* Open debian/debian_defaults file and change `supported-versions` variable, + separating multiple values by comma * Open debian/control.in file and edit python3-all, python3-all-dev and python3-all-dbg's Depends line (add or remove pythonX.Y packages) * Open debpython/versions.py file and edit `SUPPORTED` list around @@ -14,8 +15,6 @@ * Open debian/debian_defaults file and change `default-version` variable * Open debian/rules file and edit `VER` variable (default version), `NVER` (default + 1 version) and `PVER` (default version with "python" prefix) -* Open debian/py3versions.py file and edit `debian_default` variable around - line 171 * Open debpython/versions.py file and edit `DEFAULT` variable around line 27 diff -Nru python3-defaults-3.2.3/tests/common.mk python3-defaults-3.2.3/tests/common.mk --- python3-defaults-3.2.3/tests/common.mk 2012-06-30 11:39:06.000000000 -0400 +++ python3-defaults-3.2.3/tests/common.mk 2012-10-21 17:47:42.000000000 -0400 @@ -1,7 +1,7 @@ #!/usr/bin/make -f export DEBPYTHON3_DEFAULT ?= $(shell sed -rne 's,^default-version = python(.*),\1,p' ../../debian/debian_defaults) -export DEBPYTHON3_SUPPORTED ?= $(shell sed -rne '/^supported-versions/{s/^supported-versions = (.*)/\1/g;s/python//g;s/,//g;p}' ../../debian/debian_defaults) +export DEBPYTHON3_SUPPORTED ?= $(shell sed -rne '/^supported-versions/{s/^supported-versions = (.*)/\1/g;s/python//g}' ../../debian/debian_defaults) all: run check diff -Nru python3-defaults-3.2.3/tests/t1/debian/control python3-defaults-3.2.3/tests/t1/debian/control --- python3-defaults-3.2.3/tests/t1/debian/control 2012-01-09 16:44:09.000000000 -0500 +++ python3-defaults-3.2.3/tests/t1/debian/control 2012-10-14 17:37:25.000000000 -0400 @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python-all Standards-Version: 3.9.0 -X-Python3-Version: >= 3.1 +X-Python3-Version: >= 3.1, << 3.4 Package: python3-foo Architecture: all diff -Nru python3-defaults-3.2.3/tests/t1/Makefile python3-defaults-3.2.3/tests/t1/Makefile --- python3-defaults-3.2.3/tests/t1/Makefile 2012-01-09 16:44:09.000000000 -0500 +++ python3-defaults-3.2.3/tests/t1/Makefile 2012-10-14 15:09:30.000000000 -0400 @@ -7,6 +7,7 @@ dpkg-buildpackage -b -us -uc check: + grep -q "Depends: .*python3 (<< 3.4)" debian/python3-foo/DEBIAN/control grep -q "Recommends: .*python3-mako" debian/python3-foo/DEBIAN/control test -f debian/python3-foo/usr/lib/python3/dist-packages/foo/__init__.py test ! -f debian/python3-foo/usr/lib/python3/dist-packages/foo/spam.py