diff -Nru python-setuptools-18.3.1/CHANGES.txt python-setuptools-18.4/CHANGES.txt --- python-setuptools-18.3.1/CHANGES.txt 2015-09-07 06:22:42.000000000 +0000 +++ python-setuptools-18.4/CHANGES.txt 2015-10-11 00:43:14.000000000 +0000 @@ -2,6 +2,20 @@ CHANGES ======= +---- +18.4 +---- + +* Issue #446: Test command now always invokes unittest, even + if no test suite is supplied. + +------ +18.3.2 +------ + +* Correct another regression in setuptools.findall + where the fix for Python #12885 was lost. + ------ 18.3.1 ------ @@ -26,6 +40,9 @@ * Issue #257: ``easy_install --version`` now shows more detail about the installation location and Python version. +* Refactor setuptools.findall in preparation for re-submission + back to distutils. + ---- 18.2 ---- diff -Nru python-setuptools-18.3.1/debian/changelog python-setuptools-18.4/debian/changelog --- python-setuptools-18.3.1/debian/changelog 2015-09-16 22:58:26.000000000 +0000 +++ python-setuptools-18.4/debian/changelog 2015-10-11 21:58:46.000000000 +0000 @@ -1,8 +1,15 @@ -python-setuptools (18.3.1-2~cloud0) trusty-liberty; urgency=medium +python-setuptools (18.4-1~cloud0) trusty-liberty; urgency=medium * New upstream release for the Ubuntu Cloud Archive. - -- Openstack Ubuntu Testing Bot Wed, 16 Sep 2015 22:58:26 +0000 + -- Openstack Ubuntu Testing Bot Sun, 11 Oct 2015 21:58:46 +0000 + +python-setuptools (18.4-1) unstable; urgency=medium + + * New upstream version. + * Provide a unified entry_points.txt file. + + -- Matthias Klose Sun, 11 Oct 2015 13:06:42 +0200 python-setuptools (18.3.1-2) unstable; urgency=medium diff -Nru python-setuptools-18.3.1/debian/patches/install-layout.diff python-setuptools-18.4/debian/patches/install-layout.diff --- python-setuptools-18.3.1/debian/patches/install-layout.diff 2015-08-03 12:22:39.000000000 +0000 +++ python-setuptools-18.4/debian/patches/install-layout.diff 2015-10-11 11:52:49.000000000 +0000 @@ -30,7 +30,7 @@ # Always read easy_install options, even if we are subclassed, or have # an independent instance created. This ensures that defaults will # always come from the standard configuration file(s)' "easy_install" -@@ -247,6 +253,10 @@ class easy_install(Command): +@@ -256,6 +262,10 @@ class easy_install(Command): self.expand_basedirs() self.expand_dirs() @@ -41,7 +41,7 @@ self._expand('install_dir', 'script_dir', 'build_directory', 'site_dirs') # If a non-default installation directory was specified, default the -@@ -271,6 +281,15 @@ class easy_install(Command): +@@ -280,6 +290,15 @@ class easy_install(Command): if self.user and self.install_purelib: self.install_dir = self.install_purelib self.script_dir = self.install_scripts @@ -57,7 +57,7 @@ # default --record from the install command self.set_undefined_options('install', ('record', 'record')) # Should this be moved to the if statement below? It's not used -@@ -1266,11 +1285,28 @@ class easy_install(Command): +@@ -1275,11 +1294,28 @@ class easy_install(Command): self.debug_print("os.makedirs('%s', 0o700)" % path) os.makedirs(path, 0o700) @@ -86,7 +86,7 @@ ) DEFAULT_SCHEME = dict( -@@ -1281,11 +1317,18 @@ class easy_install(Command): +@@ -1290,11 +1326,18 @@ class easy_install(Command): def _expand(self, *attrs): config_vars = self.get_finalized_command('install').config_vars @@ -107,7 +107,7 @@ for attr, val in scheme.items(): if getattr(self, attr, None) is None: setattr(self, attr, val) -@@ -1319,9 +1362,14 @@ def get_site_dirs(): +@@ -1328,9 +1371,14 @@ def get_site_dirs(): "site-packages"), os.path.join(prefix, "lib", "site-python")]) else: diff -Nru python-setuptools-18.3.1/debian/patches/multiarch-extname.diff python-setuptools-18.4/debian/patches/multiarch-extname.diff --- python-setuptools-18.3.1/debian/patches/multiarch-extname.diff 2015-05-29 13:08:38.000000000 +0000 +++ python-setuptools-18.4/debian/patches/multiarch-extname.diff 2015-10-11 11:52:52.000000000 +0000 @@ -10,7 +10,7 @@ # Always read easy_install options, even if we are subclassed, or have # an independent instance created. This ensures that defaults will -@@ -256,6 +257,9 @@ class easy_install(Command): +@@ -265,6 +266,9 @@ class easy_install(Command): if self.install_layout: if not self.install_layout.lower() in ['deb']: raise DistutilsOptionError("unknown value for --install-layout") diff -Nru python-setuptools-18.3.1/debian/patches/multiple-entrypoints.diff python-setuptools-18.4/debian/patches/multiple-entrypoints.diff --- python-setuptools-18.3.1/debian/patches/multiple-entrypoints.diff 1970-01-01 00:00:00.000000000 +0000 +++ python-setuptools-18.4/debian/patches/multiple-entrypoints.diff 2015-10-11 11:52:41.000000000 +0000 @@ -0,0 +1,26 @@ +# this patch is currently not used, not providing entry points for all interpreters + +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -43,8 +43,17 @@ def _gen_console_scripts(): + ) + if any(os.environ.get(var) not in (None, "", "0") for var in var_names): + return +- yield ("easy_install-{shortver} = setuptools.command.easy_install:main" +- .format(shortver=sys.version[:3])) ++ if sys.version_info[0] < 3 and 'XPYVERSISONS' in os.environ: ++ for version in os.environ['XPYVERSIONS'].split(): ++ yield ("easy_install-{shortver} = setuptools.command.easy_install:main" ++ .format(shortver=version)) ++ elif sys.version_info[0] >= 3 and 'XPY3VERSIONS' in os.environ: ++ for version in os.environ['XPY3VERSIONS'].split(): ++ yield ("easy_install-{shortver} = setuptools.command.easy_install:main" ++ .format(shortver=version)) ++ else: ++ yield ("easy_install-{shortver} = setuptools.command.easy_install:main" ++ .format(shortver=sys.version[:3])) + + console_scripts = list(_gen_console_scripts()) + diff -Nru python-setuptools-18.3.1/debian/patches/series python-setuptools-18.4/debian/patches/series --- python-setuptools-18.3.1/debian/patches/series 2015-05-19 13:08:21.000000000 +0000 +++ python-setuptools-18.4/debian/patches/series 2015-10-11 11:04:07.000000000 +0000 @@ -3,3 +3,4 @@ fix-python3.5.diff no-sphinx-rst.linker.diff fix-changes-link.diff +multiple-entrypoints.diff diff -Nru python-setuptools-18.3.1/debian/rules python-setuptools-18.4/debian/rules --- python-setuptools-18.3.1/debian/rules 2015-09-11 18:31:52.000000000 +0000 +++ python-setuptools-18.4/debian/rules 2015-10-11 11:54:31.000000000 +0000 @@ -3,6 +3,13 @@ %: dh $@ --with python2,python3,pypy,sphinxdoc --buildsystem pybuild +# no versioned easy_install scripts +export SETUPTOOLS_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT = yes + +# versioned easy_install scripts +#export XPYVERSIONS = 2.7 +#export XPY3VERSIONS = 3.4 3.5 + override_dh_auto_test: override_dh_auto_install: @@ -23,9 +30,9 @@ override_dh_auto_clean: # Keep entry_points, we need it to drive setup.py - mv setuptools.egg-info/entry_points.txt . + -mv setuptools.egg-info/entry_points.txt . dh_auto_clean - mkdir setuptools.egg-info + mkdir -p setuptools.egg-info mv entry_points.txt setuptools.egg-info rm -rf .eggs docs/build diff -Nru python-setuptools-18.3.1/ez_setup.py python-setuptools-18.4/ez_setup.py --- python-setuptools-18.3.1/ez_setup.py 2015-09-07 06:23:25.000000000 +0000 +++ python-setuptools-18.4/ez_setup.py 2015-10-11 01:04:05.000000000 +0000 @@ -30,7 +30,7 @@ except ImportError: USER_SITE = None -DEFAULT_VERSION = "18.3.1" +DEFAULT_VERSION = "18.4" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" DEFAULT_SAVE_DIR = os.curdir diff -Nru python-setuptools-18.3.1/PKG-INFO python-setuptools-18.4/PKG-INFO --- python-setuptools-18.3.1/PKG-INFO 2015-09-07 06:23:33.000000000 +0000 +++ python-setuptools-18.4/PKG-INFO 2015-10-11 01:04:13.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: setuptools -Version: 18.3.1 +Version: 18.4 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://bitbucket.org/pypa/setuptools Author: Python Packaging Authority @@ -232,6 +232,17 @@ .. _files: + + --------------- + Code of Conduct + --------------- + + Everyone interacting in the setuptools project's codebases, issue trackers, + chat rooms, and mailing lists is expected to follow the + `PyPA Code of Conduct`_. + + .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ + Keywords: CPAN PyPI distutils eggs package management Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable diff -Nru python-setuptools-18.3.1/pkg_resources/__init__.py python-setuptools-18.4/pkg_resources/__init__.py --- python-setuptools-18.3.1/pkg_resources/__init__.py 2015-08-07 17:08:28.000000000 +0000 +++ python-setuptools-18.4/pkg_resources/__init__.py 2015-09-27 11:26:55.000000000 +0000 @@ -2983,12 +2983,8 @@ @staticmethod def parse(s): - reqs = list(parse_requirements(s)) - if reqs: - if len(reqs) == 1: - return reqs[0] - raise ValueError("Expected only one requirement", s) - raise ValueError("No requirements found", s) + req, = parse_requirements(s) + return req def _get_mro(cls): diff -Nru python-setuptools-18.3.1/README.txt python-setuptools-18.4/README.txt --- python-setuptools-18.3.1/README.txt 2015-08-07 17:08:28.000000000 +0000 +++ python-setuptools-18.4/README.txt 2015-09-19 16:00:35.000000000 +0000 @@ -223,3 +223,14 @@ the Python Packaging Authority (PyPA) and the larger Python community. .. _files: + + +--------------- +Code of Conduct +--------------- + +Everyone interacting in the setuptools project's codebases, issue trackers, +chat rooms, and mailing lists is expected to follow the +`PyPA Code of Conduct`_. + +.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ diff -Nru python-setuptools-18.3.1/setup.cfg python-setuptools-18.4/setup.cfg --- python-setuptools-18.3.1/setup.cfg 2015-09-07 06:23:33.000000000 +0000 +++ python-setuptools-18.4/setup.cfg 2015-10-11 01:04:13.000000000 +0000 @@ -1,7 +1,7 @@ [egg_info] tag_build = -tag_svn_revision = 0 tag_date = 0 +tag_svn_revision = 0 [aliases] release = egg_info -RDb '' diff -Nru python-setuptools-18.3.1/setuptools/command/test.py python-setuptools-18.4/setuptools/command/test.py --- python-setuptools-18.3.1/setuptools/command/test.py 2015-08-07 17:08:28.000000000 +0000 +++ python-setuptools-18.4/setuptools/command/test.py 2015-10-11 00:41:31.000000000 +0000 @@ -1,6 +1,5 @@ from distutils.errors import DistutilsOptionError from unittest import TestLoader -import unittest import sys from pkg_resources import (resource_listdir, resource_exists, normalize_path, @@ -12,7 +11,7 @@ class ScanningLoader(TestLoader): - def loadTestsFromModule(self, module): + def loadTestsFromModule(self, module, pattern=None): """Return a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. @@ -62,20 +61,16 @@ def finalize_options(self): + if self.test_suite and self.test_module: + msg = "You may specify a module or a suite, but not both" + raise DistutilsOptionError(msg) + if self.test_suite is None: if self.test_module is None: self.test_suite = self.distribution.test_suite else: self.test_suite = self.test_module + ".test_suite" - elif self.test_module: - raise DistutilsOptionError( - "You may specify a module or a suite, but not both" - ) - - self.test_args = [self.test_suite] - if self.verbose: - self.test_args.insert(0, '--verbose') if self.test_loader is None: self.test_loader = getattr(self.distribution, 'test_loader', None) if self.test_loader is None: @@ -83,6 +78,16 @@ if self.test_runner is None: self.test_runner = getattr(self.distribution, 'test_runner', None) + @property + def test_args(self): + return list(self._test_args()) + + def _test_args(self): + if self.verbose: + yield '--verbose' + if self.test_suite: + yield self.test_suite + def with_project_on_sys_path(self, func): with_2to3 = PY3 and getattr(self.distribution, 'use_2to3', False) @@ -133,20 +138,19 @@ if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) - if self.test_suite: - cmd = ' '.join(self.test_args) - if self.dry_run: - self.announce('skipping "unittest %s" (dry run)' % cmd) - else: - self.announce('running "unittest %s"' % cmd) - self.with_project_on_sys_path(self.run_tests) + cmd = ' '.join(self._argv) + if self.dry_run: + self.announce('skipping "%s" (dry run)' % cmd) + else: + self.announce('running "%s"' % cmd) + self.with_project_on_sys_path(self.run_tests) def run_tests(self): # Purge modules under test from sys.modules. The test loader will # re-import them from the build location. Required when 2to3 is used # with namespace packages. if PY3 and getattr(self.distribution, 'use_2to3', False): - module = self.test_args[-1].split('.')[0] + module = self.test_suite.split('.')[0] if module in _namespace_packages: del_modules = [] if module in sys.modules: @@ -158,11 +162,15 @@ list(map(sys.modules.__delitem__, del_modules)) unittest_main( - None, None, [unittest.__file__] + self.test_args, + None, None, self._argv, testLoader=self._resolve_as_ep(self.test_loader), testRunner=self._resolve_as_ep(self.test_runner), ) + @property + def _argv(self): + return ['unittest'] + self.test_args + @staticmethod def _resolve_as_ep(val): """ diff -Nru python-setuptools-18.3.1/setuptools/__init__.py python-setuptools-18.4/setuptools/__init__.py --- python-setuptools-18.3.1/setuptools/__init__.py 2015-09-07 05:31:05.000000000 +0000 +++ python-setuptools-18.4/setuptools/__init__.py 2015-09-19 16:05:38.000000000 +0000 @@ -144,11 +144,12 @@ """ Find all files under 'path' """ - return ( + results = ( os.path.join(base, file) for base, dirs, files in os.walk(path, followlinks=True) for file in files ) + return filter(os.path.isfile, results) def findall(dir=os.curdir): diff -Nru python-setuptools-18.3.1/setuptools/tests/test_setuptools.py python-setuptools-18.4/setuptools/tests/test_setuptools.py --- python-setuptools-18.3.1/setuptools/tests/test_setuptools.py 2015-09-07 03:02:22.000000000 +0000 +++ python-setuptools-18.4/setuptools/tests/test_setuptools.py 2015-09-19 16:00:38.000000000 +0000 @@ -1,3 +1,5 @@ +import os + import pytest import setuptools @@ -23,3 +25,24 @@ found = list(setuptools.findall()) expected = ['readme.txt', 'foo/bar.py'] assert found == expected + + +@pytest.fixture +def can_symlink(tmpdir): + """ + Skip if cannot create a symbolic link + """ + link_fn = 'link' + target_fn = 'target' + try: + os.symlink(target_fn, link_fn) + except (OSError, NotImplementedError, AttributeError): + pytest.skip("Cannot create symbolic links") + os.remove(link_fn) + + +def test_findall_missing_symlink(tmpdir, can_symlink): + with tmpdir.as_cwd(): + os.symlink('foo', 'bar') + found = list(setuptools.findall()) + assert found == [] diff -Nru python-setuptools-18.3.1/setuptools/version.py python-setuptools-18.4/setuptools/version.py --- python-setuptools-18.3.1/setuptools/version.py 2015-09-07 06:23:25.000000000 +0000 +++ python-setuptools-18.4/setuptools/version.py 2015-10-11 01:04:05.000000000 +0000 @@ -1 +1 @@ -__version__ = '18.3.1' +__version__ = '18.4' diff -Nru python-setuptools-18.3.1/setuptools.egg-info/entry_points.txt python-setuptools-18.4/setuptools.egg-info/entry_points.txt --- python-setuptools-18.3.1/setuptools.egg-info/entry_points.txt 2015-09-07 06:23:32.000000000 +0000 +++ python-setuptools-18.4/setuptools.egg-info/entry_points.txt 2015-10-11 01:04:11.000000000 +0000 @@ -1,6 +1,6 @@ [console_scripts] easy_install = setuptools.command.easy_install:main -easy_install-3.4 = setuptools.command.easy_install:main +easy_install-3.5 = setuptools.command.easy_install:main [distutils.commands] alias = setuptools.command.alias:alias diff -Nru python-setuptools-18.3.1/setuptools.egg-info/PKG-INFO python-setuptools-18.4/setuptools.egg-info/PKG-INFO --- python-setuptools-18.3.1/setuptools.egg-info/PKG-INFO 2015-09-07 06:23:32.000000000 +0000 +++ python-setuptools-18.4/setuptools.egg-info/PKG-INFO 2015-10-11 01:04:11.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: setuptools -Version: 18.3.1 +Version: 18.4 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://bitbucket.org/pypa/setuptools Author: Python Packaging Authority @@ -232,6 +232,17 @@ .. _files: + + --------------- + Code of Conduct + --------------- + + Everyone interacting in the setuptools project's codebases, issue trackers, + chat rooms, and mailing lists is expected to follow the + `PyPA Code of Conduct`_. + + .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/ + Keywords: CPAN PyPI distutils eggs package management Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable