Hello community, here is the log from the commit of package python3-setuptools for openSUSE:Factory checked in at 2015-12-01 09:17:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-setuptools (Old) and /work/SRC/openSUSE:Factory/.python3-setuptools.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-setuptools" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-setuptools/python3-setuptools.changes 2015-11-05 11:35:31.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-setuptools.new/python3-setuptools.changes 2015-12-01 09:17:06.000000000 +0100 @@ -1,0 +2,30 @@ +Sun Nov 29 20:12:42 UTC 2015 - arun@gmx.de + +- update to version 18.7: + * Update dependency on certify. + * Pull Request #160: Improve detection of gui script in + "easy_install._adjust_header". + * Made "test.test_args" a non-data property; alternate fix + for the issue reported in Pull Request #155. + * Issue #453: In "ez_setup" bootstrap module, unload all + "pkg_resources" modules following download. + * Pull Request #158: Honor `PEP-488 + https://www.python.org/dev/peps/pep-0488/`_ when excluding + files for namespace packages. + * Issue #419 and Pull Request #144: Add experimental support for + reading the version info from distutils-installed metadata rather + than using the version in the filename. + +------------------------------------------------------------------- +Wed Nov 25 06:55:49 UTC 2015 - arun@gmx.de + +- update to version 18.6.1: + * Issue #464: Correct regression in invocation of superclass on + old-style class on Python 2. + +- changes from version 18.6: + * Issue #439: When installing entry_point scripts under development, + omit the version number of the package, allowing any version of + the package to be used. + +------------------------------------------------------------------- Old: ---- setuptools-18.5.tar.gz New: ---- setuptools-18.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-setuptools.spec ++++++ --- /var/tmp/diff_new_pack.QHyw2b/_old 2015-12-01 09:17:07.000000000 +0100 +++ /var/tmp/diff_new_pack.QHyw2b/_new 2015-12-01 09:17:07.000000000 +0100 @@ -17,7 +17,7 @@ Name: python3-setuptools -Version: 18.5 +Version: 18.7 Release: 0 Url: http://pypi.python.org/pypi/setuptools Summary: Easily download, build, install, upgrade, and uninstall Python packages ++++++ setuptools-18.5.tar.gz -> setuptools-18.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/CHANGES.txt new/setuptools-18.7/CHANGES.txt --- old/setuptools-18.5/CHANGES.txt 2015-11-02 01:18:54.000000000 +0100 +++ new/setuptools-18.7/CHANGES.txt 2015-11-28 20:17:50.000000000 +0100 @@ -2,6 +2,40 @@ CHANGES ======= + +---- +18.7 +---- + +* Update dependency on certify. +* Pull Request #160: Improve detection of gui script in + ``easy_install._adjust_header``. +* Made ``test.test_args`` a non-data property; alternate fix + for the issue reported in Pull Request #155. +* Issue #453: In ``ez_setup`` bootstrap module, unload all + ``pkg_resources`` modules following download. +* Pull Request #158: Honor `PEP-488 + https://www.python.org/dev/peps/pep-0488/`_ when excluding + files for namespace packages. +* Issue #419 and Pull Request #144: Add experimental support for + reading the version info from distutils-installed metadata rather + than using the version in the filename. + +------ +18.6.1 +------ + +* Issue #464: Correct regression in invocation of superclass on old-style + class on Python 2. + +---- +18.6 +---- + +* Issue #439: When installing entry_point scripts under development, + omit the version number of the package, allowing any version of the + package to be used. + ---- 18.5 ---- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/DEVGUIDE.txt new/setuptools-18.7/DEVGUIDE.txt --- old/setuptools-18.5/DEVGUIDE.txt 2015-06-18 14:36:06.000000000 +0200 +++ new/setuptools-18.7/DEVGUIDE.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -The canonical development guide can be found in docs/developer-guide.txt. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/PKG-INFO new/setuptools-18.7/PKG-INFO --- old/setuptools-18.5/PKG-INFO 2015-11-02 01:19:45.000000000 +0100 +++ new/setuptools-18.7/PKG-INFO 2015-11-28 23:57:49.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: setuptools -Version: 18.5 +Version: 18.7 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://bitbucket.org/pypa/setuptools Author: Python Packaging Authority diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/docs/developer-guide.txt new/setuptools-18.7/docs/developer-guide.txt --- old/setuptools-18.5/docs/developer-guide.txt 2015-08-07 19:08:28.000000000 +0200 +++ new/setuptools-18.7/docs/developer-guide.txt 2015-11-28 20:13:40.000000000 +0100 @@ -92,9 +92,10 @@ The primary tests are run using py.test. To run the tests:: - $ python setup.py ptr + $ python setup.py test -Or install py.test into your environment and run ``py.test``. +Or install py.test into your environment and run ``PYTHONPATH=. py.test`` +or ``python -m pytest``. Under continuous integration, additional tests may be run. See the ``.travis.yml`` file for full details on the tests run under Travis-CI. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/docs/pkg_resources.txt new/setuptools-18.7/docs/pkg_resources.txt --- old/setuptools-18.5/docs/pkg_resources.txt 2015-08-07 19:08:28.000000000 +0200 +++ new/setuptools-18.7/docs/pkg_resources.txt 2015-11-28 20:13:40.000000000 +0100 @@ -592,7 +592,7 @@ The syntax of a requirement specifier can be defined in EBNF as follows:: - requirement ::= project_name versionspec? extras? + requirement ::= project_name extras? versionspec? versionspec ::= comparison version (',' comparison version)* comparison ::= '<' | '<=' | '!=' | '==' | '>=' | '>' | '~=' | '===' extras ::= '[' extralist? ']' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/docs/setuptools.txt new/setuptools-18.7/docs/setuptools.txt --- old/setuptools-18.5/docs/setuptools.txt 2015-09-19 18:00:35.000000000 +0200 +++ new/setuptools-18.7/docs/setuptools.txt 2015-11-28 20:13:40.000000000 +0100 @@ -112,10 +112,16 @@ ) As you can see, it doesn't take much to use setuptools in a project. -Just by doing the above, this project will be able to produce eggs, upload to +Run that script in your project folder, alongside the Python packages +you have developed. + +Invoke that script to produce eggs, upload to PyPI, and automatically include all packages in the directory where the setup.py lives. See the `Command Reference`_ section below to see what -commands you can give to this setup script. +commands you can give to this setup script. For example, +to produce a source distribution, simply invoke:: + + python setup.py sdist Of course, before you release your project to PyPI, you'll want to add a bit more information to your setup script to help people find or learn about your diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/ez_setup.py new/setuptools-18.7/ez_setup.py --- old/setuptools-18.5/ez_setup.py 2015-10-11 03:14:27.000000000 +0200 +++ new/setuptools-18.7/ez_setup.py 2015-11-28 23:57:43.000000000 +0100 @@ -30,7 +30,7 @@ except ImportError: USER_SITE = None -DEFAULT_VERSION = "18.5" +DEFAULT_VERSION = "18.7" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" DEFAULT_SAVE_DIR = os.curdir @@ -125,7 +125,7 @@ # Remove previously-imported pkg_resources if present (see # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details). if 'pkg_resources' in sys.modules: - del sys.modules['pkg_resources'] + _unload_pkg_resources() import setuptools setuptools.bootstrap_install_from = egg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/pkg_resources/__init__.py new/setuptools-18.7/pkg_resources/__init__.py --- old/setuptools-18.5/pkg_resources/__init__.py 2015-11-01 18:12:10.000000000 +0100 +++ new/setuptools-18.7/pkg_resources/__init__.py 2015-11-28 20:13:44.000000000 +0100 @@ -1716,7 +1716,7 @@ path = self.module_path old = None while path!=old: - if path.lower().endswith('.egg'): + if _is_unpacked_egg(path): self.egg_name = os.path.basename(path) self.egg_info = os.path.join(path, 'EGG-INFO') self.egg_root = path @@ -2099,7 +2099,7 @@ # don't yield nested distros return for subitem in metadata.resource_listdir('/'): - if subitem.endswith('.egg'): + if _is_unpacked_egg(subitem): subpath = os.path.join(path_item, subitem) for dist in find_eggs_in_zip(zipimport.zipimporter(subpath), subpath): yield dist @@ -2115,8 +2115,7 @@ path_item = _normalize_cached(path_item) if os.path.isdir(path_item) and os.access(path_item, os.R_OK): - if path_item.lower().endswith('.egg'): - # unpacked egg + if _is_unpacked_egg(path_item): yield Distribution.from_filename( path_item, metadata=PathMetadata( path_item, os.path.join(path_item,'EGG-INFO') @@ -2136,7 +2135,7 @@ yield Distribution.from_location( path_item, entry, metadata, precedence=DEVELOP_DIST ) - elif not only and lower.endswith('.egg'): + elif not only and _is_unpacked_egg(entry): dists = find_distributions(os.path.join(path_item, entry)) for dist in dists: yield dist @@ -2283,6 +2282,14 @@ _cache[filename] = result = normalize_path(filename) return result +def _is_unpacked_egg(path): + """ + Determine if given path appears to be an unpacked egg. + """ + return ( + path.lower().endswith('.egg') + ) + def _set_parent_ns(packageName): parts = packageName.split('.') name = parts.pop() @@ -2466,6 +2473,18 @@ return location +def _version_from_file(lines): + """ + Given an iterable of lines from a Metadata file, return + the value of the Version field, if present, or None otherwise. + """ + is_version_line = lambda line: line.lower().startswith('version:') + version_lines = filter(is_version_line, lines) + line = next(iter(version_lines), '') + _, _, value = line.partition(':') + return safe_version(value.strip()) or None + + class Distribution(object): """Wrap an actual or potential sys.path entry w/metadata""" PKG_INFO = 'PKG-INFO' @@ -2483,22 +2502,29 @@ self._provider = metadata or empty_provider @classmethod - def from_location(cls, location, basename, metadata=None,**kw): + def from_location(cls, location, basename, metadata=None, **kw): project_name, version, py_version, platform = [None]*4 + dist_path = os.path.join(location, basename) basename, ext = os.path.splitext(basename) if ext.lower() in _distributionImpl: - # .dist-info gets much metadata differently + cls = _distributionImpl[ext.lower()] + match = EGG_NAME(basename) if match: project_name, version, py_version, platform = match.group( - 'name','ver','pyver','plat' + 'name', 'ver', 'pyver', 'plat' ) - cls = _distributionImpl[ext.lower()] + + version = cls._version_from_metadata(dist_path) or version return cls( location, metadata, project_name=project_name, version=version, py_version=py_version, platform=platform, **kw ) + @staticmethod + def _version_from_metadata(dist_path): + pass + @property def hashcmp(self): return ( @@ -2584,13 +2610,11 @@ try: return self._version except AttributeError: - for line in self._get_metadata(self.PKG_INFO): - if line.lower().startswith('version:'): - self._version = safe_version(line.split(':',1)[1].strip()) - return self._version - else: + version = _version_from_file(self._get_metadata(self.PKG_INFO)) + if version is None: tmpl = "Missing 'Version:' header and/or %s file" raise ValueError(tmpl % self.PKG_INFO, self) + return version @property def _dep_map(self): @@ -2795,6 +2819,30 @@ return [dep for dep in self._dep_map if dep] +class EggInfoDistribution(Distribution): + + @staticmethod + def _version_from_metadata(dist_path): + """ + Packages installed by distutils (e.g. numpy or scipy), + which uses an old safe_version, and so + their version numbers can get mangled when + converted to filenames (e.g., 1.11.0.dev0+2329eae to + 1.11.0.dev0_2329eae). These distributions will not be + parsed properly + downstream by Distribution and safe_version, so + take an extra step and try to get the version number from + the metadata file itself instead of the filename. + """ + if not os.path.isfile(dist_path): + return + try: + with open(dist_path) as strm: + return _version_from_file(strm) + except IOError: + pass + + class DistInfoDistribution(Distribution): """Wrap an actual or potential sys.path entry w/metadata, .dist-info style""" PKG_INFO = 'METADATA' @@ -2860,7 +2908,7 @@ _distributionImpl = { '.egg': Distribution, - '.egg-info': Distribution, + '.egg-info': EggInfoDistribution, '.dist-info': DistInfoDistribution, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/pkg_resources/tests/test_pkg_resources.py new/setuptools-18.7/pkg_resources/tests/test_pkg_resources.py --- old/setuptools-18.5/pkg_resources/tests/test_pkg_resources.py 2015-08-07 19:08:28.000000000 +0200 +++ new/setuptools-18.7/pkg_resources/tests/test_pkg_resources.py 2015-11-28 20:13:44.000000000 +0100 @@ -5,9 +5,15 @@ import datetime import time import subprocess +import stat +import distutils.dist +import distutils.command.install_egg_info + +import pytest import pkg_resources + try: unicode except NameError: @@ -109,3 +115,49 @@ ) cmd = [sys.executable, '-c', '; '.join(lines)] subprocess.check_call(cmd) + + + +class TestDeepVersionLookupDistutils(object): + + @pytest.fixture + def env(self, tmpdir): + """ + Create a package environment, similar to a virtualenv, + in which packages are installed. + """ + class Environment(str): + pass + + env = Environment(tmpdir) + tmpdir.chmod(stat.S_IRWXU) + subs = 'home', 'lib', 'scripts', 'data', 'egg-base' + env.paths = dict( + (dirname, str(tmpdir / dirname)) + for dirname in subs + ) + list(map(os.mkdir, env.paths.values())) + return env + + def create_foo_pkg(self, env, version): + """ + Create a foo package installed (distutils-style) to env.paths['lib'] + as version. + """ + attrs = dict(name='foo', version=version) + dist = distutils.dist.Distribution(attrs) + iei_cmd = distutils.command.install_egg_info.install_egg_info(dist) + iei_cmd.initialize_options() + iei_cmd.install_dir = env.paths['lib'] + iei_cmd.finalize_options() + iei_cmd.run() + + def test_version_resolved_from_egg_info(self, env): + version = '1.11.0.dev0+2329eae' + self.create_foo_pkg(env, version) + + # this requirement parsing will raise a VersionConflict unless the + # .egg-info file is parsed (see #419 on BitBucket) + req = pkg_resources.Requirement.parse('foo>=1.9') + dist = pkg_resources.WorkingSet([env.paths['lib']]).find(req) + assert dist.version == version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/pytest.ini new/setuptools-18.7/pytest.ini --- old/setuptools-18.5/pytest.ini 2015-08-07 19:08:28.000000000 +0200 +++ new/setuptools-18.7/pytest.ini 2015-11-28 20:13:40.000000000 +0100 @@ -1,3 +1,3 @@ [pytest] -addopts=--doctest-modules --ignore release.py --ignore setuptools/lib2to3_ex.py --ignore tests/manual_test.py --ignore tests/shlib_test --doctest-glob=pkg_resources/api_tests.txt +addopts=--doctest-modules --ignore release.py --ignore setuptools/lib2to3_ex.py --ignore tests/manual_test.py --ignore tests/shlib_test --doctest-glob=pkg_resources/api_tests.txt --ignore scripts/upload-old-releases-as-zip.py norecursedirs=dist build *.egg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setup.cfg new/setuptools-18.7/setup.cfg --- old/setuptools-18.5/setup.cfg 2015-11-02 01:19:45.000000000 +0100 +++ new/setuptools-18.7/setup.cfg 2015-11-28 23:57:49.000000000 +0100 @@ -1,7 +1,7 @@ [egg_info] tag_build = -tag_date = 0 tag_svn_revision = 0 +tag_date = 0 [aliases] release = egg_info -RDb '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setup.py new/setuptools-18.7/setup.py --- old/setuptools-18.5/setup.py 2015-10-22 22:57:25.000000000 +0200 +++ new/setuptools-18.7/setup.py 2015-11-28 20:13:40.000000000 +0100 @@ -150,10 +150,10 @@ """).strip().splitlines(), extras_require={ "ssl:sys_platform=='win32'": "wincertstore==0.2", - "certs": "certifi==2015.04.28", + "certs": "certifi==2015.11.20", }, dependency_links=[ - 'https://pypi.python.org/packages/source/c/certifi/certifi-2015.04.28.tar.gz#...', + 'https://pypi.python.org/packages/source/c/certifi/certifi-2015.11.20.tar.gz#...', 'https://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.2.zip#...', ], scripts=[], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/command/develop.py new/setuptools-18.7/setuptools/command/develop.py --- old/setuptools-18.5/setuptools/command/develop.py 2015-09-27 13:52:43.000000000 +0200 +++ new/setuptools-18.7/setuptools/command/develop.py 2015-11-28 20:13:40.000000000 +0100 @@ -167,3 +167,30 @@ script_text = f.read() f.close() self.install_script(dist, script_name, script_text, script_path) + + def install_wrapper_scripts(self, dist): + dist = VersionlessRequirement(dist) + return easy_install.install_wrapper_scripts(self, dist) + + +class VersionlessRequirement(object): + """ + Adapt a pkg_resources.Distribution to simply return the project + name as the 'requirement' so that scripts will work across + multiple versions. + + >>> dist = Distribution(project_name='foo', version='1.0') + >>> str(dist.as_requirement()) + 'foo==1.0' + >>> adapted_dist = VersionlessRequirement(dist) + >>> str(adapted_dist.as_requirement()) + 'foo' + """ + def __init__(self, dist): + self.__dist = dist + + def __getattr__(self, name): + return getattr(self.__dist, name) + + def as_requirement(self): + return self.project_name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/command/easy_install.py new/setuptools-18.7/setuptools/command/easy_install.py --- old/setuptools-18.5/setuptools/command/easy_install.py 2015-09-27 14:07:28.000000000 +0200 +++ new/setuptools-18.7/setuptools/command/easy_install.py 2015-11-28 20:13:40.000000000 +0100 @@ -20,6 +20,7 @@ from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS from distutils import log, dir_util from distutils.command.build_scripts import first_line_re +from distutils.spawn import find_executable import sys import os import zipimport @@ -760,9 +761,10 @@ return dst def install_wrapper_scripts(self, dist): - if not self.exclude_scripts: - for args in ScriptWriter.best().get_args(dist): - self.write_script(*args) + if self.exclude_scripts: + return + for args in ScriptWriter.best().get_args(dist): + self.write_script(*args) def install_script(self, dist, script_name, script_text, dev_path=None): """Generate a legacy script wrapper and install it""" @@ -2125,8 +2127,8 @@ blockers = [name + x for x in old] yield name + ext, header + script_text, 't', blockers - @staticmethod - def _adjust_header(type_, orig_header): + @classmethod + def _adjust_header(cls, type_, orig_header): """ Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). @@ -2137,11 +2139,19 @@ pattern, repl = repl, pattern pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE) new_header = pattern_ob.sub(string=orig_header, repl=repl) + return new_header if cls._use_header(new_header) else orig_header + + @staticmethod + def _use_header(new_header): + """ + Should _adjust_header use the replaced header? + + On non-windows systems, always use. On + Windows systems, only use the replaced header if it resolves + to an executable on the system. + """ clean_header = new_header[2:-1].strip('"') - if sys.platform == 'win32' and not os.path.exists(clean_header): - # the adjusted version doesn't exist, so return the original - return orig_header - return new_header + return sys.platform != 'win32' or find_executable(clean_header) class WindowsExecutableLauncherWriter(WindowsScriptWriter): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/command/install_lib.py new/setuptools-18.7/setuptools/command/install_lib.py --- old/setuptools-18.5/setuptools/command/install_lib.py 2015-06-18 14:36:06.000000000 +0200 +++ new/setuptools-18.7/setuptools/command/install_lib.py 2015-11-28 20:13:40.000000000 +0100 @@ -79,6 +79,8 @@ base = os.path.join('__pycache__', '__init__.' + imp.get_tag()) yield base + '.pyc' yield base + '.pyo' + yield base + '.opt-1.pyc' + yield base + '.opt-2.pyc' def copy_tree( self, infile, outfile, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/command/test.py new/setuptools-18.7/setuptools/command/test.py --- old/setuptools-18.5/setuptools/command/test.py 2015-10-11 02:41:31.000000000 +0200 +++ new/setuptools-18.7/setuptools/command/test.py 2015-11-28 20:13:40.000000000 +0100 @@ -41,6 +41,17 @@ return tests[0] # don't create a nested suite for only one return +# adapted from jaraco.classes.properties:NonDataProperty +class NonDataProperty(object): + def __init__(self, fget): + self.fget = fget + + def __get__(self, obj, objtype=None): + if obj is None: + return self + return self.fget(obj) + + class test(Command): """Command to run unit tests after in-place build""" @@ -78,7 +89,7 @@ if self.test_runner is None: self.test_runner = getattr(self.distribution, 'test_runner', None) - @property + @NonDataProperty def test_args(self): return list(self._test_args()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/py31compat.py new/setuptools-18.7/setuptools/py31compat.py --- old/setuptools-18.5/setuptools/py31compat.py 2015-06-18 14:36:06.000000000 +0200 +++ new/setuptools-18.7/setuptools/py31compat.py 2015-11-28 20:13:40.000000000 +0100 @@ -20,7 +20,7 @@ import shutil import tempfile class TemporaryDirectory(object): - """" + """ Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/tests/test_develop.py new/setuptools-18.7/setuptools/tests/test_develop.py --- old/setuptools-18.5/setuptools/tests/test_develop.py 2015-08-07 19:08:28.000000000 +0200 +++ new/setuptools-18.7/setuptools/tests/test_develop.py 2015-11-28 20:13:40.000000000 +0100 @@ -1,13 +1,17 @@ """develop tests """ import os -import shutil import site import sys -import tempfile +import io + +import pytest from setuptools.command.develop import develop from setuptools.dist import Distribution +from . import contexts +from setuptools.compat import PY3 + SETUP_PY = """\ from setuptools import setup @@ -21,65 +25,52 @@ INIT_PY = """print "foo" """ -class TestDevelopTest: - - def setup_method(self, method): - if hasattr(sys, 'real_prefix'): - return - - # Directory structure - self.dir = tempfile.mkdtemp() - os.mkdir(os.path.join(self.dir, 'foo')) - # setup.py - setup = os.path.join(self.dir, 'setup.py') - f = open(setup, 'w') +@pytest.yield_fixture +def temp_user(monkeypatch): + with contexts.tempdir() as user_base: + with contexts.tempdir() as user_site: + monkeypatch.setattr('site.USER_BASE', user_base) + monkeypatch.setattr('site.USER_SITE', user_site) + yield + + +@pytest.yield_fixture +def test_env(tmpdir, temp_user): + target = tmpdir + foo = target.mkdir('foo') + setup = target / 'setup.py' + if setup.isfile(): + raise ValueError(dir(target)) + with setup.open('w') as f: f.write(SETUP_PY) - f.close() - self.old_cwd = os.getcwd() - # foo/__init__.py - init = os.path.join(self.dir, 'foo', '__init__.py') - f = open(init, 'w') + init = foo / '__init__.py' + with init.open('w') as f: f.write(INIT_PY) - f.close() + with target.as_cwd(): + yield target - os.chdir(self.dir) - self.old_base = site.USER_BASE - site.USER_BASE = tempfile.mkdtemp() - self.old_site = site.USER_SITE - site.USER_SITE = tempfile.mkdtemp() - - def teardown_method(self, method): - if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix): - return - - os.chdir(self.old_cwd) - shutil.rmtree(self.dir) - shutil.rmtree(site.USER_BASE) - shutil.rmtree(site.USER_SITE) - site.USER_BASE = self.old_base - site.USER_SITE = self.old_site - - def test_develop(self): - if hasattr(sys, 'real_prefix'): - return - dist = Distribution( - dict(name='foo', - packages=['foo'], - use_2to3=True, - version='0.0', - )) + +class TestDevelop: + in_virtualenv = hasattr(sys, 'real_prefix') + in_venv = hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix + @pytest.mark.skipif(in_virtualenv or in_venv, + reason="Cannot run when invoked in a virtualenv or venv") + def test_2to3_user_mode(self, test_env): + settings = dict( + name='foo', + packages=['foo'], + use_2to3=True, + version='0.0', + ) + dist = Distribution(settings) dist.script_name = 'setup.py' cmd = develop(dist) cmd.user = 1 cmd.ensure_finalized() cmd.install_dir = site.USER_SITE cmd.user = 1 - old_stdout = sys.stdout - #sys.stdout = StringIO() - try: + with contexts.quiet(): cmd.run() - finally: - sys.stdout = old_stdout # let's see if we got our egg link at the right place content = os.listdir(site.USER_SITE) @@ -87,17 +78,37 @@ assert content == ['easy-install.pth', 'foo.egg-link'] # Check that we are using the right code. - egg_link_file = open(os.path.join(site.USER_SITE, 'foo.egg-link'), 'rt') - try: + fn = os.path.join(site.USER_SITE, 'foo.egg-link') + with io.open(fn) as egg_link_file: path = egg_link_file.read().split()[0].strip() - finally: - egg_link_file.close() - init_file = open(os.path.join(path, 'foo', '__init__.py'), 'rt') - try: + fn = os.path.join(path, 'foo', '__init__.py') + with io.open(fn) as init_file: init = init_file.read().strip() - finally: - init_file.close() - if sys.version < "3": - assert init == 'print "foo"' - else: - assert init == 'print("foo")' + + expected = 'print("foo")' if PY3 else 'print "foo"' + assert init == expected + + def test_console_scripts(self, tmpdir): + """ + Test that console scripts are installed and that they reference + only the project by name and not the current version. + """ + pytest.skip("TODO: needs a fixture to cause 'develop' " + "to be invoked without mutating environment.") + settings = dict( + name='foo', + packages=['foo'], + version='0.0', + entry_points={ + 'console_scripts': [ + 'foocmd = foo:foo', + ], + }, + ) + dist = Distribution(settings) + dist.script_name = 'setup.py' + cmd = develop(dist) + cmd.ensure_finalized() + cmd.install_dir = tmpdir + cmd.run() + #assert '0.0' not in foocmd_text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/tests/test_egg_info.py new/setuptools-18.7/setuptools/tests/test_egg_info.py --- old/setuptools-18.5/setuptools/tests/test_egg_info.py 2015-08-07 19:08:29.000000000 +0200 +++ new/setuptools-18.7/setuptools/tests/test_egg_info.py 2015-11-28 20:13:44.000000000 +0100 @@ -8,7 +8,11 @@ from . import contexts -class TestEggInfo: +class Environment(str): + pass + + +class TestEggInfo(object): setup_script = DALS(""" from setuptools import setup @@ -33,8 +37,6 @@ @pytest.yield_fixture def env(self): - class Environment(str): pass - with contexts.tempdir(prefix='setuptools-test.') as env_dir: env = Environment(env_dir) os.chmod(env_dir, stat.S_IRWXU) @@ -49,8 +51,7 @@ f.write(DALS(""" [egg_info] egg-base = %(egg-base)s - """ % env.paths - )) + """ % env.paths)) yield env def test_egg_base_installed_egg_info(self, tmpdir_cwd, env): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools/version.py new/setuptools-18.7/setuptools/version.py --- old/setuptools-18.5/setuptools/version.py 2015-10-11 03:14:27.000000000 +0200 +++ new/setuptools-18.7/setuptools/version.py 2015-11-28 23:57:43.000000000 +0100 @@ -1 +1 @@ -__version__ = '18.5' +__version__ = '18.7' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools.egg-info/PKG-INFO new/setuptools-18.7/setuptools.egg-info/PKG-INFO --- old/setuptools-18.5/setuptools.egg-info/PKG-INFO 2015-11-02 01:19:43.000000000 +0100 +++ new/setuptools-18.7/setuptools.egg-info/PKG-INFO 2015-11-28 23:57:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: setuptools -Version: 18.5 +Version: 18.7 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://bitbucket.org/pypa/setuptools Author: Python Packaging Authority diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools.egg-info/SOURCES.txt new/setuptools-18.7/setuptools.egg-info/SOURCES.txt --- old/setuptools-18.5/setuptools.egg-info/SOURCES.txt 2015-11-02 01:19:45.000000000 +0100 +++ new/setuptools-18.7/setuptools.egg-info/SOURCES.txt 2015-11-28 23:57:49.000000000 +0100 @@ -1,5 +1,4 @@ CHANGES.txt -DEVGUIDE.txt MANIFEST.in README.txt bootstrap.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools.egg-info/dependency_links.txt new/setuptools-18.7/setuptools.egg-info/dependency_links.txt --- old/setuptools-18.5/setuptools.egg-info/dependency_links.txt 2015-11-02 01:19:43.000000000 +0100 +++ new/setuptools-18.7/setuptools.egg-info/dependency_links.txt 2015-11-28 23:57:47.000000000 +0100 @@ -1,2 +1,2 @@ -https://pypi.python.org/packages/source/c/certifi/certifi-2015.04.28.tar.gz#... +https://pypi.python.org/packages/source/c/certifi/certifi-2015.11.20.tar.gz#... https://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.2.zip#... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools-18.5/setuptools.egg-info/requires.txt new/setuptools-18.7/setuptools.egg-info/requires.txt --- old/setuptools-18.5/setuptools.egg-info/requires.txt 2015-11-02 01:19:43.000000000 +0100 +++ new/setuptools-18.7/setuptools.egg-info/requires.txt 2015-11-28 23:57:47.000000000 +0100 @@ -1,6 +1,6 @@ [certs] -certifi==2015.04.28 +certifi==2015.11.20 [ssl:sys_platform=='win32'] wincertstore==0.2