diff -Nru distlib-0.1.8/CHANGES.rst distlib-0.1.9/CHANGES.rst --- distlib-0.1.8/CHANGES.rst 2014-03-17 23:38:38.000000000 +0000 +++ distlib-0.1.9/CHANGES.rst 2014-05-19 12:19:02.000000000 +0000 @@ -2,14 +2,38 @@ -------------------------- -0.1.9 (future) +0.2.0 (future) ~~~~~~~~~~~~~~ Released: Not yet. -0.1.8 (future) -~~~~~~~~~~~~~~ +0.1.9 +~~~~~ + +Released: 2014-05-19 + +- index + + - Added ``keystore`` keyword argument to signing and verification + APIs. + +- scripts + + - Issue #47: Updated binary launchers to fix double-quoting bug where + script executable paths have spaces. + +- docs + + - Numerous documentation updates, not detailed further here. + +- tests + + - Numerous test refinements, not detailed further here. + + +0.1.8 +~~~~~ Released: 2014-03-18 diff -Nru distlib-0.1.8/debian/changelog distlib-0.1.9/debian/changelog --- distlib-0.1.8/debian/changelog 2014-03-29 01:53:03.000000000 +0000 +++ distlib-0.1.9/debian/changelog 2014-05-21 14:51:43.000000000 +0000 @@ -1,3 +1,19 @@ +distlib (0.1.9-1) unstable; urgency=medium + + * New upstream version. + + * Build a wheel package (Barry Warsaw). Closes: #748301. + - d/control: + - Added python-setuptools, python3-setuptools, python3-wheels to + Build-Depends. + - Added python-distlib-whl binary package. + - d/rules: Build the universal wheel. (Closes: #748301) + - d/patches/setuptools.diff: Patch setup.py to use + setuptools.setup() so that the bdist_wheel command will work. + - d/python-distlib-whl.install: Added. + + -- Matthias Klose Wed, 21 May 2014 12:02:04 +0100 + distlib (0.1.8-1) unstable; urgency=medium * New upstream version. diff -Nru distlib-0.1.8/debian/control distlib-0.1.9/debian/control --- distlib-0.1.8/debian/control 2013-12-31 16:07:59.000000000 +0000 +++ distlib-0.1.9/debian/control 2014-05-21 15:03:18.000000000 +0000 @@ -2,7 +2,8 @@ Section: python Priority: optional Maintainer: Matthias Klose -Build-Depends: debhelper (>= 9), python-all, python3-all, dh-python +Build-Depends: debhelper (>= 9), python-all, python3-all, dh-python, + python-setuptools, python3-setuptools, python3-wheel Standards-Version: 3.9.5 Homepage: https://pypi.python.org/pypi/distlib @@ -21,3 +22,13 @@ Distlib is a library which implements low-level functions that relate to packaging and distribution of Python software. It is intended to be used as the basis for third-party packaging tools. + +Package: python-distlib-whl +Architecture: all +Depends: ${python3:Depends}, ${misc:Depends} +Description: low-level components of python distutils2/packaging + Distlib is a library which implements low-level functions that relate to + packaging and distribution of Python software. It is intended to be used + as the basis for third-party packaging tools. + . + This package provides the universal wheel. diff -Nru distlib-0.1.8/debian/patches/series distlib-0.1.9/debian/patches/series --- distlib-0.1.8/debian/patches/series 2013-12-31 15:37:33.000000000 +0000 +++ distlib-0.1.9/debian/patches/series 2014-05-21 14:53:41.000000000 +0000 @@ -1 +1,2 @@ no-binaries.diff +setuptools.diff diff -Nru distlib-0.1.8/debian/patches/setuptools.diff distlib-0.1.9/debian/patches/setuptools.diff --- distlib-0.1.8/debian/patches/setuptools.diff 1970-01-01 00:00:00.000000000 +0000 +++ distlib-0.1.9/debian/patches/setuptools.diff 2014-05-21 14:53:41.000000000 +0000 @@ -0,0 +1,23 @@ +Description: Use setuptools.setup() in order to allow the bdist_wheel command. +Author: Barry Warsaw +Forwarded: not-needed + +--- a/setup.py ++++ b/setup.py +@@ -5,6 +5,7 @@ + # See LICENSE.txt and CONTRIBUTORS.txt. + # + ++import setuptools + import distutils.core + from distutils.sysconfig import get_python_lib + from os.path import join, dirname, abspath +@@ -31,7 +32,7 @@ + def finalize_options(self): + pass + +-distutils.core.setup( ++setuptools.setup( + name='distlib', + version=distlib.__version__, + author='Vinay Sajip', diff -Nru distlib-0.1.8/debian/python-distlib-whl.install distlib-0.1.9/debian/python-distlib-whl.install --- distlib-0.1.8/debian/python-distlib-whl.install 1970-01-01 00:00:00.000000000 +0000 +++ distlib-0.1.9/debian/python-distlib-whl.install 2014-05-21 14:53:41.000000000 +0000 @@ -0,0 +1 @@ +usr/share/python-wheels diff -Nru distlib-0.1.8/debian/rules distlib-0.1.9/debian/rules --- distlib-0.1.8/debian/rules 2013-12-31 15:41:55.000000000 +0000 +++ distlib-0.1.9/debian/rules 2014-05-21 14:53:41.000000000 +0000 @@ -6,3 +6,9 @@ %: dh $@ --with python2,python3 --buildsystem=pybuild + +override_dh_auto_install: + dh_auto_install + python3 setup.py bdist_wheel \ + --universal \ + -d $(CURDIR)/debian/tmp/usr/share/python-wheels diff -Nru distlib-0.1.8/distlib/index.py distlib-0.1.9/distlib/index.py --- distlib-0.1.8/distlib/index.py 2014-02-18 19:26:26.000000000 +0000 +++ distlib-0.1.9/distlib/index.py 2014-03-28 17:31:54.000000000 +0000 @@ -148,7 +148,8 @@ logger.debug('%s: %s' % (name, s)) stream.close() - def get_sign_command(self, filename, signer, sign_password): + def get_sign_command(self, filename, signer, sign_password, + keystore=None): """ Return a suitable command for signing a file. @@ -156,12 +157,17 @@ :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. + :param keystore: The path to a directory which contains the keys + used in verification. If not specified, the + instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. """ cmd = [self.gpg, '--status-fd', '2', '--no-tty'] - if self.gpg_home: - cmd.extend(['--homedir', self.gpg_home]) + if keystore is None: + keystore = self.gpg_home + if keystore: + cmd.extend(['--homedir', keystore]) if sign_password is not None: cmd.extend(['--batch', '--passphrase-fd', '0']) td = tempfile.mkdtemp() @@ -206,7 +212,7 @@ t2.join() return p.returncode, stdout, stderr - def sign_file(self, filename, signer, sign_password): + def sign_file(self, filename, signer, sign_password, keystore=None): """ Sign a file. @@ -214,10 +220,14 @@ :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. + :param keystore: The path to a directory which contains the keys + used in signing. If not specified, the instance's + ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. """ - cmd, sig_file = self.get_sign_command(filename, signer, sign_password) + cmd, sig_file = self.get_sign_command(filename, signer, sign_password, + keystore) rc, stdout, stderr = self.run_command(cmd, sign_password.encode('utf-8')) if rc != 0: @@ -226,7 +236,7 @@ return sig_file def upload_file(self, metadata, filename, signer=None, sign_password=None, - filetype='sdist', pyversion='source'): + filetype='sdist', pyversion='source', keystore=None): """ Upload a release file to the index. @@ -242,6 +252,9 @@ :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. + :param keystore: The path to a directory which contains the keys + used in signing. If not specified, the instance's + ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. """ @@ -255,7 +268,8 @@ if not self.gpg: logger.warning('no signing program available - not signed') else: - sig_file = self.sign_file(filename, signer, sign_password) + sig_file = self.sign_file(filename, signer, sign_password, + keystore) with open(filename, 'rb') as f: file_data = f.read() md5_digest = hashlib.md5(file_data).hexdigest() @@ -306,7 +320,8 @@ request = self.encode_request(fields, files) return self.send_request(request) - def get_verify_command(self, signature_filename, data_filename): + def get_verify_command(self, signature_filename, data_filename, + keystore=None): """ Return a suitable command for verifying a file. @@ -314,17 +329,23 @@ signature. :param data_filename: The pathname to the file containing the signed data. + :param keystore: The path to a directory which contains the keys + used in verification. If not specified, the + instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. """ cmd = [self.gpg, '--status-fd', '2', '--no-tty'] - if self.gpg_home: - cmd.extend(['--homedir', self.gpg_home]) + if keystore is None: + keystore = self.gpg_home + if keystore: + cmd.extend(['--homedir', keystore]) cmd.extend(['--verify', signature_filename, data_filename]) logger.debug('invoking: %s', ' '.join(cmd)) return cmd - def verify_signature(self, signature_filename, data_filename): + def verify_signature(self, signature_filename, data_filename, + keystore=None): """ Verify a signature for a file. @@ -332,12 +353,16 @@ signature. :param data_filename: The pathname to the file containing the signed data. + :param keystore: The path to a directory which contains the keys + used in verification. If not specified, the + instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. """ if not self.gpg: raise DistlibException('verification unavailable because gpg ' 'unavailable') - cmd = self.get_verify_command(signature_filename, data_filename) + cmd = self.get_verify_command(signature_filename, data_filename, + keystore) rc, stdout, stderr = self.run_command(cmd) if rc not in (0, 1): raise DistlibException('verify command failed with error ' diff -Nru distlib-0.1.8/distlib/__init__.py distlib-0.1.9/distlib/__init__.py --- distlib-0.1.8/distlib/__init__.py 2014-03-17 23:31:20.000000000 +0000 +++ distlib-0.1.9/distlib/__init__.py 2014-05-19 10:06:20.000000000 +0000 @@ -6,7 +6,7 @@ # import logging -__version__ = '0.1.8' +__version__ = '0.1.9' class DistlibException(Exception): pass diff -Nru distlib-0.1.8/distlib/wheel.py distlib-0.1.9/distlib/wheel.py --- distlib-0.1.8/distlib/wheel.py 2014-03-17 23:28:00.000000000 +0000 +++ distlib-0.1.9/distlib/wheel.py 2014-05-16 20:37:12.000000000 +0000 @@ -383,7 +383,7 @@ # Now distinfo. Assumed to be flat, i.e. os.listdir is enough. files = os.listdir(distinfo) for fn in files: - if fn not in ('RECORD', 'INSTALLER', 'SHARED'): + if fn not in ('RECORD', 'INSTALLER', 'SHARED', 'WHEEL'): p = fsdecode(os.path.join(distinfo, fn)) ap = to_posix(os.path.join(info_dir, fn)) archive_paths.append((ap, p)) diff -Nru distlib-0.1.8/PKG-INFO distlib-0.1.9/PKG-INFO --- distlib-0.1.8/PKG-INFO 2014-03-18 00:26:02.000000000 +0000 +++ distlib-0.1.9/PKG-INFO 2014-05-19 12:21:24.000000000 +0000 @@ -1,12 +1,12 @@ Metadata-Version: 1.0 Name: distlib -Version: 0.1.8 +Version: 0.1.9 Summary: Distribution utilities Home-page: https://bitbucket.org/vinay.sajip/distlib Author: Vinay Sajip Author-email: vinay_sajip@red-dove.com License: BSD -Download-URL: https://bitbucket.org/vinay.sajip/distlib/downloads/distlib-0.1.8.zip +Download-URL: https://bitbucket.org/vinay.sajip/distlib/downloads/distlib-0.1.9.zip Description: Low-level components of distutils2/packaging, augmented with higher-level APIs for making packaging easier. Platform: any Classifier: Development Status :: 3 - Alpha diff -Nru distlib-0.1.8/tests/test_util.py distlib-0.1.9/tests/test_util.py --- distlib-0.1.8/tests/test_util.py 2014-02-15 19:55:22.000000000 +0000 +++ distlib-0.1.9/tests/test_util.py 2014-05-19 10:10:08.000000000 +0000 @@ -342,13 +342,32 @@ self.assertEqual(expected[-1], actual[-1]) self.assertEqual(set(expected[1:-1]), set(actual[1:-1])) actual = seq.strong_connections - expected = [ - ('test',), ('upload_bdist',), ('install',), ('install_distinfo',), - ('install_data',), ('install_scripts',), ('install_lib',), - ('install_headers',), ('build',), ('build_scripts',), - ('build_py',), ('build_ext',), ('build_clibs',), ('upload_sdist',), - ('sdist',), ('register',), ('check',)] - self.assertEqual(actual, expected) + expected = ( + [ + ('test',), ('upload_bdist',), ('install',), + ('install_distinfo',), ('install_data',), ('install_scripts',), + ('install_lib',), ('install_headers',), ('build',), + ('build_scripts',), ('build_py',), ('build_ext',), + ('build_clibs',), ('upload_sdist',), ('sdist',), ('register',), + ('check',) + ], + [ + ('install',), ('install_distinfo',), ('install_data',), + ('install_scripts',), ('install_lib',), ('install_headers',), + ('test',), ('upload_bdist',), ('build',), ('build_scripts',), + ('build_py',), ('build_ext',), ('build_clibs',), + ('upload_sdist',), ('sdist',), ('register',), ('check',) + ], + [ + ('upload_sdist',), ('sdist',), ('install',), + ('install_distinfo',), ('install_data',), ('upload_bdist',), + ('register',), ('install_scripts',), ('install_lib',), + ('install_headers',), ('test',), ('build',), + ('build_scripts',), ('build_py',), ('build_ext',), + ('build_clibs',), ('check',) + ] + ) + self.assertIn(actual, expected) def test_sequencer_cycle(self): seq = Sequencer()