From 937a7dee0b5de773f164d7e3b143113c270733eb Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Mon, 22 Jul 2013 17:32:14 +0000 Subject: package_index.py : fix hash_name --- setuptools/package_index.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 47f00c00..b1b38f03 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -222,7 +222,8 @@ class HashChecker(ContentChecker): ) def __init__(self, hash_name, expected): - self.hash = hashlib.new(hash_name) + self.hash_name = hash_name + self.hash = hashlib.new(hash_name) self.expected = expected @classmethod @@ -242,23 +243,8 @@ class HashChecker(ContentChecker): def is_valid(self): return self.hash.hexdigest() == self.expected - def _get_hash_name(self): - """ - Python 2.4 implementation of MD5 doesn't supply a .name attribute - so provide that name. - - When Python 2.4 is no longer required, replace invocations of this - method with simply 'self.hash.name'. - """ - try: - return self.hash.name - except AttributeError: - if 'md5' in str(type(self.hash)): - return 'md5' - raise - def report(self, reporter, template): - msg = template % self._get_hash_name() + msg = template % self.hash_name return reporter(msg) -- cgit v1.2.1 From 99c854fe2766858883ef6a248462627ba137ca14 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 22 Jul 2013 22:19:08 +0200 Subject: Add pypy to Travis platforms --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 83efa5a4..b684935f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,6 @@ python: - 2.7 - 3.2 - 3.3 + - pypy # command to run tests script: python setup.py test -- cgit v1.2.1 From 9caf92acf6972f283f368aa42ed186aafb28502b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 22 Jul 2013 22:34:04 +0200 Subject: Update test to reflect the copy of the hash name stored because pypy doesn't implement the undocumented .name attribute on HASH objects. --- setuptools/tests/test_packageindex.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index 3791914a..7f5dc585 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -169,11 +169,7 @@ class TestContentCheckers(unittest.TestCase): def test_get_hash_name_md5(self): checker = setuptools.package_index.HashChecker.from_url( 'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478') - if sys.version_info >= (2,5): - self.assertEqual(checker.hash.name, 'md5') - else: - # Python 2.4 compatability - self.assertEqual(checker._get_hash_name(), 'md5') + self.assertEqual(checker.hash_name, 'md5') def test_report(self): checker = setuptools.package_index.HashChecker.from_url( -- cgit v1.2.1 From 3762e907f5a0a081c79eaa571051f38c711308af Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 22 Jul 2013 22:54:58 +0200 Subject: Update changelog --- CHANGES.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 6e993ada..301b7181 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,13 @@ CHANGES ======= +----- +0.9.7 +----- + +* Issue #49: Correct AttributeError on PyPy where a hashlib.HASH object does + not have a `.name` attribute. + ----- 0.9.6 ----- -- cgit v1.2.1 From c7a99e2ccc7dedfd5beb04698abf05b216ab7460 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 22 Jul 2013 22:56:01 +0200 Subject: Added tag 0.9.7 for changeset 19965a03c1d5 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bb4ffc14..8f492918 100644 --- a/.hgtags +++ b/.hgtags @@ -87,3 +87,4 @@ e3d70539e79f39a97f69674ab038661961a1eb43 0.8 1aef141fc968113e4c521d1edf6ea863c4ff7e00 0.9.4 88e3d6788facbb2dd6467a23c4f35529a5ce20a1 0.9.5 acc6c5d61d0f82040c237ac7ea010c0fc9e67d66 0.9.6 +19965a03c1d5231c894e0fabfaf45af1fd99f484 0.9.7 -- cgit v1.2.1 From 429e83e9c0fb2b0cf4ba038dc4340367bef4e735 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 22 Jul 2013 22:57:09 +0200 Subject: Bumped to 0.9.8 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 56 ++++++++++++++++++------------------ setuptools/__init__.py | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 55434eb7..8f11fa2f 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -28,7 +28,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "0.9.7" +DEFAULT_VERSION = "0.9.8" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index d64b3c28..55aa158e 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,11 +1,8 @@ -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main - [distutils.setup_keywords] +exclude_package_data = setuptools.dist:check_package_data +packages = setuptools.dist:check_packages +install_requires = setuptools.dist:check_requirements +eager_resources = setuptools.dist:assert_string_list use_2to3 = setuptools.dist:assert_bool namespace_packages = setuptools.dist:check_nsp package_data = setuptools.dist:check_package_data @@ -13,50 +10,53 @@ use_2to3_exclude_fixers = setuptools.dist:assert_string_list dependency_links = setuptools.dist:assert_string_list use_2to3_fixers = setuptools.dist:assert_string_list test_suite = setuptools.dist:check_test_suite -exclude_package_data = setuptools.dist:check_package_data -extras_require = setuptools.dist:check_extras -install_requires = setuptools.dist:check_requirements -eager_resources = setuptools.dist:assert_string_list +tests_require = setuptools.dist:check_requirements +test_loader = setuptools.dist:check_importable +convert_2to3_doctests = setuptools.dist:assert_string_list include_package_data = setuptools.dist:assert_bool -packages = setuptools.dist:check_packages +extras_require = setuptools.dist:check_extras entry_points = setuptools.dist:check_entry_points zip_safe = setuptools.dist:assert_bool -tests_require = setuptools.dist:check_requirements -convert_2to3_doctests = setuptools.dist:assert_string_list -test_loader = setuptools.dist:check_importable [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl [egg_info.writers] +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +depends.txt = setuptools.command.egg_info:warn_depends_obsolete top_level.txt = setuptools.command.egg_info:write_toplevel_names +entry_points.txt = setuptools.command.egg_info:write_entries +requires.txt = setuptools.command.egg_info:write_requirements PKG-INFO = setuptools.command.egg_info:write_pkg_info eager_resources.txt = setuptools.command.egg_info:overwrite_arg namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -entry_points.txt = setuptools.command.egg_info:write_entries -requires.txt = setuptools.command.egg_info:write_requirements [distutils.commands] -test = setuptools.command.test:test -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -alias = setuptools.command.alias:alias -sdist = setuptools.command.sdist:sdist develop = setuptools.command.develop:develop bdist_egg = setuptools.command.bdist_egg:bdist_egg setopt = setuptools.command.setopt:setopt egg_info = setuptools.command.egg_info:egg_info build_ext = setuptools.command.build_ext:build_ext -upload_docs = setuptools.command.upload_docs:upload_docs -easy_install = setuptools.command.easy_install:easy_install +test = setuptools.command.test:test install = setuptools.command.install:install install_egg_info = setuptools.command.install_egg_info:install_egg_info -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -install_lib = setuptools.command.install_lib:install_lib -rotate = setuptools.command.rotate:rotate +upload_docs = setuptools.command.upload_docs:upload_docs saveopts = setuptools.command.saveopts:saveopts +alias = setuptools.command.alias:alias install_scripts = setuptools.command.install_scripts:install_scripts build_py = setuptools.command.build_py:build_py +sdist = setuptools.command.sdist:sdist +easy_install = setuptools.command.easy_install:easy_install +rotate = setuptools.command.rotate:rotate +install_lib = setuptools.command.install_lib:install_lib register = setuptools.command.register:register +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 18dd363d..8c708bd6 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -8,7 +8,7 @@ from distutils.util import convert_path import os import sys -__version__ = '0.9.7' +__version__ = '0.9.8' __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'find_packages' -- cgit v1.2.1 From 8fa3b1dce8af41e3fd9acbb1b2db0dd38bcfb09b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 22 Jul 2013 23:03:43 +0200 Subject: Update changelog to reflect other minor changes included in the latest release --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 301b7181..41d5949a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,9 @@ CHANGES * Issue #49: Correct AttributeError on PyPy where a hashlib.HASH object does not have a `.name` attribute. +* Issue #34: Documentation now refers to bootstrap script in code repository + referenced by bookmark. +* Add underscore-separated keys to environment markers (markerlib). ----- 0.9.6 -- cgit v1.2.1 From a09c0b0efd3b71306b9293837850aec1887f6b98 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 22:31:56 +0200 Subject: Remove unused imports --- setuptools/package_index.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index b1b38f03..88f04809 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -1,6 +1,5 @@ """PyPI and direct package downloading""" -import sys, os.path, re, shutil, random, socket -import itertools +import sys, os.path, re, shutil, socket import base64 from setuptools import ssl_support from pkg_resources import * @@ -223,7 +222,7 @@ class HashChecker(ContentChecker): def __init__(self, hash_name, expected): self.hash_name = hash_name - self.hash = hashlib.new(hash_name) + self.hash = hashlib.new(hash_name) self.expected = expected @classmethod -- cgit v1.2.1 From 9505e8bf8b0ca5cf33befc3f8818cb519c74cc0c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 22:33:16 +0200 Subject: Clean up imports in package_index --- setuptools/package_index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 88f04809..76421c3b 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -1,6 +1,11 @@ """PyPI and direct package downloading""" -import sys, os.path, re, shutil, socket +import sys +import os +import re +import shutil +import socket import base64 + from setuptools import ssl_support from pkg_resources import * from distutils import log -- cgit v1.2.1 From a58abed83f51c263547294fbfb57e5a44a32e5a3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 22:38:26 +0200 Subject: Re-indent several function signatures to reduce linter warnings --- setuptools/package_index.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 76421c3b..4c2e10f9 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -109,9 +109,10 @@ def distros_for_filename(filename, metadata=None): ) -def interpret_distro_name(location, basename, metadata, - py_version=None, precedence=SOURCE_DIST, platform=None -): +def interpret_distro_name( + location, basename, metadata, py_version=None, precedence=SOURCE_DIST, + platform=None + ): """Generate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call @@ -255,9 +256,10 @@ class HashChecker(ContentChecker): class PackageIndex(Environment): """A distribution index that scans web pages for download URLs""" - def __init__(self, index_url="https://pypi.python.org/simple", hosts=('*',), - ca_bundle=None, verify_ssl=True, *args, **kw - ): + def __init__( + self, index_url="https://pypi.python.org/simple", hosts=('*',), + ca_bundle=None, verify_ssl=True, *args, **kw + ): Environment.__init__(self,*args,**kw) self.index_url = index_url + "/"[:not index_url.endswith('/')] self.scanned_urls = {} @@ -378,7 +380,7 @@ class PackageIndex(Environment): # process an index page into the package-page index for match in HREF.finditer(page): try: - scan( urljoin(url, htmldecode(match.group(1))) ) + scan(urljoin(url, htmldecode(match.group(1)))) except ValueError: pass @@ -530,10 +532,10 @@ class PackageIndex(Environment): return getattr(self.fetch_distribution(spec, tmpdir),'location',None) - def fetch_distribution(self, - requirement, tmpdir, force_scan=False, source=False, develop_ok=False, - local_index=None - ): + def fetch_distribution( + self, requirement, tmpdir, force_scan=False, source=False, + develop_ok=False, local_index=None + ): """Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. @@ -616,7 +618,8 @@ class PackageIndex(Environment): def gen_setup(self, filename, fragment, tmpdir): match = EGG_FRAGMENT.match(fragment) - dists = match and [d for d in + dists = match and [ + d for d in interpret_distro_name(filename, match.group(1), None) if d.version ] or [] @@ -722,9 +725,11 @@ class PackageIndex(Environment): if warning: self.warn(warning, v.line) else: - raise DistutilsError('%s returned a bad status line. ' - 'The server might be down, %s' % \ - (url, v.line)) + raise DistutilsError( + '%s returned a bad status line. The server might be ' + 'down, %s' % + (url, v.line) + ) except httplib.HTTPException: v = sys.exc_info()[1] if warning: -- cgit v1.2.1 From 7b42936dc2dacbf91504c495b6cae569a1d88c95 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 22:40:18 +0200 Subject: Normalize whitespace in package_index.py --- setuptools/package_index.py | 79 ++------------------------------------------- 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 4c2e10f9..9abd9679 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -403,8 +403,6 @@ class PackageIndex(Environment): else: return "" # no sense double-scanning non-package pages - - def need_version_info(self, url): self.scan_all( "Page at %s links to .py file(s) without version info; an index " @@ -435,17 +433,14 @@ class PackageIndex(Environment): self.scan_url(url) def obtain(self, requirement, installer=None): - self.prescan(); self.find_packages(requirement) + self.prescan() + self.find_packages(requirement) for dist in self[requirement.key]: if dist in requirement: return dist self.debug("%s does not match %s", requirement, dist) return super(PackageIndex, self).obtain(requirement,installer) - - - - def check_hash(self, checker, filename, tfp): """ checker is a ContentChecker @@ -531,7 +526,6 @@ class PackageIndex(Environment): ) return getattr(self.fetch_distribution(spec, tmpdir),'location',None) - def fetch_distribution( self, requirement, tmpdir, force_scan=False, source=False, develop_ok=False, local_index=None @@ -573,8 +567,6 @@ class PackageIndex(Environment): if dist in req and (dist.precedence<=SOURCE_DIST or not source): return dist - - if force_scan: self.prescan() self.find_packages(requirement) @@ -601,7 +593,6 @@ class PackageIndex(Environment): self.info("Best match: %s", dist) return dist.clone(location=self.download(dist.location, tmpdir)) - def fetch(self, requirement, tmpdir, force_scan=False, source=False): """Obtain a file suitable for fulfilling `requirement` @@ -615,7 +606,6 @@ class PackageIndex(Environment): return dist.location return None - def gen_setup(self, filename, fragment, tmpdir): match = EGG_FRAGMENT.match(fragment) dists = match and [ @@ -770,7 +760,6 @@ class PackageIndex(Environment): def scan_url(self, url): self.process_url(url, True) - def _attempt_download(self, url, filename): headers = self._download_to(url, filename) if 'html' in headers.get('content-type','').lower(): @@ -793,21 +782,6 @@ class PackageIndex(Environment): os.unlink(filename) raise DistutilsError("Unexpected HTML page found at "+url) - - - - - - - - - - - - - - - def _download_svn(self, url, filename): url = url.split('#',1)[0] # remove any fragment for svn's sake creds = '' @@ -886,18 +860,6 @@ class PackageIndex(Environment): def warn(self, msg, *args): log.warn(msg, *args) - - - - - - - - - - - - # This pattern matches a character entity reference (a decimal numeric # references, a hexadecimal numeric reference, or a named reference). entity_sub = re.compile(r'&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?').sub @@ -922,20 +884,6 @@ def htmldecode(text): """Decode HTML entities in the given text.""" return entity_sub(decode_entity, text) - - - - - - - - - - - - - - def socket_timeout(timeout=15): def _socket_timeout(func): def _socket_timeout(*args, **kwargs): @@ -1004,15 +952,6 @@ def open_with_auth(url, opener=urllib2.urlopen): open_with_auth = socket_timeout(_SOCKET_TIMEOUT)(open_with_auth) - - - - - - - - - def fix_sf_url(url): return url # backward compatibility @@ -1042,17 +981,3 @@ def local_open(url): return HTTPError(url, status, message, {'content-type':'text/html'}, StringIO(body)) - - - - - - - - - - - - - -# this line is a kludge to keep the trailing blank lines for pje's editor -- cgit v1.2.1 From 9a3cc1cd285136180c9b59c821a01f755ddf8874 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 22:47:05 +0200 Subject: Replace import * with explicit imports, allowing linter to detect the missing imports reported in #53. --- setuptools/package_index.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 9abd9679..f2ef50d8 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -6,8 +6,12 @@ import shutil import socket import base64 +from pkg_resources import ( + CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, + require, Environment, find_distributions, safe_name, safe_version, + to_filename, Requirement, DEVELOP_DIST, +) from setuptools import ssl_support -from pkg_resources import * from distutils import log from distutils.errors import DistutilsError from setuptools.compat import (urllib2, httplib, StringIO, HTTPError, -- cgit v1.2.1 From fd77197ba1cc95ddfd2744ff8e9953bbf9f11def Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 23:00:24 +0200 Subject: Add 'urlsplit' and 'urlunsplit' to compat module --- setuptools/compat.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setuptools/compat.py b/setuptools/compat.py index e2f64de2..3a961c0e 100644 --- a/setuptools/compat.py +++ b/setuptools/compat.py @@ -29,7 +29,7 @@ if sys.version_info[0] < 3: from urllib import url2pathname import urllib2 from urllib2 import urlopen, HTTPError, URLError, unquote, splituser - from urlparse import urlparse, urlunparse, urljoin + from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit xrange = xrange filterfalse = itertools.ifilterfalse @@ -72,7 +72,10 @@ else: from urllib.error import HTTPError, URLError import urllib.request as urllib2 from urllib.request import urlopen, url2pathname - from urllib.parse import urlparse, urlunparse, unquote, splituser, urljoin + from urllib.parse import ( + urlparse, urlunparse, unquote, splituser, urljoin, urlsplit, + urlunsplit, + ) xrange = range filterfalse = itertools.filterfalse -- cgit v1.2.1 From d2f68c57b5fbca47a9389c6cf3399f956a6c2aa6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 23:01:43 +0200 Subject: Import urlsplit and urlunsplit from compat module. Fixes #53. --- setuptools/package_index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index f2ef50d8..26b6583c 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -17,7 +17,7 @@ from distutils.errors import DistutilsError from setuptools.compat import (urllib2, httplib, StringIO, HTTPError, urlparse, urlunparse, unquote, splituser, url2pathname, name2codepoint, - unichr, urljoin) + unichr, urljoin, urlsplit, urlunsplit) from setuptools.compat import filterfalse from fnmatch import translate from setuptools.py24compat import hashlib -- cgit v1.2.1 From 3d5510a01906bebf369cde304706ce5f52117afe Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 23:03:19 +0200 Subject: Make PackageIndex._vcs_split_rev_from_url a static method (as it doesn't have any instance or class references). --- setuptools/package_index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 26b6583c..9c9d76a1 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -806,7 +806,8 @@ class PackageIndex(Environment): os.system("svn checkout%s -q %s %s" % (creds, url, filename)) return filename - def _vcs_split_rev_from_url(self, url, pop_prefix=False): + @staticmethod + def _vcs_split_rev_from_url(url, pop_prefix=False): scheme, netloc, path, query, frag = urlsplit(url) scheme = scheme.split('+', 1)[-1] -- cgit v1.2.1 From 7d0d8a87e47b174e006760cc5d938c862766af60 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 24 Jul 2013 23:10:05 +0200 Subject: Add test to exercise the basic functionality of _vcs_split_rev_from_url --- setuptools/tests/test_packageindex.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index 7f5dc585..08969b7e 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -142,6 +142,15 @@ class TestPackageIndex(unittest.TestCase): self.assertEqual(setuptools.package_index.parse_bdist_wininst( 'reportlab-2.5.win-amd64.exe'), ('reportlab-2.5', None, 'win-amd64')) + def test__vcs_split_rev_from_url(self): + """ + Test the basic usage of _vcs_split_rev_from_url + """ + vsrfu = setuptools.package_index.PackageIndex._vcs_split_rev_from_url + url, rev = vsrfu('https://example.com/bar@2995') + self.assertEqual(url, 'https://example.com/bar') + self.assertEqual(rev, '2995') + class TestContentCheckers(unittest.TestCase): def test_md5(self): -- cgit v1.2.1 From 5b54c7a2e277685dd7d2c88ddf36ce0c0106b343 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 25 Jul 2013 10:26:18 +0200 Subject: Update changelog --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 41d5949a..34bdf651 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,12 @@ CHANGES ======= +----- +0.9.8 +----- + +* Issue #53: Fix NameErrors in `_vcs_split_rev_from_url`. + ----- 0.9.7 ----- -- cgit v1.2.1 From 9dcc92c2c65b80ce6f7a101af327af109f77324f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 25 Jul 2013 10:28:04 +0200 Subject: Added tag 0.9.8 for changeset e0a6e225ad6b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8f492918..21e59929 100644 --- a/.hgtags +++ b/.hgtags @@ -88,3 +88,4 @@ e3d70539e79f39a97f69674ab038661961a1eb43 0.8 88e3d6788facbb2dd6467a23c4f35529a5ce20a1 0.9.5 acc6c5d61d0f82040c237ac7ea010c0fc9e67d66 0.9.6 19965a03c1d5231c894e0fabfaf45af1fd99f484 0.9.7 +e0a6e225ad6b28471cd42cfede6e8a334bb548fb 0.9.8 -- cgit v1.2.1 From 2f182743da1da836ec7b0cf56fa5e3453cd27ca8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 25 Jul 2013 10:28:27 +0200 Subject: Bumped to 0.9.9 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 88 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 8 ++-- setuptools/__init__.py | 2 +- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 8f11fa2f..4eb79510 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -28,7 +28,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "0.9.8" +DEFAULT_VERSION = "0.9.9" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index 55aa158e..4b9fe8a6 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[distutils.setup_keywords] -exclude_package_data = setuptools.dist:check_package_data -packages = setuptools.dist:check_packages -install_requires = setuptools.dist:check_requirements -eager_resources = setuptools.dist:assert_string_list -use_2to3 = setuptools.dist:assert_bool -namespace_packages = setuptools.dist:check_nsp -package_data = setuptools.dist:check_package_data -use_2to3_exclude_fixers = setuptools.dist:assert_string_list -dependency_links = setuptools.dist:assert_string_list -use_2to3_fixers = setuptools.dist:assert_string_list -test_suite = setuptools.dist:check_test_suite -tests_require = setuptools.dist:check_requirements -test_loader = setuptools.dist:check_importable -convert_2to3_doctests = setuptools.dist:assert_string_list -include_package_data = setuptools.dist:assert_bool -extras_require = setuptools.dist:check_extras -entry_points = setuptools.dist:check_entry_points -zip_safe = setuptools.dist:assert_bool - [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl [egg_info.writers] -dependency_links.txt = setuptools.command.egg_info:overwrite_arg depends.txt = setuptools.command.egg_info:warn_depends_obsolete top_level.txt = setuptools.command.egg_info:write_toplevel_names -entry_points.txt = setuptools.command.egg_info:write_entries +namespace_packages.txt = setuptools.command.egg_info:overwrite_arg +eager_resources.txt = setuptools.command.egg_info:overwrite_arg +dependency_links.txt = setuptools.command.egg_info:overwrite_arg requires.txt = setuptools.command.egg_info:write_requirements PKG-INFO = setuptools.command.egg_info:write_pkg_info -eager_resources.txt = setuptools.command.egg_info:overwrite_arg -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg +entry_points.txt = setuptools.command.egg_info:write_entries + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main + +[distutils.setup_keywords] +dependency_links = setuptools.dist:assert_string_list +packages = setuptools.dist:check_packages +exclude_package_data = setuptools.dist:check_package_data +use_2to3_exclude_fixers = setuptools.dist:assert_string_list +package_data = setuptools.dist:check_package_data +use_2to3 = setuptools.dist:assert_bool +tests_require = setuptools.dist:check_requirements +entry_points = setuptools.dist:check_entry_points +extras_require = setuptools.dist:check_extras +include_package_data = setuptools.dist:assert_bool +eager_resources = setuptools.dist:assert_string_list +zip_safe = setuptools.dist:assert_bool +install_requires = setuptools.dist:check_requirements +use_2to3_fixers = setuptools.dist:assert_string_list +test_suite = setuptools.dist:check_test_suite +test_loader = setuptools.dist:check_importable +namespace_packages = setuptools.dist:check_nsp +convert_2to3_doctests = setuptools.dist:assert_string_list [distutils.commands] -develop = setuptools.command.develop:develop bdist_egg = setuptools.command.bdist_egg:bdist_egg -setopt = setuptools.command.setopt:setopt egg_info = setuptools.command.egg_info:egg_info -build_ext = setuptools.command.build_ext:build_ext -test = setuptools.command.test:test -install = setuptools.command.install:install -install_egg_info = setuptools.command.install_egg_info:install_egg_info -upload_docs = setuptools.command.upload_docs:upload_docs -saveopts = setuptools.command.saveopts:saveopts alias = setuptools.command.alias:alias -install_scripts = setuptools.command.install_scripts:install_scripts -build_py = setuptools.command.build_py:build_py sdist = setuptools.command.sdist:sdist +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +test = setuptools.command.test:test easy_install = setuptools.command.easy_install:easy_install -rotate = setuptools.command.rotate:rotate -install_lib = setuptools.command.install_lib:install_lib register = setuptools.command.register:register +setopt = setuptools.command.setopt:setopt +install = setuptools.command.install:install +install_scripts = setuptools.command.install_scripts:install_scripts bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main +build_ext = setuptools.command.build_ext:build_ext +rotate = setuptools.command.rotate:rotate +develop = setuptools.command.develop:develop +install_lib = setuptools.command.install_lib:install_lib +upload_docs = setuptools.command.upload_docs:upload_docs +install_egg_info = setuptools.command.install_egg_info:install_egg_info +build_py = setuptools.command.build_py:build_py +saveopts = setuptools.command.saveopts:saveopts diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 0b577c97..668f4ee2 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ -[ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 +[certs] +certifi==0.0.8 [ssl:python_version in '2.4, 2.5'] ssl==1.16 -[certs] -certifi==0.0.8 +[ssl:sys_platform=='win32' and python_version=='2.4'] +ctypes==1.0.2 [ssl:sys_platform=='win32'] wincertstore==0.1 \ No newline at end of file diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 8c708bd6..6dc64e5e 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -8,7 +8,7 @@ from distutils.util import convert_path import os import sys -__version__ = '0.9.8' +__version__ = '0.9.9' __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'find_packages' -- cgit v1.2.1 From 43f8c9aaff8c71c1c1e841827509c405c20ce909 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 25 Jul 2013 10:34:33 +0200 Subject: For docs, load the setuptools version from the setup script, where it's authoritative, rather than from the library, which might not be ./setuptools --- docs/conf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index fbdb8b51..661ac486 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,8 +14,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os -import setuptools +import setup # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -49,9 +48,9 @@ copyright = '2009-2013, The fellowship of the packaging' # built documents. # # The short X.Y version. -version = setuptools.__version__ +version = setup.setup_params['version'] # The full version, including alpha/beta/rc tags. -release = setuptools.__version__ +release = setup.setup_params['version'] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- cgit v1.2.1 From 3a53d2576dc84c77e7d2b9a8099f97cea3047215 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Jul 2013 09:52:26 +0200 Subject: Update release script to always push the bootstrap bookmark. --- release.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release.py b/release.py index bad7e0ee..da8ee859 100644 --- a/release.py +++ b/release.py @@ -7,6 +7,9 @@ import re import os import subprocess +import pkg_resources + +pkg_resources.require('jaraco.packaging>=1.1') def before_upload(): _linkify('CHANGES.txt', 'CHANGES (links).txt') @@ -20,6 +23,9 @@ test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools" os.environ["SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"] = "1" +# override the push command to include the bootstrap bookmark. +push_command = ['hg', 'push', '-B', 'bootstrap'] + link_patterns = [ r"(Issue )?#(?P\d+)", r"Distribute #(?P\d+)", -- cgit v1.2.1 From 1ead1921de7de5c980b5a75a668fcf4b4e6567bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 5 Aug 2013 00:21:36 +0200 Subject: Unlink destination file before writing scripts. --- setuptools/command/easy_install.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 3194644e..dd1e3b25 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -799,6 +799,8 @@ Please make the appropriate changes for your system and try again. mask = current_umask() if not self.dry_run: ensure_directory(target) + if os.path.exists(target): + os.unlink(target) f = open(target,"w"+mode) f.write(contents) f.close() -- cgit v1.2.1 From 2311414e0a72615785c4dcc9a1a2590b44430ab5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 07:08:48 +0200 Subject: Hint to wheel that the code is universal --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index 176cc47e..0a0079e0 100755 --- a/setup.cfg +++ b/setup.cfg @@ -16,3 +16,6 @@ upload-dir = docs/build/html [sdist] formats=gztar + +[wheel] +universal=1 -- cgit v1.2.1 From 2acd7e9e1223672687a5c628407fc8528f64246a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 17:14:16 +0200 Subject: Move version into its own file so that setuptools machinery isn't necessary to elicit the version. --HG-- extra : rebase_source : 1611131e6765a30fd0fe94d8455418ccd3ae46ae --- release.py | 2 +- setuptools/__init__.py | 2 +- setuptools/version.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 setuptools/version.py diff --git a/release.py b/release.py index da8ee859..c2b331c7 100644 --- a/release.py +++ b/release.py @@ -16,7 +16,7 @@ def before_upload(): _add_bootstrap_bookmark() files_with_versions = ( - 'ez_setup.py', 'setuptools/__init__.py', + 'ez_setup.py', 'setuptools/version.py', ) test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools" diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 6dc64e5e..45b95f90 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -7,8 +7,8 @@ from distutils.core import Command as _Command from distutils.util import convert_path import os import sys +from setuptools.version import __version__ -__version__ = '0.9.9' __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'find_packages' diff --git a/setuptools/version.py b/setuptools/version.py new file mode 100644 index 00000000..1b1a934d --- /dev/null +++ b/setuptools/version.py @@ -0,0 +1 @@ +__version__ = '0.9.9' -- cgit v1.2.1 From 047f8663da4dfe9ef6c2aa4e804d1621fde4563f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 17:16:04 +0200 Subject: Use version from version module in setup script --HG-- extra : rebase_source : b262af35810ec8ef1eacec3dd91806f53a9a6ea2 --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 629f2fff..d08d7144 100755 --- a/setup.py +++ b/setup.py @@ -20,10 +20,10 @@ init_file.close() SETUP_COMMANDS = command_ns['__all__'] main_ns = {} -init_path = convert_path('setuptools/__init__.py') -init_file = open(init_path) -exec(init_file.read(), main_ns) -init_file.close() +ver_path = convert_path('setuptools/version.py') +ver_file = open(ver_path) +exec(ver_file.read(), main_ns) +ver_file.close() import setuptools from setuptools.command.build_py import build_py as _build_py -- cgit v1.2.1 From 3e53e141e0a0f03738b3943d0b0d77b1bf49883e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 17:20:10 +0200 Subject: Sphinx allows a callable named 'setup' to be provided in the config. If present, it attempts to call it. Therefore, use another name when importing the setup module. The docs may now be built using 'setup.py build_sphinx'. --HG-- extra : rebase_source : a5f5e0d9d624f976b7a12e44adf3cc94d4f6ac44 --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 661ac486..9929aaf6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import setup +import setup as setup_script # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -48,9 +48,9 @@ copyright = '2009-2013, The fellowship of the packaging' # built documents. # # The short X.Y version. -version = setup.setup_params['version'] +version = setup_script.setup_params['version'] # The full version, including alpha/beta/rc tags. -release = setup.setup_params['version'] +release = setup_script.setup_params['version'] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- cgit v1.2.1 From d16ffd375e9c8211c4520cab688d5c2a44e5b66b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 17:37:49 +0200 Subject: Created a new section of the documentation pertaining to development. --HG-- extra : rebase_source : 4d756b98daa068d888074b53f5708c1245fa70ba --- docs/development.txt | 35 +++++++++++++++++++++++++++++++++++ docs/formats.txt | 20 -------------------- docs/index.txt | 1 + docs/releases.txt | 4 ++++ 4 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 docs/development.txt create mode 100644 docs/releases.txt diff --git a/docs/development.txt b/docs/development.txt new file mode 100644 index 00000000..ba927c73 --- /dev/null +++ b/docs/development.txt @@ -0,0 +1,35 @@ +------------------------- +Development on Setuptools +------------------------- + +Setuptools is maintained by the Python community under the Python Packaging +Authority (PyPA) and led by Jason R. Coombs. + +This document describes the process by which Setuptools is developed. +This document assumes the reader has some passing familiarity with +*using* setuptools, the ``pkg_resources`` module, and EasyInstall. It +does not attempt to explain basic concepts like inter-project +dependencies, nor does it contain detailed lexical syntax for most +file formats. Neither does it explain concepts like "namespace +packages" or "resources" in any detail, as all of these subjects are +covered at length in the setuptools developer's guide and the +``pkg_resources`` reference manual. + +Instead, this is **internal** documentation for how those concepts and +features are *implemented* in concrete terms. It is intended for people +who are working on the setuptools code base, who want to be able to +troubleshoot setuptools problems, want to write code that reads the file +formats involved, or want to otherwise tinker with setuptools-generated +files and directories. + +Note, however, that these are all internal implementation details and +are therefore subject to change; stick to the published API if you don't +want to be responsible for keeping your code from breaking when +setuptools changes. You have been warned. + +.. toctree:: + :maxdepth: 1 + + formats + releases + diff --git a/docs/formats.txt b/docs/formats.txt index dbfc2812..ef28353e 100644 --- a/docs/formats.txt +++ b/docs/formats.txt @@ -4,26 +4,6 @@ The Internal Structure of Python Eggs STOP! This is not the first document you should read! -This document assumes you have at least some passing familiarity with -*using* setuptools, the ``pkg_resources`` module, and EasyInstall. It -does not attempt to explain basic concepts like inter-project -dependencies, nor does it contain detailed lexical syntax for most -file formats. Neither does it explain concepts like "namespace -packages" or "resources" in any detail, as all of these subjects are -covered at length in the setuptools developer's guide and the -``pkg_resources`` reference manual. - -Instead, this is **internal** documentation for how those concepts and -features are *implemented* in concrete terms. It is intended for people -who are working on the setuptools code base, who want to be able to -troubleshoot setuptools problems, want to write code that reads the file -formats involved, or want to otherwise tinker with setuptools-generated -files and directories. - -Note, however, that these are all internal implementation details and -are therefore subject to change; stick to the published API if you don't -want to be responsible for keeping your code from breaking when -setuptools changes. You have been warned. .. contents:: **Table of Contents** diff --git a/docs/index.txt b/docs/index.txt index 162a5f6f..8c68651d 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -23,3 +23,4 @@ Documentation content: setuptools easy_install pkg_resources + development diff --git a/docs/releases.txt b/docs/releases.txt new file mode 100644 index 00000000..8119e8cf --- /dev/null +++ b/docs/releases.txt @@ -0,0 +1,4 @@ +========================== +Setuptools Release Process +========================== + -- cgit v1.2.1 From e324a315edb8512f59a424a7aa2038d270870a41 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 21:13:58 +0200 Subject: Fleshed out a few details on the release process. --HG-- extra : rebase_source : 6d4ed995049ac55ae4d4526960865bac2fa3d251 --- docs/releases.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/releases.txt b/docs/releases.txt index 8119e8cf..5d1419be 100644 --- a/docs/releases.txt +++ b/docs/releases.txt @@ -1,4 +1,18 @@ -========================== -Setuptools Release Process -========================== +=============== +Release Process +=============== +In order to allow for rapid, predictable releases, Setuptools uses a +mechanical technique for releases. The release script, ``release.py`` in the +repository, defines the details of the releases, and is executed by the +`jaraco.packaging `_ release +module. The script does some checks (some interactive) and fully automates +the release process. + +A Setuptools release manager must have maintainer access on PyPI to the +project and administrative access to the BitBucket project. + +Release Managers +---------------- + +Currently, the project has one release manager, Jason R. Coombs. -- cgit v1.2.1 From e550b63a52654c4c22127d373ad4e02ce1ce149d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 22:43:21 +0200 Subject: Syntax update for easy_install command --HG-- extra : rebase_source : d7fa5f788d2151d0aecf0bc7730ad73c5379320f --- setuptools/command/easy_install.py | 229 ++++++++++++++----------------------- 1 file changed, 85 insertions(+), 144 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index dd1e3b25..febfdcd1 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1,5 +1,6 @@ #!python -"""\ + +""" Easy Install ------------ @@ -10,6 +11,7 @@ file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ + import sys import os import zipimport @@ -21,10 +23,11 @@ import stat import random import platform from glob import glob +from distutils import log, dir_util + import pkg_resources from setuptools import Command, _dont_write_bytecode from setuptools.sandbox import run_setup -from distutils import log, dir_util try: # Python 2.7 or >=3.2 from sysconfig import get_config_vars, get_path @@ -51,12 +54,12 @@ from setuptools.package_index import URL_SCHEME from setuptools.command import bdist_egg, egg_info from setuptools.compat import (iteritems, maxsize, xrange, basestring, unicode, reraise) -from pkg_resources import yield_lines, normalize_path, resource_string, \ - ensure_directory, get_distribution, find_distributions, \ - Environment, Requirement, Distribution, \ - PathMetadata, EggMetadata, WorkingSet, \ - DistributionNotFound, VersionConflict, \ - DEVELOP_DIST +from pkg_resources import ( + yield_lines, normalize_path, resource_string, ensure_directory, + get_distribution, find_distributions, Environment, Requirement, + Distribution, PathMetadata, EggMetadata, WorkingSet, DistributionNotFound, + VersionConflict, DEVELOP_DIST, +) if '__VENV_LAUNCHER__' in os.environ: sys_executable = os.environ['__VENV_LAUNCHER__'] @@ -75,7 +78,7 @@ import struct def is_64bit(): return struct.calcsize("P") == 8 -def samefile(p1,p2): +def samefile(p1, p2): if hasattr(os.path,'samefile') and ( os.path.exists(p1) and os.path.exists(p2) ): @@ -126,19 +129,20 @@ class easy_install(Command): ("build-directory=", "b", "download/extract/build in DIR; keep the results"), ('optimize=', 'O', - "also compile with optimization: -O1 for \"python -O\", " - "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), + "also compile with optimization: -O1 for \"python -O\", " + "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('record=', None, - "filename in which to record list of installed files"), + "filename in which to record list of installed files"), ('always-unzip', 'Z', "don't install as a zipfile, no matter what"), ('site-dirs=','S',"list of directories where .pth files work"), ('editable', 'e', "Install specified packages in editable form"), ('no-deps', 'N', "don't install dependencies"), ('allow-hosts=', 'H', "pattern(s) that hostnames must match"), - ('local-snapshots-ok', 'l', "allow building eggs from local checkouts"), + ('local-snapshots-ok', 'l', + "allow building eggs from local checkouts"), ('version', None, "print version information and exit"), ('no-find-links', None, - "Don't load find-links defined in packages being installed") + "Don't load find-links defined in packages being installed") ] boolean_options = [ 'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy', @@ -147,11 +151,10 @@ class easy_install(Command): ] if HAS_USER_SITE: - user_options.append(('user', None, - "install in user site-package '%s'" % site.USER_SITE)) + help_msg = "install in user site-package '%s'" % site.USER_SITE + user_options.append(('user', None, help_msg)) boolean_options.append('user') - negative_opt = {'always-unzip': 'zip-ok'} create_index = PackageIndex @@ -226,19 +229,20 @@ class easy_install(Command): py_version = sys.version.split()[0] prefix, exec_prefix = get_config_vars('prefix', 'exec_prefix') - self.config_vars = {'dist_name': self.distribution.get_name(), - 'dist_version': self.distribution.get_version(), - 'dist_fullname': self.distribution.get_fullname(), - 'py_version': py_version, - 'py_version_short': py_version[0:3], - 'py_version_nodot': py_version[0] + py_version[2], - 'sys_prefix': prefix, - 'prefix': prefix, - 'sys_exec_prefix': exec_prefix, - 'exec_prefix': exec_prefix, - # Only python 3.2+ has abiflags - 'abiflags': getattr(sys, 'abiflags', ''), - } + self.config_vars = { + 'dist_name': self.distribution.get_name(), + 'dist_version': self.distribution.get_version(), + 'dist_fullname': self.distribution.get_fullname(), + 'py_version': py_version, + 'py_version_short': py_version[0:3], + 'py_version_nodot': py_version[0] + py_version[2], + 'sys_prefix': prefix, + 'prefix': prefix, + 'sys_exec_prefix': exec_prefix, + 'exec_prefix': exec_prefix, + # Only python 3.2+ has abiflags + 'abiflags': getattr(sys, 'abiflags', ''), + } if HAS_USER_SITE: self.config_vars['userbase'] = self.install_userbase @@ -351,7 +355,6 @@ class easy_install(Command): self.outputs = [] - def _expand_attrs(self, attrs): for attr in attrs: val = getattr(self, attr) @@ -456,7 +459,7 @@ class easy_install(Command): self.install_dir = instdir def cant_write_to_target(self): - msg = """can't create or remove files in install directory + template = """can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: @@ -467,7 +470,8 @@ The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s -""" % (sys.exc_info()[1], self.install_dir,) +""" + msg = template % (sys.exc_info()[1], self.install_dir,) if not os.path.exists(self.install_dir): msg += """ @@ -493,9 +497,6 @@ Please make the appropriate changes for your system and try again. """ raise DistutilsError(msg) - - - def check_pth_processing(self): """Empirically verify whether .pth files are supported in inst. dir""" instdir = self.install_dir @@ -580,11 +581,6 @@ Please make the appropriate changes for your system and try again. (spec.key, self.build_directory) ) - - - - - def easy_install(self, spec, deps=False): tmpdir = tempfile.mkdtemp(prefix="easy_install-") download = None @@ -662,8 +658,6 @@ Please make the appropriate changes for your system and try again. if dist in spec: return dist - - def select_scheme(self, name): """Sets the install directories by applying the install schemes.""" # it's the caller's problem if they supply a bad name! @@ -673,9 +667,6 @@ Please make the appropriate changes for your system and try again. if getattr(self, attrname) is None: setattr(self, attrname, scheme[key]) - - - def process_distribution(self, requirement, dist, deps=True, *info): self.update_pth(dist) self.package_index.add(dist) @@ -684,7 +675,7 @@ Please make the appropriate changes for your system and try again. self.installed_projects[dist.key] = dist log.info(self.installation_report(requirement, dist, *info)) if (dist.has_metadata('dependency_links.txt') and - not self.no_find_links): + not self.no_find_links): self.package_index.add_find_links( dist.get_metadata_lines('dependency_links.txt') ) @@ -735,10 +726,8 @@ Please make the appropriate changes for your system and try again. def maybe_move(self, spec, dist_filename, setup_base): dst = os.path.join(self.build_directory, spec.key) if os.path.exists(dst): - log.warn( - "%r already exists in %s; build directory %s will not be kept", - spec.key, self.build_directory, setup_base - ) + msg = "%r already exists in %s; build directory %s will not be kept" + log.warn(msg, spec.key, self.build_directory, setup_base) return setup_base if os.path.isdir(dist_filename): setup_base = dist_filename @@ -751,7 +740,8 @@ Please make the appropriate changes for your system and try again. if os.path.isdir(dist_filename): # if the only thing there is a directory, move it instead setup_base = dist_filename - ensure_directory(dst); shutil.move(setup_base, dst) + ensure_directory(dst) + shutil.move(setup_base, dst) return dst def install_wrapper_scripts(self, dist): @@ -759,8 +749,6 @@ Please make the appropriate changes for your system and try again. for args in get_script_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""" spec = str(dist.as_requirement()) @@ -806,9 +794,6 @@ Please make the appropriate changes for your system and try again. f.close() chmod(target, 0x1FF-mask) # 0777 - - - def install_eggs(self, spec, dist_filename, tmpdir): # .egg dirs or files are already built, so just return them if dist_filename.lower().endswith('.egg'): @@ -824,8 +809,7 @@ Please make the appropriate changes for your system and try again. setup_base = os.path.abspath(dist_filename) if (setup_base.startswith(tmpdir) # something we downloaded - and self.build_directory and spec is not None - ): + and self.build_directory and spec is not None): setup_base = self.maybe_move(spec, dist_filename, setup_base) # Find the setup.py file @@ -899,14 +883,15 @@ Please make the appropriate changes for your system and try again. "%s is not a valid distutils Windows .exe" % dist_filename ) # Create a dummy distribution object until we build the real distro - dist = Distribution(None, + dist = Distribution( + None, project_name=cfg.get('metadata','name'), - version=cfg.get('metadata','version'), platform=get_platform() + version=cfg.get('metadata','version'), platform=get_platform(), ) # Convert the .exe to an unpacked egg egg_path = dist.location = os.path.join(tmpdir, dist.egg_name()+'.egg') - egg_tmp = egg_path+'.tmp' + egg_tmp = egg_path + '.tmp' egg_info = os.path.join(egg_tmp, 'EGG-INFO') pkg_inf = os.path.join(egg_info, 'PKG-INFO') ensure_directory(pkg_inf) # make sure EGG-INFO dir exists @@ -967,7 +952,8 @@ Please make the appropriate changes for your system and try again. resource = parts[-1] parts[-1] = bdist_egg.strip_module(parts[-1])+'.py' pyfile = os.path.join(egg_tmp, *parts) - to_compile.append(pyfile); stubs.append(pyfile) + to_compile.append(pyfile) + stubs.append(pyfile) bdist_egg.write_stub(resource, pyfile) self.byte_compile(to_compile) # compile .py's bdist_egg.write_safety_flag(os.path.join(egg_tmp,'EGG-INFO'), @@ -1166,8 +1152,7 @@ See the setuptools documentation for the "develop" command for more info. cfg_filename = os.path.join(base, 'setup.cfg') setopt.edit_config(cfg_filename, settings) - - def update_pth(self,dist): + def update_pth(self, dist): if self.pth_file is None: return @@ -1209,9 +1194,10 @@ See the setuptools documentation for the "develop" command for more info. return dst # only unpack-and-compile skips files for dry run def unpack_and_compile(self, egg_path, destination): - to_compile = []; to_chmod = [] + to_compile = [] + to_chmod = [] - def pf(src,dst): + def pf(src, dst): if dst.endswith('.py') and not src.startswith('EGG-INFO/'): to_compile.append(dst) elif dst.endswith('.dll') or dst.endswith('.so'): @@ -1245,16 +1231,8 @@ See the setuptools documentation for the "develop" command for more info. finally: log.set_verbosity(self.verbose) # restore original verbosity - - - - - - - - def no_default_version_msg(self): - return """bad install directory or PYTHONPATH + template = """bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The @@ -1281,18 +1259,8 @@ Here are some of your options for correcting the problem: https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations -Please make the appropriate changes for your system and try again.""" % ( - self.install_dir, os.environ.get('PYTHONPATH','') - ) - - - - - - - - - +Please make the appropriate changes for your system and try again.""" + return template % self.install_dir, os.environ.get('PYTHONPATH','') def install_site_py(self): """Make sure there's a site.py in the target dir, if needed""" @@ -1330,9 +1298,6 @@ Please make the appropriate changes for your system and try again.""" % ( self.sitepy_installed = True - - - def create_home_path(self): """Create directories under ~.""" if not self.user: @@ -1343,22 +1308,16 @@ Please make the appropriate changes for your system and try again.""" % ( self.debug_print("os.makedirs('%s', 0700)" % path) os.makedirs(path, 0x1C0) # 0700 - - - - - - INSTALL_SCHEMES = dict( posix = dict( install_dir = '$base/lib/python$py_version_short/site-packages', - script_dir = '$base/bin', + script_dir = '$base/bin', ), ) DEFAULT_SCHEME = dict( install_dir = '$base/Lib/site-packages', - script_dir = '$base/Scripts', + script_dir = '$base/Scripts', ) def _expand(self, *attrs): @@ -1382,14 +1341,6 @@ Please make the appropriate changes for your system and try again.""" % ( val = os.path.expanduser(val) setattr(self, attr, val) - - - - - - - - def get_site_dirs(): # return a list of 'site' dirs sitedirs = [_f for _f in os.environ.get('PYTHONPATH', @@ -1524,12 +1475,6 @@ def extract_wininst_cfg(dist_filename): f.close() - - - - - - def get_exe_prefixes(exe_filename): """Get exe->egg path translations for a given .exe file""" @@ -1563,7 +1508,8 @@ def get_exe_prefixes(exe_filename): finally: z.close() prefixes = [(x.lower(),y) for x, y in prefixes] - prefixes.sort(); prefixes.reverse() + prefixes.sort() + prefixes.reverse() return prefixes @@ -1584,7 +1530,8 @@ class PthDistributions(Environment): self.filename = filename self.sitedirs = list(map(normalize_path, sitedirs)) self.basedir = normalize_path(os.path.dirname(self.filename)) - self._load(); Environment.__init__(self, [], None, None) + self._load() + Environment.__init__(self, [], None, None) for path in yield_lines(self.paths): list(map(self.add, find_distributions(path, True))) @@ -1639,7 +1586,8 @@ class PthDistributions(Environment): if os.path.islink(self.filename): os.unlink(self.filename) f = open(self.filename,'wt') - f.write(data); f.close() + f.write(data) + f.close() elif os.path.exists(self.filename): log.debug("Deleting empty %s", self.filename) @@ -1647,22 +1595,22 @@ class PthDistributions(Environment): self.dirty = False - def add(self,dist): + def add(self, dist): """Add `dist` to the distribution map""" if (dist.location not in self.paths and ( dist.location not in self.sitedirs or - dist.location == os.getcwd() #account for '.' being in PYTHONPATH + dist.location == os.getcwd() # account for '.' being in PYTHONPATH )): self.paths.append(dist.location) self.dirty = True - Environment.add(self,dist) + Environment.add(self, dist) - def remove(self,dist): + def remove(self, dist): """Remove `dist` from the distribution map""" while dist.location in self.paths: - self.paths.remove(dist.location); self.dirty = True - Environment.remove(self,dist) - + self.paths.remove(dist.location) + self.dirty = True + Environment.remove(self, dist) def make_relative(self,path): npath, last = os.path.split(normalize_path(path)) @@ -1784,14 +1732,6 @@ def nt_quote_arg(arg): return ''.join(result) - - - - - - - - def is_python_script(script_text, filename): """Is this text, as a whole, a Python script? (as opposed to shell/bat/etc. """ @@ -1830,10 +1770,11 @@ def fix_jython_executable(executable, options): # shebang line interpreter) if options: # Can't apply the workaround, leave it broken - log.warn("WARNING: Unable to adapt shebang line for Jython," - " the following script is NOT executable\n" - " see http://bugs.jython.org/issue1112 for" - " more information.") + log.warn( + "WARNING: Unable to adapt shebang line for Jython," + " the following script is NOT executable\n" + " see http://bugs.jython.org/issue1112 for" + " more information.") else: return '/usr/bin/env %s' % executable return executable @@ -1957,8 +1898,11 @@ def current_umask(): def bootstrap(): # This function is called when setuptools*.egg is run using /bin/sh - import setuptools; argv0 = os.path.dirname(setuptools.__path__[0]) - sys.argv[0] = argv0; sys.argv.append(argv0); main() + import setuptools + argv0 = os.path.dirname(setuptools.__path__[0]) + sys.argv[0] = argv0 + sys.argv.append(argv0) + main() def main(argv=None, **kw): from setuptools import setup @@ -1970,9 +1914,10 @@ usage: %(script)s [options] requirement_or_url ... or: %(script)s --help """ - def gen_usage (script_name): - script = os.path.basename(script_name) - return USAGE % vars() + def gen_usage(script_name): + return USAGE % dict( + script=os.path.basename(script_name), + ) def with_ei_usage(f): old_gen_usage = distutils.core.gen_usage @@ -1998,7 +1943,3 @@ usage: %(script)s [options] requirement_or_url ... distclass=DistributionWithoutHelpCommands, **kw ) ) - - - - -- cgit v1.2.1 From e15ad8afcac113fb1091a4a8951d8e59adbd5ba9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 22:56:52 +0200 Subject: Beginning extraction of ScriptWriter classes for writing console and gui scripts --HG-- extra : rebase_source : 24c34791314ba58ecb0c7dca7bd7fa02a3a84949 --- setuptools/command/easy_install.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index febfdcd1..bac38d76 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1780,24 +1780,27 @@ def fix_jython_executable(executable, options): return executable +class ScriptWriter(object): + template = ( + "# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" + "__requires__ = %(spec)r\n" + "import sys\n" + "from pkg_resources import load_entry_point\n" + "\n" + "if __name__ == '__main__':" + "\n" + " sys.exit(\n" + " load_entry_point(%(spec)r, %(group)r, %(name)r)()\n" + " )\n" + ) + def get_script_args(dist, executable=sys_executable, wininst=False): """Yield write_script() argument tuples for a distribution's entrypoints""" spec = str(dist.as_requirement()) header = get_script_header("", executable, wininst) for group in 'console_scripts', 'gui_scripts': for name, ep in dist.get_entry_map(group).items(): - script_text = ( - "# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" - "__requires__ = %(spec)r\n" - "import sys\n" - "from pkg_resources import load_entry_point\n" - "\n" - "if __name__ == '__main__':" - "\n" - " sys.exit(\n" - " load_entry_point(%(spec)r, %(group)r, %(name)r)()\n" - " )\n" - ) % locals() + script_text = ScriptWriter.template % locals() if sys.platform=='win32' or wininst: # On Windows/wininst, add a .py extension and an .exe launcher if group=='gui_scripts': -- cgit v1.2.1 From 46196e8239a9a8f523774f7d48bdf3b810bd083b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 23:00:28 +0200 Subject: extract launcher type indication --HG-- extra : rebase_source : 940b4a8a2c6efe60a2c532e943173ccff0515790 --- setuptools/command/easy_install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index bac38d76..e667d0a3 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1798,12 +1798,13 @@ def get_script_args(dist, executable=sys_executable, wininst=False): """Yield write_script() argument tuples for a distribution's entrypoints""" spec = str(dist.as_requirement()) header = get_script_header("", executable, wininst) - for group in 'console_scripts', 'gui_scripts': + for type_ in 'console', 'gui': + group = type_ + '_scripts' for name, ep in dist.get_entry_map(group).items(): script_text = ScriptWriter.template % locals() if sys.platform=='win32' or wininst: # On Windows/wininst, add a .py extension and an .exe launcher - if group=='gui_scripts': + if type_=='gui': launcher_type = 'gui' ext = '-script.pyw' old = ['.pyw'] -- cgit v1.2.1 From c1d0c2734b87687777adf584c2e2a9a457de3307 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 23:04:36 +0200 Subject: Moved get_script_args into a ScriptWriter class method --HG-- extra : rebase_source : 2acd6e7c81e54fa495f8b0eaf667b77f40c6495a --- setuptools/command/easy_install.py | 84 ++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index e667d0a3..49bf20c3 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1794,47 +1794,51 @@ class ScriptWriter(object): " )\n" ) -def get_script_args(dist, executable=sys_executable, wininst=False): - """Yield write_script() argument tuples for a distribution's entrypoints""" - spec = str(dist.as_requirement()) - header = get_script_header("", executable, wininst) - for type_ in 'console', 'gui': - group = type_ + '_scripts' - for name, ep in dist.get_entry_map(group).items(): - script_text = ScriptWriter.template % locals() - if sys.platform=='win32' or wininst: - # On Windows/wininst, add a .py extension and an .exe launcher - if type_=='gui': - launcher_type = 'gui' - ext = '-script.pyw' - old = ['.pyw'] - new_header = re.sub('(?i)python.exe','pythonw.exe',header) - else: - launcher_type = 'cli' - ext = '-script.py' - old = ['.py','.pyc','.pyo'] - new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': - hdr = new_header + @classmethod + def get_script_args(cls, dist, executable=sys_executable, wininst=False): + """Yield write_script() argument tuples for a distribution's entrypoints""" + spec = str(dist.as_requirement()) + header = get_script_header("", executable, wininst) + for type_ in 'console', 'gui': + group = type_ + '_scripts' + for name, ep in dist.get_entry_map(group).items(): + script_text = cls.template % locals() + if sys.platform=='win32' or wininst: + # On Windows/wininst, add a .py extension and an .exe launcher + if type_=='gui': + launcher_type = 'gui' + ext = '-script.pyw' + old = ['.pyw'] + new_header = re.sub('(?i)python.exe','pythonw.exe',header) + else: + launcher_type = 'cli' + ext = '-script.py' + old = ['.py','.pyc','.pyo'] + new_header = re.sub('(?i)pythonw.exe','python.exe',header) + if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': + hdr = new_header + else: + hdr = header + yield (name+ext, hdr+script_text, 't', [name+x for x in old]) + yield ( + name+'.exe', get_win_launcher(launcher_type), + 'b' # write in binary mode + ) + if not is_64bit(): + # install a manifest for the launcher to prevent Windows + # from detecting it as an installer (which it will for + # launchers like easy_install.exe). Consider only + # adding a manifest for launchers detected as installers. + # See Distribute #143 for details. + m_name = name + '.exe.manifest' + yield (m_name, load_launcher_manifest(name), 't') else: - hdr = header - yield (name+ext, hdr+script_text, 't', [name+x for x in old]) - yield ( - name+'.exe', get_win_launcher(launcher_type), - 'b' # write in binary mode - ) - if not is_64bit(): - # install a manifest for the launcher to prevent Windows - # from detecting it as an installer (which it will for - # launchers like easy_install.exe). Consider only - # adding a manifest for launchers detected as installers. - # See Distribute #143 for details. - m_name = name + '.exe.manifest' - yield (m_name, load_launcher_manifest(name), 't') - else: - # On other platforms, we assume the right thing to do is to - # just write the stub with no extension. - yield (name, header+script_text) + # On other platforms, we assume the right thing to do is to + # just write the stub with no extension. + yield (name, header+script_text) + +# for backward-compatibility +get_script_args = ScriptWriter.get_script_args def get_win_launcher(type): """ -- cgit v1.2.1 From 82d2bd87c1019450433d6be2188381cacdeb4b29 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 23:10:27 +0200 Subject: Extract protected _get_script_args to capture type parameter. --HG-- extra : rebase_source : d5458d1469b8b411d3937fa52996fdf96e601029 --- setuptools/command/easy_install.py | 77 ++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 49bf20c3..b7660744 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1797,45 +1797,50 @@ class ScriptWriter(object): @classmethod def get_script_args(cls, dist, executable=sys_executable, wininst=False): """Yield write_script() argument tuples for a distribution's entrypoints""" + for type_ in 'console', 'gui': + for res in cls._get_script_args(type_, dist, executable, wininst): + yield res + + @classmethod + def _get_script_args(cls, type_, dist, executable, wininst): spec = str(dist.as_requirement()) header = get_script_header("", executable, wininst) - for type_ in 'console', 'gui': - group = type_ + '_scripts' - for name, ep in dist.get_entry_map(group).items(): - script_text = cls.template % locals() - if sys.platform=='win32' or wininst: - # On Windows/wininst, add a .py extension and an .exe launcher - if type_=='gui': - launcher_type = 'gui' - ext = '-script.pyw' - old = ['.pyw'] - new_header = re.sub('(?i)python.exe','pythonw.exe',header) - else: - launcher_type = 'cli' - ext = '-script.py' - old = ['.py','.pyc','.pyo'] - new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': - hdr = new_header - else: - hdr = header - yield (name+ext, hdr+script_text, 't', [name+x for x in old]) - yield ( - name+'.exe', get_win_launcher(launcher_type), - 'b' # write in binary mode - ) - if not is_64bit(): - # install a manifest for the launcher to prevent Windows - # from detecting it as an installer (which it will for - # launchers like easy_install.exe). Consider only - # adding a manifest for launchers detected as installers. - # See Distribute #143 for details. - m_name = name + '.exe.manifest' - yield (m_name, load_launcher_manifest(name), 't') + group = type_ + '_scripts' + for name, ep in dist.get_entry_map(group).items(): + script_text = cls.template % locals() + if sys.platform=='win32' or wininst: + # On Windows/wininst, add a .py extension and an .exe launcher + if type_=='gui': + launcher_type = 'gui' + ext = '-script.pyw' + old = ['.pyw'] + new_header = re.sub('(?i)python.exe','pythonw.exe',header) + else: + launcher_type = 'cli' + ext = '-script.py' + old = ['.py','.pyc','.pyo'] + new_header = re.sub('(?i)pythonw.exe','python.exe',header) + if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': + hdr = new_header else: - # On other platforms, we assume the right thing to do is to - # just write the stub with no extension. - yield (name, header+script_text) + hdr = header + yield (name+ext, hdr+script_text, 't', [name+x for x in old]) + yield ( + name+'.exe', get_win_launcher(launcher_type), + 'b' # write in binary mode + ) + if not is_64bit(): + # install a manifest for the launcher to prevent Windows + # from detecting it as an installer (which it will for + # launchers like easy_install.exe). Consider only + # adding a manifest for launchers detected as installers. + # See Distribute #143 for details. + m_name = name + '.exe.manifest' + yield (m_name, load_launcher_manifest(name), 't') + else: + # On other platforms, we assume the right thing to do is to + # just write the stub with no extension. + yield (name, header+script_text) # for backward-compatibility get_script_args = ScriptWriter.get_script_args -- cgit v1.2.1 From 29e0ce1ef9eaa7854167f281c98c4fe9eb3891ff Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 23:30:30 +0200 Subject: Adapted signature on _get_script_args so it accurately abstracts windows/other behavior. --HG-- extra : rebase_source : f57970b6ee6a79e0ef4dc277356e789ff8a341ff --- setuptools/command/easy_install.py | 85 ++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b7660744..cbcc7c85 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1796,51 +1796,54 @@ class ScriptWriter(object): @classmethod def get_script_args(cls, dist, executable=sys_executable, wininst=False): - """Yield write_script() argument tuples for a distribution's entrypoints""" + """ + Yield write_script() argument tuples for a distribution's entrypoints + """ + spec = str(dist.as_requirement()) + header = get_script_header("", executable, wininst) for type_ in 'console', 'gui': - for res in cls._get_script_args(type_, dist, executable, wininst): - yield res + group = type_ + '_scripts' + for name, ep in dist.get_entry_map(group).items(): + script_text = cls.template % locals() + for res in cls._get_script_args(type_, name, header, + script_text, wininst): + yield res @classmethod - def _get_script_args(cls, type_, dist, executable, wininst): - spec = str(dist.as_requirement()) - header = get_script_header("", executable, wininst) - group = type_ + '_scripts' - for name, ep in dist.get_entry_map(group).items(): - script_text = cls.template % locals() - if sys.platform=='win32' or wininst: - # On Windows/wininst, add a .py extension and an .exe launcher - if type_=='gui': - launcher_type = 'gui' - ext = '-script.pyw' - old = ['.pyw'] - new_header = re.sub('(?i)python.exe','pythonw.exe',header) - else: - launcher_type = 'cli' - ext = '-script.py' - old = ['.py','.pyc','.pyo'] - new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': - hdr = new_header - else: - hdr = header - yield (name+ext, hdr+script_text, 't', [name+x for x in old]) - yield ( - name+'.exe', get_win_launcher(launcher_type), - 'b' # write in binary mode - ) - if not is_64bit(): - # install a manifest for the launcher to prevent Windows - # from detecting it as an installer (which it will for - # launchers like easy_install.exe). Consider only - # adding a manifest for launchers detected as installers. - # See Distribute #143 for details. - m_name = name + '.exe.manifest' - yield (m_name, load_launcher_manifest(name), 't') + def _get_script_args(cls, type_, name, dist, executable, wininst): + if sys.platform=='win32' or wininst: + # On Windows/wininst, add a .py extension and an .exe launcher + if type_=='gui': + launcher_type = 'gui' + ext = '-script.pyw' + old = ['.pyw'] + new_header = re.sub('(?i)python.exe','pythonw.exe',header) else: - # On other platforms, we assume the right thing to do is to - # just write the stub with no extension. - yield (name, header+script_text) + launcher_type = 'cli' + ext = '-script.py' + old = ['.py','.pyc','.pyo'] + new_header = re.sub('(?i)pythonw.exe','python.exe',header) + if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': + hdr = new_header + else: + hdr = header + yield (name+ext, hdr+script_text, 't', [name+x for x in old]) + yield ( + name+'.exe', get_win_launcher(launcher_type), + 'b' # write in binary mode + ) + if not is_64bit(): + # install a manifest for the launcher to prevent Windows + # from detecting it as an installer (which it will for + # launchers like easy_install.exe). Consider only + # adding a manifest for launchers detected as installers. + # See Distribute #143 for details. + m_name = name + '.exe.manifest' + yield (m_name, load_launcher_manifest(name), 't') + else: + # On other platforms, we assume the right thing to do is to + # just write the stub with no extension. + yield (name, header+script_text) # for backward-compatibility get_script_args = ScriptWriter.get_script_args -- cgit v1.2.1 From 1c7102c9ffa7735769b90ab5c7d02357c6dfa41d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 23:40:20 +0200 Subject: Move specialized Windows behavior to a specialized subclass --HG-- extra : rebase_source : f56a411c3cace611952133b96a48ed92888f75a1 --- setuptools/command/easy_install.py | 84 ++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index cbcc7c85..fbf3245c 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1799,51 +1799,63 @@ class ScriptWriter(object): """ Yield write_script() argument tuples for a distribution's entrypoints """ + gen_class = cls.get_writer(wininst) spec = str(dist.as_requirement()) header = get_script_header("", executable, wininst) for type_ in 'console', 'gui': group = type_ + '_scripts' for name, ep in dist.get_entry_map(group).items(): - script_text = cls.template % locals() - for res in cls._get_script_args(type_, name, header, - script_text, wininst): + script_text = gen_class.template % locals() + for res in gen_class._get_script_args(type_, name, header, + script_text): yield res @classmethod - def _get_script_args(cls, type_, name, dist, executable, wininst): - if sys.platform=='win32' or wininst: - # On Windows/wininst, add a .py extension and an .exe launcher - if type_=='gui': - launcher_type = 'gui' - ext = '-script.pyw' - old = ['.pyw'] - new_header = re.sub('(?i)python.exe','pythonw.exe',header) - else: - launcher_type = 'cli' - ext = '-script.py' - old = ['.py','.pyc','.pyo'] - new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': - hdr = new_header - else: - hdr = header - yield (name+ext, hdr+script_text, 't', [name+x for x in old]) - yield ( - name+'.exe', get_win_launcher(launcher_type), - 'b' # write in binary mode - ) - if not is_64bit(): - # install a manifest for the launcher to prevent Windows - # from detecting it as an installer (which it will for - # launchers like easy_install.exe). Consider only - # adding a manifest for launchers detected as installers. - # See Distribute #143 for details. - m_name = name + '.exe.manifest' - yield (m_name, load_launcher_manifest(name), 't') + def get_writer(cls, force_windows): + if force_windows or sys.platform=='win32': + return WindowsScriptWriter + return cls + + @classmethod + def _get_script_args(cls, type_, name, header, script_text): + # Simply write the stub with no extension. + yield (name, header+script_text) + + +class WindowsScriptWriter(ScriptWriter): + @classmethod + def _get_script_args(cls, type_, name, header, script_text): + """ + For Windows, add a .py extension and an .exe launcher + """ + if type_=='gui': + launcher_type = 'gui' + ext = '-script.pyw' + old = ['.pyw'] + new_header = re.sub('(?i)python.exe','pythonw.exe',header) else: - # On other platforms, we assume the right thing to do is to - # just write the stub with no extension. - yield (name, header+script_text) + launcher_type = 'cli' + ext = '-script.py' + old = ['.py','.pyc','.pyo'] + new_header = re.sub('(?i)pythonw.exe','python.exe',header) + if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': + hdr = new_header + else: + hdr = header + yield (name+ext, hdr+script_text, 't', [name+x for x in old]) + yield ( + name+'.exe', get_win_launcher(launcher_type), + 'b' # write in binary mode + ) + if not is_64bit(): + # install a manifest for the launcher to prevent Windows + # from detecting it as an installer (which it will for + # launchers like easy_install.exe). Consider only + # adding a manifest for launchers detected as installers. + # See Distribute #143 for details. + m_name = name + '.exe.manifest' + yield (m_name, load_launcher_manifest(name), 't') + # for backward-compatibility get_script_args = ScriptWriter.get_script_args -- cgit v1.2.1 From 8d09363e908c030761026e9400283db10213b625 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 5 Aug 2013 23:57:22 +0200 Subject: Name variable for clarity --HG-- extra : rebase_source : 6787fb9e99b28fa2d9504d18018878ccf193d521 --- setuptools/command/easy_install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index fbf3245c..5066d666 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1842,7 +1842,8 @@ class WindowsScriptWriter(ScriptWriter): hdr = new_header else: hdr = header - yield (name+ext, hdr+script_text, 't', [name+x for x in old]) + blockers = [name+x for x in old] + yield (name+ext, hdr+script_text, 't', blockers) yield ( name+'.exe', get_win_launcher(launcher_type), 'b' # write in binary mode -- cgit v1.2.1 From 6c256c7653a517912e603187111cfafc7c82d7dc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Aug 2013 00:25:19 +0200 Subject: Extract _adjust_header method --HG-- extra : rebase_source : 63809401ac0769504a143981e518ef31488ea400 --- setuptools/command/easy_install.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 5066d666..b1838024 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1832,16 +1832,11 @@ class WindowsScriptWriter(ScriptWriter): launcher_type = 'gui' ext = '-script.pyw' old = ['.pyw'] - new_header = re.sub('(?i)python.exe','pythonw.exe',header) else: launcher_type = 'cli' ext = '-script.py' old = ['.py','.pyc','.pyo'] - new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if os.path.exists(new_header[2:-1].strip('"')) or sys.platform!='win32': - hdr = new_header - else: - hdr = header + hdr = cls._adjust_header(type_, header) blockers = [name+x for x in old] yield (name+ext, hdr+script_text, 't', blockers) yield ( @@ -1857,6 +1852,23 @@ class WindowsScriptWriter(ScriptWriter): m_name = name + '.exe.manifest' yield (m_name, load_launcher_manifest(name), 't') + @staticmethod + def _adjust_header(type_, orig_header): + """ + Make sure 'pythonw' is used for gui and and 'python' is used for + console (regardless of what sys.executable is). + """ + pattern = 'pythonw.exe' + repl = 'python.exe' + if type_ == 'gui': + pattern, repl = repl, pattern + new_header = re.sub(string=orig_header, pattern=re.escape(pattern), + repl=repl, flags=re.IGNORECASE) + 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 # for backward-compatibility get_script_args = ScriptWriter.get_script_args -- cgit v1.2.1 From a78c722a5cb3756dd0fb83badc66c50fda85c144 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Aug 2013 10:38:01 +0200 Subject: Use a pattern object to invoke the substitution in _adjust_header, restoring Python 2.4-2.6 compatibility. --HG-- extra : rebase_source : 4245d65731ca4433c80cf260906085500ab6c357 --- setuptools/command/easy_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b1838024..f82125d6 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1862,8 +1862,8 @@ class WindowsScriptWriter(ScriptWriter): repl = 'python.exe' if type_ == 'gui': pattern, repl = repl, pattern - new_header = re.sub(string=orig_header, pattern=re.escape(pattern), - repl=repl, flags=re.IGNORECASE) + pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE) + new_header = pattern_ob.sub(string=orig_header, repl=repl) 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 -- cgit v1.2.1 From e8319c9ece0460cb905e92c31756fd86d6b88cc7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Aug 2013 10:48:46 +0200 Subject: Add docstring --HG-- extra : rebase_source : 79c95e70593d4e4177c3c1f9625e427d9ce0a16c --- setuptools/command/easy_install.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index f82125d6..6c1ea631 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1781,6 +1781,11 @@ def fix_jython_executable(executable, options): class ScriptWriter(object): + """ + Encapsulates behavior around writing entry point scripts for console and + gui apps. + """ + template = ( "# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" "__requires__ = %(spec)r\n" -- cgit v1.2.1 From 89132919af71ebee6af2ab46288321e56c48a780 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 6 Aug 2013 10:52:43 +0200 Subject: Use a single, multiline literal to express the template for clarity. --HG-- extra : rebase_source : df5f817f45451b3a2c4093c12bb7b2b51f8ff3b7 --- setuptools.egg-info/entry_points.txt | 124 +++++++++++++++++------------------ setuptools/command/easy_install.py | 24 +++---- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index 4b9fe8a6..ba887a08 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[setuptools.file_finders] -svn_cvs = setuptools.command.sdist:_default_revctrl - -[egg_info.writers] -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -top_level.txt = setuptools.command.egg_info:write_toplevel_names -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -eager_resources.txt = setuptools.command.egg_info:overwrite_arg -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -requires.txt = setuptools.command.egg_info:write_requirements -PKG-INFO = setuptools.command.egg_info:write_pkg_info -entry_points.txt = setuptools.command.egg_info:write_entries - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main - -[distutils.setup_keywords] -dependency_links = setuptools.dist:assert_string_list -packages = setuptools.dist:check_packages -exclude_package_data = setuptools.dist:check_package_data -use_2to3_exclude_fixers = setuptools.dist:assert_string_list -package_data = setuptools.dist:check_package_data -use_2to3 = setuptools.dist:assert_bool -tests_require = setuptools.dist:check_requirements -entry_points = setuptools.dist:check_entry_points -extras_require = setuptools.dist:check_extras -include_package_data = setuptools.dist:assert_bool -eager_resources = setuptools.dist:assert_string_list -zip_safe = setuptools.dist:assert_bool -install_requires = setuptools.dist:check_requirements -use_2to3_fixers = setuptools.dist:assert_string_list -test_suite = setuptools.dist:check_test_suite -test_loader = setuptools.dist:check_importable -namespace_packages = setuptools.dist:check_nsp -convert_2to3_doctests = setuptools.dist:assert_string_list - -[distutils.commands] -bdist_egg = setuptools.command.bdist_egg:bdist_egg -egg_info = setuptools.command.egg_info:egg_info -alias = setuptools.command.alias:alias -sdist = setuptools.command.sdist:sdist -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -test = setuptools.command.test:test -easy_install = setuptools.command.easy_install:easy_install -register = setuptools.command.register:register -setopt = setuptools.command.setopt:setopt -install = setuptools.command.install:install -install_scripts = setuptools.command.install_scripts:install_scripts -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -build_ext = setuptools.command.build_ext:build_ext -rotate = setuptools.command.rotate:rotate -develop = setuptools.command.develop:develop -install_lib = setuptools.command.install_lib:install_lib -upload_docs = setuptools.command.upload_docs:upload_docs -install_egg_info = setuptools.command.install_egg_info:install_egg_info -build_py = setuptools.command.build_py:build_py -saveopts = setuptools.command.saveopts:saveopts - +[setuptools.file_finders] +svn_cvs = setuptools.command.sdist:_default_revctrl + +[egg_info.writers] +depends.txt = setuptools.command.egg_info:warn_depends_obsolete +top_level.txt = setuptools.command.egg_info:write_toplevel_names +namespace_packages.txt = setuptools.command.egg_info:overwrite_arg +eager_resources.txt = setuptools.command.egg_info:overwrite_arg +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +requires.txt = setuptools.command.egg_info:write_requirements +PKG-INFO = setuptools.command.egg_info:write_pkg_info +entry_points.txt = setuptools.command.egg_info:write_entries + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main + +[distutils.setup_keywords] +dependency_links = setuptools.dist:assert_string_list +packages = setuptools.dist:check_packages +exclude_package_data = setuptools.dist:check_package_data +use_2to3_exclude_fixers = setuptools.dist:assert_string_list +package_data = setuptools.dist:check_package_data +use_2to3 = setuptools.dist:assert_bool +tests_require = setuptools.dist:check_requirements +entry_points = setuptools.dist:check_entry_points +extras_require = setuptools.dist:check_extras +include_package_data = setuptools.dist:assert_bool +eager_resources = setuptools.dist:assert_string_list +zip_safe = setuptools.dist:assert_bool +install_requires = setuptools.dist:check_requirements +use_2to3_fixers = setuptools.dist:assert_string_list +test_suite = setuptools.dist:check_test_suite +test_loader = setuptools.dist:check_importable +namespace_packages = setuptools.dist:check_nsp +convert_2to3_doctests = setuptools.dist:assert_string_list + +[distutils.commands] +bdist_egg = setuptools.command.bdist_egg:bdist_egg +egg_info = setuptools.command.egg_info:egg_info +alias = setuptools.command.alias:alias +sdist = setuptools.command.sdist:sdist +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +test = setuptools.command.test:test +easy_install = setuptools.command.easy_install:easy_install +register = setuptools.command.register:register +setopt = setuptools.command.setopt:setopt +install = setuptools.command.install:install +install_scripts = setuptools.command.install_scripts:install_scripts +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +build_ext = setuptools.command.build_ext:build_ext +rotate = setuptools.command.rotate:rotate +develop = setuptools.command.develop:develop +install_lib = setuptools.command.install_lib:install_lib +upload_docs = setuptools.command.upload_docs:upload_docs +install_egg_info = setuptools.command.install_egg_info:install_egg_info +build_py = setuptools.command.build_py:build_py +saveopts = setuptools.command.saveopts:saveopts + diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 6c1ea631..5be48bb1 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -22,6 +22,7 @@ import re import stat import random import platform +import textwrap from glob import glob from distutils import log, dir_util @@ -1786,18 +1787,17 @@ class ScriptWriter(object): gui apps. """ - template = ( - "# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" - "__requires__ = %(spec)r\n" - "import sys\n" - "from pkg_resources import load_entry_point\n" - "\n" - "if __name__ == '__main__':" - "\n" - " sys.exit(\n" - " load_entry_point(%(spec)r, %(group)r, %(name)r)()\n" - " )\n" - ) + template = textwrap.dedent(""" + # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r + __requires__ = %(spec)r + import sys + from pkg_resources import load_entry_point + + if __name__ == '__main__': + sys.exit( + load_entry_point(%(spec)r, %(group)r, %(name)r)() + ) + """).lstrip() @classmethod def get_script_args(cls, dist, executable=sys_executable, wininst=False): -- cgit v1.2.1 From 81329a6d0753e879e67f279f5f0e7a4ef3346966 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 06:12:27 -0400 Subject: Update link to bug tracker. --- docs/setuptools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 5d80b230..a9368caa 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -3226,5 +3226,5 @@ confirmed via the list are actual bugs, and which you have reduced to a minimal set of steps to reproduce. .. _distutils-sig mailing list: http://mail.python.org/pipermail/distutils-sig/ -.. _setuptools bug tracker: http://bugs.python.org/setuptools/ +.. _setuptools bug tracker: https://bitbucket.org/pypa/setuptools/ -- cgit v1.2.1 From c05e0003478a36d698e938121978aafb43223599 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 06:21:36 -0400 Subject: Corrected syntax in setuptools documentation around console scripts with extra requirements. Fixes #62. --- docs/setuptools.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index a9368caa..6dfe0b4c 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -713,10 +713,11 @@ declare it like this, so that the "PDF" requirements are only resolved if the name="Project-A", ... entry_points = { - 'console_scripts': - ['rst2pdf = project_a.tools.pdfgen [PDF]'], - ['rst2html = project_a.tools.htmlgen'], + 'console_scripts': [ + 'rst2pdf = project_a.tools.pdfgen [PDF]', + 'rst2html = project_a.tools.htmlgen', # more script entry points ... + ], } ) -- cgit v1.2.1 From b748722cdd854504dea3209b722ee868302d8541 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 06:54:34 -0400 Subject: Removed references to distribute_setup.py --- docs/setuptools.txt | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 6dfe0b4c..b46e5939 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -72,7 +72,7 @@ is available from the `Python SVN sandbox`_, and in-development versions of the .. contents:: **Table of Contents** -.. _distribute_setup.py: `bootstrap module`_ +.. _ez_setup.py: `bootstrap module`_ ----------------- @@ -95,7 +95,7 @@ other than Python's ``site-packages`` directory. If you want the current in-development version of setuptools, you should first install a stable version, and then run:: - distribute_setup.py setuptools==dev + ez_setup.py setuptools==dev This will download and install the latest development (i.e. unstable) version of setuptools from the Python Subversion sandbox. @@ -529,7 +529,7 @@ Python must be available via the ``PATH`` environment variable, under its "long" name. That is, if the egg is built for Python 2.3, there must be a ``python2.3`` executable present in a directory on ``PATH``. -This feature is primarily intended to support distribute_setup the installation of +This feature is primarily intended to support ez_setup the installation of setuptools itself on non-Windows platforms, but may also be useful for other projects as well. @@ -1148,20 +1148,20 @@ Using ``setuptools``... Without bundling it! Your users might not have ``setuptools`` installed on their machines, or even if they do, it might not be the right version. Fixing this is easy; just -download `distribute_setup.py`_, and put it in the same directory as your ``setup.py`` +download `ez_setup.py`_, and put it in the same directory as your ``setup.py`` script. (Be sure to add it to your revision control system, too.) Then add these two lines to the very top of your setup script, before the script imports anything from setuptools: .. code-block:: python - import distribute_setup - distribute_setup.use_setuptools() + import ez_setup + ez_setup.use_setuptools() -That's it. The ``distribute_setup`` module will automatically download a matching +That's it. The ``ez_setup`` module will automatically download a matching version of ``setuptools`` from PyPI, if it isn't present on the target system. Whenever you install an updated version of setuptools, you should also update -your projects' ``distribute_setup.py`` files, so that a matching version gets installed +your projects' ``ez_setup.py`` files, so that a matching version gets installed on the target machine(s). By the way, setuptools supports the new PyPI "upload" command, so you can use @@ -1191,7 +1191,7 @@ relevant to your project and your target audience isn't already familiar with setuptools and ``easy_install``. Network Access - If your project is using ``distribute_setup``, you should inform users of the + If your project is using ``ez_setup``, you should inform users of the need to either have network access, or to preinstall the correct version of setuptools using the `EasyInstall installation instructions`_. Those instructions also have tips for dealing with firewalls as well as how to @@ -1271,27 +1271,27 @@ Creating System Packages Managing Multiple Projects -------------------------- -If you're managing several projects that need to use ``distribute_setup``, and you +If you're managing several projects that need to use ``ez_setup``, and you are using Subversion as your revision control system, you can use the -"svn:externals" property to share a single copy of ``distribute_setup`` between +"svn:externals" property to share a single copy of ``ez_setup`` between projects, so that it will always be up-to-date whenever you check out or update an individual project, without having to manually update each project to use a new version. However, because Subversion only supports using directories as externals, you -have to turn ``distribute_setup.py`` into ``distribute_setup/__init__.py`` in order -to do this, then create "externals" definitions that map the ``distribute_setup`` +have to turn ``ez_setup.py`` into ``ez_setup/__init__.py`` in order +to do this, then create "externals" definitions that map the ``ez_setup`` directory into each project. Also, if any of your projects use ``find_packages()`` on their setup directory, you will need to exclude the -resulting ``distribute_setup`` package, to keep it from being included in your +resulting ``ez_setup`` package, to keep it from being included in your distributions, e.g.:: setup( ... - packages = find_packages(exclude=['distribute_setup']), + packages = find_packages(exclude=['ez_setup']), ) -Of course, the ``distribute_setup`` package will still be included in your +Of course, the ``ez_setup`` package will still be included in your packages' source distributions, as it needs to be. For your convenience, you may use the following external definition, which will @@ -2700,8 +2700,8 @@ XXX Reusing ``setuptools`` Code =========================== -``distribute_setup`` --------------------- +``ez_setup`` +------------ XXX -- cgit v1.2.1 From 244412f118232255578bb99afee7cd22872a9839 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 06:57:36 -0400 Subject: Removed section on Managing Multiple Projects. It only works for Subversion, which is substantially replaced by other SCM systems. --- docs/setuptools.txt | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index b46e5939..235a85b5 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -1267,45 +1267,6 @@ Creating System Packages resolve the issue. - -Managing Multiple Projects --------------------------- - -If you're managing several projects that need to use ``ez_setup``, and you -are using Subversion as your revision control system, you can use the -"svn:externals" property to share a single copy of ``ez_setup`` between -projects, so that it will always be up-to-date whenever you check out or update -an individual project, without having to manually update each project to use -a new version. - -However, because Subversion only supports using directories as externals, you -have to turn ``ez_setup.py`` into ``ez_setup/__init__.py`` in order -to do this, then create "externals" definitions that map the ``ez_setup`` -directory into each project. Also, if any of your projects use -``find_packages()`` on their setup directory, you will need to exclude the -resulting ``ez_setup`` package, to keep it from being included in your -distributions, e.g.:: - - setup( - ... - packages = find_packages(exclude=['ez_setup']), - ) - -Of course, the ``ez_setup`` package will still be included in your -packages' source distributions, as it needs to be. - -For your convenience, you may use the following external definition, which will -track the latest version of setuptools:: - - ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup - -You can set this by executing this command in your project directory:: - - svn propedit svn:externals . - -And then adding the line shown above to the file that comes up for editing. - - Setting the ``zip_safe`` flag ----------------------------- -- cgit v1.2.1 From 06123063b78bab12b523f5d6f09125f7282504ec Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 07:02:53 -0400 Subject: Update transitional note to reflect that the change never took place. --- docs/setuptools.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 235a85b5..7bc307e0 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -1378,20 +1378,21 @@ other copies will ever be loaded!) TRANSITIONAL NOTE ~~~~~~~~~~~~~~~~~ -Setuptools 0.6a automatically calls ``declare_namespace()`` for you at runtime, -but the 0.7a versions will *not*. This is because the automatic declaration +Setuptools automatically calls ``declare_namespace()`` for you at runtime, +but future versions may *not*. This is because the automatic declaration feature has some negative side effects, such as needing to import all namespace packages during the initialization of the ``pkg_resources`` runtime, and also the need for ``pkg_resources`` to be explicitly imported before any namespace -packages work at all. Beginning with the 0.7a releases, you'll be responsible +packages work at all. In some future releases, you'll be responsible for including your own declaration lines, and the automatic declaration feature will be dropped to get rid of the negative side effects. -During the remainder of the 0.6 development cycle, therefore, setuptools will -warn you about missing ``declare_namespace()`` calls in your ``__init__.py`` -files, and you should correct these as soon as possible before setuptools 0.7a1 -is released. Namespace packages without declaration lines will not work -correctly once a user has upgraded to setuptools 0.7a1, so it's important that +During the remainder of the current development cycle, therefore, setuptools +will warn you about missing ``declare_namespace()`` calls in your +``__init__.py`` files, and you should correct these as soon as possible +before the compatibility support is removed. +Namespace packages without declaration lines will not work +correctly once a user has upgraded to a later version, so it's important that you make this change now in order to avoid having your code break in the field. Our apologies for the inconvenience, and thank you for your patience. -- cgit v1.2.1 From c0e1e72eade9a007bb1f22da0bab39befb5301c7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 07:09:55 -0400 Subject: Moved 'history' to changes.txt --- CHANGES.txt | 584 ++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/setuptools.txt | 494 -------------------------------------------- 2 files changed, 584 insertions(+), 494 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 34bdf651..b2729aac 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -755,3 +755,587 @@ easy_install * Immediately close all file handles. This closes Distribute #3. +----- +0.6c9 +----- + + * Fixed a missing files problem when using Windows source distributions on + non-Windows platforms, due to distutils not handling manifest file line + endings correctly. + + * Updated Pyrex support to work with Pyrex 0.9.6 and higher. + + * Minor changes for Jython compatibility, including skipping tests that can't + work on Jython. + + * Fixed not installing eggs in ``install_requires`` if they were also used for + ``setup_requires`` or ``tests_require``. + + * Fixed not fetching eggs in ``install_requires`` when running tests. + + * Allow ``ez_setup.use_setuptools()`` to upgrade existing setuptools + installations when called from a standalone ``setup.py``. + + * Added a warning if a namespace package is declared, but its parent package + is not also declared as a namespace. + + * Support Subversion 1.5 + + * Removed use of deprecated ``md5`` module if ``hashlib`` is available + + * Fixed ``bdist_wininst upload`` trying to upload the ``.exe`` twice + + * Fixed ``bdist_egg`` putting a ``native_libs.txt`` in the source package's + ``.egg-info``, when it should only be in the built egg's ``EGG-INFO``. + + * Ensure that _full_name is set on all shared libs before extensions are + checked for shared lib usage. (Fixes a bug in the experimental shared + library build support.) + + * Fix to allow unpacked eggs containing native libraries to fail more + gracefully under Google App Engine (with an ``ImportError`` loading the + C-based module, instead of getting a ``NameError``). + +----- +0.6c7 +----- + + * Fixed ``distutils.filelist.findall()`` crashing on broken symlinks, and + ``egg_info`` command failing on new, uncommitted SVN directories. + + * Fix import problems with nested namespace packages installed via + ``--root`` or ``--single-version-externally-managed``, due to the + parent package not having the child package as an attribute. + +----- +0.6c6 +----- + + * Added ``--egg-path`` option to ``develop`` command, allowing you to force + ``.egg-link`` files to use relative paths (allowing them to be shared across + platforms on a networked drive). + + * Fix not building binary RPMs correctly. + + * Fix "eggsecutables" (such as setuptools' own egg) only being runnable with + bash-compatible shells. + + * Fix ``#!`` parsing problems in Windows ``.exe`` script wrappers, when there + was whitespace inside a quoted argument or at the end of the ``#!`` line + (a regression introduced in 0.6c4). + + * Fix ``test`` command possibly failing if an older version of the project + being tested was installed on ``sys.path`` ahead of the test source + directory. + + * Fix ``find_packages()`` treating ``ez_setup`` and directories with ``.`` in + their names as packages. + +----- +0.6c5 +----- + + * Fix uploaded ``bdist_rpm`` packages being described as ``bdist_egg`` + packages under Python versions less than 2.5. + + * Fix uploaded ``bdist_wininst`` packages being described as suitable for + "any" version by Python 2.5, even if a ``--target-version`` was specified. + +----- +0.6c4 +----- + + * Overhauled Windows script wrapping to support ``bdist_wininst`` better. + Scripts installed with ``bdist_wininst`` will always use ``#!python.exe`` or + ``#!pythonw.exe`` as the executable name (even when built on non-Windows + platforms!), and the wrappers will look for the executable in the script's + parent directory (which should find the right version of Python). + + * Fix ``upload`` command not uploading files built by ``bdist_rpm`` or + ``bdist_wininst`` under Python 2.3 and 2.4. + + * Add support for "eggsecutable" headers: a ``#!/bin/sh`` script that is + prepended to an ``.egg`` file to allow it to be run as a script on Unix-ish + platforms. (This is mainly so that setuptools itself can have a single-file + installer on Unix, without doing multiple downloads, dealing with firewalls, + etc.) + + * Fix problem with empty revision numbers in Subversion 1.4 ``entries`` files + + * Use cross-platform relative paths in ``easy-install.pth`` when doing + ``develop`` and the source directory is a subdirectory of the installation + target directory. + + * Fix a problem installing eggs with a system packaging tool if the project + contained an implicit namespace package; for example if the ``setup()`` + listed a namespace package ``foo.bar`` without explicitly listing ``foo`` + as a namespace package. + +----- +0.6c3 +----- + + * Fixed breakages caused by Subversion 1.4's new "working copy" format + +----- +0.6c2 +----- + + * The ``ez_setup`` module displays the conflicting version of setuptools (and + its installation location) when a script requests a version that's not + available. + + * Running ``setup.py develop`` on a setuptools-using project will now install + setuptools if needed, instead of only downloading the egg. + +----- +0.6c1 +----- + + * Fixed ``AttributeError`` when trying to download a ``setup_requires`` + dependency when a distribution lacks a ``dependency_links`` setting. + + * Made ``zip-safe`` and ``not-zip-safe`` flag files contain a single byte, so + as to play better with packaging tools that complain about zero-length + files. + + * Made ``setup.py develop`` respect the ``--no-deps`` option, which it + previously was ignoring. + + * Support ``extra_path`` option to ``setup()`` when ``install`` is run in + backward-compatibility mode. + + * Source distributions now always include a ``setup.cfg`` file that explicitly + sets ``egg_info`` options such that they produce an identical version number + to the source distribution's version number. (Previously, the default + version number could be different due to the use of ``--tag-date``, or if + the version was overridden on the command line that built the source + distribution.) + +----- +0.6b4 +----- + + * Fix ``register`` not obeying name/version set by ``egg_info`` command, if + ``egg_info`` wasn't explicitly run first on the same command line. + + * Added ``--no-date`` and ``--no-svn-revision`` options to ``egg_info`` + command, to allow suppressing tags configured in ``setup.cfg``. + + * Fixed redundant warnings about missing ``README`` file(s); it should now + appear only if you are actually a source distribution. + +----- +0.6b3 +----- + + * Fix ``bdist_egg`` not including files in subdirectories of ``.egg-info``. + + * Allow ``.py`` files found by the ``include_package_data`` option to be + automatically included. Remove duplicate data file matches if both + ``include_package_data`` and ``package_data`` are used to refer to the same + files. + +----- +0.6b1 +----- + + * Strip ``module`` from the end of compiled extension modules when computing + the name of a ``.py`` loader/wrapper. (Python's import machinery ignores + this suffix when searching for an extension module.) + +------ +0.6a11 +------ + + * Added ``test_loader`` keyword to support custom test loaders + + * Added ``setuptools.file_finders`` entry point group to allow implementing + revision control plugins. + + * Added ``--identity`` option to ``upload`` command. + + * Added ``dependency_links`` to allow specifying URLs for ``--find-links``. + + * Enhanced test loader to scan packages as well as modules, and call + ``additional_tests()`` if present to get non-unittest tests. + + * Support namespace packages in conjunction with system packagers, by omitting + the installation of any ``__init__.py`` files for namespace packages, and + adding a special ``.pth`` file to create a working package in + ``sys.modules``. + + * Made ``--single-version-externally-managed`` automatic when ``--root`` is + used, so that most system packagers won't require special support for + setuptools. + + * Fixed ``setup_requires``, ``tests_require``, etc. not using ``setup.cfg`` or + other configuration files for their option defaults when installing, and + also made the install use ``--multi-version`` mode so that the project + directory doesn't need to support .pth files. + + * ``MANIFEST.in`` is now forcibly closed when any errors occur while reading + it. Previously, the file could be left open and the actual error would be + masked by problems trying to remove the open file on Windows systems. + +------ +0.6a10 +------ + + * Fixed the ``develop`` command ignoring ``--find-links``. + +----- +0.6a9 +----- + + * The ``sdist`` command no longer uses the traditional ``MANIFEST`` file to + create source distributions. ``MANIFEST.in`` is still read and processed, + as are the standard defaults and pruning. But the manifest is built inside + the project's ``.egg-info`` directory as ``SOURCES.txt``, and it is rebuilt + every time the ``egg_info`` command is run. + + * Added the ``include_package_data`` keyword to ``setup()``, allowing you to + automatically include any package data listed in revision control or + ``MANIFEST.in`` + + * Added the ``exclude_package_data`` keyword to ``setup()``, allowing you to + trim back files included via the ``package_data`` and + ``include_package_data`` options. + + * Fixed ``--tag-svn-revision`` not working when run from a source + distribution. + + * Added warning for namespace packages with missing ``declare_namespace()`` + + * Added ``tests_require`` keyword to ``setup()``, so that e.g. packages + requiring ``nose`` to run unit tests can make this dependency optional + unless the ``test`` command is run. + + * Made all commands that use ``easy_install`` respect its configuration + options, as this was causing some problems with ``setup.py install``. + + * Added an ``unpack_directory()`` driver to ``setuptools.archive_util``, so + that you can process a directory tree through a processing filter as if it + were a zipfile or tarfile. + + * Added an internal ``install_egg_info`` command to use as part of old-style + ``install`` operations, that installs an ``.egg-info`` directory with the + package. + + * Added a ``--single-version-externally-managed`` option to the ``install`` + command so that you can more easily wrap a "flat" egg in a system package. + + * Enhanced ``bdist_rpm`` so that it installs single-version eggs that + don't rely on a ``.pth`` file. The ``--no-egg`` option has been removed, + since all RPMs are now built in a more backwards-compatible format. + + * Support full roundtrip translation of eggs to and from ``bdist_wininst`` + format. Running ``bdist_wininst`` on a setuptools-based package wraps the + egg in an .exe that will safely install it as an egg (i.e., with metadata + and entry-point wrapper scripts), and ``easy_install`` can turn the .exe + back into an ``.egg`` file or directory and install it as such. + + +----- +0.6a8 +----- + + * Fixed some problems building extensions when Pyrex was installed, especially + with Python 2.4 and/or packages using SWIG. + + * Made ``develop`` command accept all the same options as ``easy_install``, + and use the ``easy_install`` command's configuration settings as defaults. + + * Made ``egg_info --tag-svn-revision`` fall back to extracting the revision + number from ``PKG-INFO`` in case it is being run on a source distribution of + a snapshot taken from a Subversion-based project. + + * Automatically detect ``.dll``, ``.so`` and ``.dylib`` files that are being + installed as data, adding them to ``native_libs.txt`` automatically. + + * Fixed some problems with fresh checkouts of projects that don't include + ``.egg-info/PKG-INFO`` under revision control and put the project's source + code directly in the project directory. If such a package had any + requirements that get processed before the ``egg_info`` command can be run, + the setup scripts would fail with a "Missing 'Version:' header and/or + PKG-INFO file" error, because the egg runtime interpreted the unbuilt + metadata in a directory on ``sys.path`` (i.e. the current directory) as + being a corrupted egg. Setuptools now monkeypatches the distribution + metadata cache to pretend that the egg has valid version information, until + it has a chance to make it actually be so (via the ``egg_info`` command). + +----- +0.6a5 +----- + + * Fixed missing gui/cli .exe files in distribution. Fixed bugs in tests. + +----- +0.6a3 +----- + + * Added ``gui_scripts`` entry point group to allow installing GUI scripts + on Windows and other platforms. (The special handling is only for Windows; + other platforms are treated the same as for ``console_scripts``.) + +----- +0.6a2 +----- + + * Added ``console_scripts`` entry point group to allow installing scripts + without the need to create separate script files. On Windows, console + scripts get an ``.exe`` wrapper so you can just type their name. On other + platforms, the scripts are written without a file extension. + +----- +0.6a1 +----- + + * Added support for building "old-style" RPMs that don't install an egg for + the target package, using a ``--no-egg`` option. + + * The ``build_ext`` command now works better when using the ``--inplace`` + option and multiple Python versions. It now makes sure that all extensions + match the current Python version, even if newer copies were built for a + different Python version. + + * The ``upload`` command no longer attaches an extra ``.zip`` when uploading + eggs, as PyPI now supports egg uploads without trickery. + + * The ``ez_setup`` script/module now displays a warning before downloading + the setuptools egg, and attempts to check the downloaded egg against an + internal MD5 checksum table. + + * Fixed the ``--tag-svn-revision`` option of ``egg_info`` not finding the + latest revision number; it was using the revision number of the directory + containing ``setup.py``, not the highest revision number in the project. + + * Added ``eager_resources`` setup argument + + * The ``sdist`` command now recognizes Subversion "deleted file" entries and + does not include them in source distributions. + + * ``setuptools`` now embeds itself more thoroughly into the distutils, so that + other distutils extensions (e.g. py2exe, py2app) will subclass setuptools' + versions of things, rather than the native distutils ones. + + * Added ``entry_points`` and ``setup_requires`` arguments to ``setup()``; + ``setup_requires`` allows you to automatically find and download packages + that are needed in order to *build* your project (as opposed to running it). + + * ``setuptools`` now finds its commands, ``setup()`` argument validators, and + metadata writers using entry points, so that they can be extended by + third-party packages. See `Creating distutils Extensions`_ above for more + details. + + * The vestigial ``depends`` command has been removed. It was never finished + or documented, and never would have worked without EasyInstall - which it + pre-dated and was never compatible with. + +------ +0.5a12 +------ + + * The zip-safety scanner now checks for modules that might be used with + ``python -m``, and marks them as unsafe for zipping, since Python 2.4 can't + handle ``-m`` on zipped modules. + +------ +0.5a11 +------ + + * Fix breakage of the "develop" command that was caused by the addition of + ``--always-unzip`` to the ``easy_install`` command. + +----- +0.5a9 +----- + + * Include ``svn:externals`` directories in source distributions as well as + normal subversion-controlled files and directories. + + * Added ``exclude=patternlist`` option to ``setuptools.find_packages()`` + + * Changed --tag-svn-revision to include an "r" in front of the revision number + for better readability. + + * Added ability to build eggs without including source files (except for any + scripts, of course), using the ``--exclude-source-files`` option to + ``bdist_egg``. + + * ``setup.py install`` now automatically detects when an "unmanaged" package + or module is going to be on ``sys.path`` ahead of a package being installed, + thereby preventing the newer version from being imported. If this occurs, + a warning message is output to ``sys.stderr``, but installation proceeds + anyway. The warning message informs the user what files or directories + need deleting, and advises them they can also use EasyInstall (with the + ``--delete-conflicting`` option) to do it automatically. + + * The ``egg_info`` command now adds a ``top_level.txt`` file to the metadata + directory that lists all top-level modules and packages in the distribution. + This is used by the ``easy_install`` command to find possibly-conflicting + "unmanaged" packages when installing the distribution. + + * Added ``zip_safe`` and ``namespace_packages`` arguments to ``setup()``. + Added package analysis to determine zip-safety if the ``zip_safe`` flag + is not given, and advise the author regarding what code might need changing. + + * Fixed the swapped ``-d`` and ``-b`` options of ``bdist_egg``. + +----- +0.5a8 +----- + + * The "egg_info" command now always sets the distribution metadata to "safe" + forms of the distribution name and version, so that distribution files will + be generated with parseable names (i.e., ones that don't include '-' in the + name or version). Also, this means that if you use the various ``--tag`` + options of "egg_info", any distributions generated will use the tags in the + version, not just egg distributions. + + * Added support for defining command aliases in distutils configuration files, + under the "[aliases]" section. To prevent recursion and to allow aliases to + call the command of the same name, a given alias can be expanded only once + per command-line invocation. You can define new aliases with the "alias" + command, either for the local, global, or per-user configuration. + + * Added "rotate" command to delete old distribution files, given a set of + patterns to match and the number of files to keep. (Keeps the most + recently-modified distribution files matching each pattern.) + + * Added "saveopts" command that saves all command-line options for the current + invocation to the local, global, or per-user configuration file. Useful for + setting defaults without having to hand-edit a configuration file. + + * Added a "setopt" command that sets a single option in a specified distutils + configuration file. + +----- +0.5a7 +----- + + * Added "upload" support for egg and source distributions, including a bug + fix for "upload" and a temporary workaround for lack of .egg support in + PyPI. + +----- +0.5a6 +----- + + * Beefed up the "sdist" command so that if you don't have a MANIFEST.in, it + will include all files under revision control (CVS or Subversion) in the + current directory, and it will regenerate the list every time you create a + source distribution, not just when you tell it to. This should make the + default "do what you mean" more often than the distutils' default behavior + did, while still retaining the old behavior in the presence of MANIFEST.in. + + * Fixed the "develop" command always updating .pth files, even if you + specified ``-n`` or ``--dry-run``. + + * Slightly changed the format of the generated version when you use + ``--tag-build`` on the "egg_info" command, so that you can make tagged + revisions compare *lower* than the version specified in setup.py (e.g. by + using ``--tag-build=dev``). + +----- +0.5a5 +----- + + * Added ``develop`` command to ``setuptools``-based packages. This command + installs an ``.egg-link`` pointing to the package's source directory, and + script wrappers that ``execfile()`` the source versions of the package's + scripts. This lets you put your development checkout(s) on sys.path without + having to actually install them. (To uninstall the link, use + use ``setup.py develop --uninstall``.) + + * Added ``egg_info`` command to ``setuptools``-based packages. This command + just creates or updates the "projectname.egg-info" directory, without + building an egg. (It's used by the ``bdist_egg``, ``test``, and ``develop`` + commands.) + + * Enhanced the ``test`` command so that it doesn't install the package, but + instead builds any C extensions in-place, updates the ``.egg-info`` + metadata, adds the source directory to ``sys.path``, and runs the tests + directly on the source. This avoids an "unmanaged" installation of the + package to ``site-packages`` or elsewhere. + + * Made ``easy_install`` a standard ``setuptools`` command, moving it from + the ``easy_install`` module to ``setuptools.command.easy_install``. Note + that if you were importing or extending it, you must now change your imports + accordingly. ``easy_install.py`` is still installed as a script, but not as + a module. + +----- +0.5a4 +----- + + * Setup scripts using setuptools can now list their dependencies directly in + the setup.py file, without having to manually create a ``depends.txt`` file. + The ``install_requires`` and ``extras_require`` arguments to ``setup()`` + are used to create a dependencies file automatically. If you are manually + creating ``depends.txt`` right now, please switch to using these setup + arguments as soon as practical, because ``depends.txt`` support will be + removed in the 0.6 release cycle. For documentation on the new arguments, + see the ``setuptools.dist.Distribution`` class. + + * Setup scripts using setuptools now always install using ``easy_install`` + internally, for ease of uninstallation and upgrading. + +----- +0.5a1 +----- + + * Added support for "self-installation" bootstrapping. Packages can now + include ``ez_setup.py`` in their source distribution, and add the following + to their ``setup.py``, in order to automatically bootstrap installation of + setuptools as part of their setup process:: + + from ez_setup import use_setuptools + use_setuptools() + + from setuptools import setup + # etc... + +----- +0.4a2 +----- + + * Added ``ez_setup.py`` installer/bootstrap script to make initial setuptools + installation easier, and to allow distributions using setuptools to avoid + having to include setuptools in their source distribution. + + * All downloads are now managed by the ``PackageIndex`` class (which is now + subclassable and replaceable), so that embedders can more easily override + download logic, give download progress reports, etc. The class has also + been moved to the new ``setuptools.package_index`` module. + + * The ``Installer`` class no longer handles downloading, manages a temporary + directory, or tracks the ``zip_ok`` option. Downloading is now handled + by ``PackageIndex``, and ``Installer`` has become an ``easy_install`` + command class based on ``setuptools.Command``. + + * There is a new ``setuptools.sandbox.run_setup()`` API to invoke a setup + script in a directory sandbox, and a new ``setuptools.archive_util`` module + with an ``unpack_archive()`` API. These were split out of EasyInstall to + allow reuse by other tools and applications. + + * ``setuptools.Command`` now supports reinitializing commands using keyword + arguments to set/reset options. Also, ``Command`` subclasses can now set + their ``command_consumes_arguments`` attribute to ``True`` in order to + receive an ``args`` option containing the rest of the command line. + +----- +0.3a2 +----- + + * Added new options to ``bdist_egg`` to allow tagging the egg's version number + with a subversion revision number, the current date, or an explicit tag + value. Run ``setup.py bdist_egg --help`` to get more information. + + * Misc. bug fixes + +----- +0.3a1 +----- + + * Initial release. diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 7bc307e0..6e9a6927 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -2685,500 +2685,6 @@ XXX XXX -History -======= - -0.6c9 - * Fixed a missing files problem when using Windows source distributions on - non-Windows platforms, due to distutils not handling manifest file line - endings correctly. - - * Updated Pyrex support to work with Pyrex 0.9.6 and higher. - - * Minor changes for Jython compatibility, including skipping tests that can't - work on Jython. - - * Fixed not installing eggs in ``install_requires`` if they were also used for - ``setup_requires`` or ``tests_require``. - - * Fixed not fetching eggs in ``install_requires`` when running tests. - - * Allow ``ez_setup.use_setuptools()`` to upgrade existing setuptools - installations when called from a standalone ``setup.py``. - - * Added a warning if a namespace package is declared, but its parent package - is not also declared as a namespace. - - * Support Subversion 1.5 - - * Removed use of deprecated ``md5`` module if ``hashlib`` is available - - * Fixed ``bdist_wininst upload`` trying to upload the ``.exe`` twice - - * Fixed ``bdist_egg`` putting a ``native_libs.txt`` in the source package's - ``.egg-info``, when it should only be in the built egg's ``EGG-INFO``. - - * Ensure that _full_name is set on all shared libs before extensions are - checked for shared lib usage. (Fixes a bug in the experimental shared - library build support.) - - * Fix to allow unpacked eggs containing native libraries to fail more - gracefully under Google App Engine (with an ``ImportError`` loading the - C-based module, instead of getting a ``NameError``). - -0.6c7 - * Fixed ``distutils.filelist.findall()`` crashing on broken symlinks, and - ``egg_info`` command failing on new, uncommitted SVN directories. - - * Fix import problems with nested namespace packages installed via - ``--root`` or ``--single-version-externally-managed``, due to the - parent package not having the child package as an attribute. - -0.6c6 - * Added ``--egg-path`` option to ``develop`` command, allowing you to force - ``.egg-link`` files to use relative paths (allowing them to be shared across - platforms on a networked drive). - - * Fix not building binary RPMs correctly. - - * Fix "eggsecutables" (such as setuptools' own egg) only being runnable with - bash-compatible shells. - - * Fix ``#!`` parsing problems in Windows ``.exe`` script wrappers, when there - was whitespace inside a quoted argument or at the end of the ``#!`` line - (a regression introduced in 0.6c4). - - * Fix ``test`` command possibly failing if an older version of the project - being tested was installed on ``sys.path`` ahead of the test source - directory. - - * Fix ``find_packages()`` treating ``ez_setup`` and directories with ``.`` in - their names as packages. - -0.6c5 - * Fix uploaded ``bdist_rpm`` packages being described as ``bdist_egg`` - packages under Python versions less than 2.5. - - * Fix uploaded ``bdist_wininst`` packages being described as suitable for - "any" version by Python 2.5, even if a ``--target-version`` was specified. - -0.6c4 - * Overhauled Windows script wrapping to support ``bdist_wininst`` better. - Scripts installed with ``bdist_wininst`` will always use ``#!python.exe`` or - ``#!pythonw.exe`` as the executable name (even when built on non-Windows - platforms!), and the wrappers will look for the executable in the script's - parent directory (which should find the right version of Python). - - * Fix ``upload`` command not uploading files built by ``bdist_rpm`` or - ``bdist_wininst`` under Python 2.3 and 2.4. - - * Add support for "eggsecutable" headers: a ``#!/bin/sh`` script that is - prepended to an ``.egg`` file to allow it to be run as a script on Unix-ish - platforms. (This is mainly so that setuptools itself can have a single-file - installer on Unix, without doing multiple downloads, dealing with firewalls, - etc.) - - * Fix problem with empty revision numbers in Subversion 1.4 ``entries`` files - - * Use cross-platform relative paths in ``easy-install.pth`` when doing - ``develop`` and the source directory is a subdirectory of the installation - target directory. - - * Fix a problem installing eggs with a system packaging tool if the project - contained an implicit namespace package; for example if the ``setup()`` - listed a namespace package ``foo.bar`` without explicitly listing ``foo`` - as a namespace package. - -0.6c3 - * Fixed breakages caused by Subversion 1.4's new "working copy" format - -0.6c2 - * The ``ez_setup`` module displays the conflicting version of setuptools (and - its installation location) when a script requests a version that's not - available. - - * Running ``setup.py develop`` on a setuptools-using project will now install - setuptools if needed, instead of only downloading the egg. - -0.6c1 - * Fixed ``AttributeError`` when trying to download a ``setup_requires`` - dependency when a distribution lacks a ``dependency_links`` setting. - - * Made ``zip-safe`` and ``not-zip-safe`` flag files contain a single byte, so - as to play better with packaging tools that complain about zero-length - files. - - * Made ``setup.py develop`` respect the ``--no-deps`` option, which it - previously was ignoring. - - * Support ``extra_path`` option to ``setup()`` when ``install`` is run in - backward-compatibility mode. - - * Source distributions now always include a ``setup.cfg`` file that explicitly - sets ``egg_info`` options such that they produce an identical version number - to the source distribution's version number. (Previously, the default - version number could be different due to the use of ``--tag-date``, or if - the version was overridden on the command line that built the source - distribution.) - -0.6b4 - * Fix ``register`` not obeying name/version set by ``egg_info`` command, if - ``egg_info`` wasn't explicitly run first on the same command line. - - * Added ``--no-date`` and ``--no-svn-revision`` options to ``egg_info`` - command, to allow suppressing tags configured in ``setup.cfg``. - - * Fixed redundant warnings about missing ``README`` file(s); it should now - appear only if you are actually a source distribution. - -0.6b3 - * Fix ``bdist_egg`` not including files in subdirectories of ``.egg-info``. - - * Allow ``.py`` files found by the ``include_package_data`` option to be - automatically included. Remove duplicate data file matches if both - ``include_package_data`` and ``package_data`` are used to refer to the same - files. - -0.6b1 - * Strip ``module`` from the end of compiled extension modules when computing - the name of a ``.py`` loader/wrapper. (Python's import machinery ignores - this suffix when searching for an extension module.) - -0.6a11 - * Added ``test_loader`` keyword to support custom test loaders - - * Added ``setuptools.file_finders`` entry point group to allow implementing - revision control plugins. - - * Added ``--identity`` option to ``upload`` command. - - * Added ``dependency_links`` to allow specifying URLs for ``--find-links``. - - * Enhanced test loader to scan packages as well as modules, and call - ``additional_tests()`` if present to get non-unittest tests. - - * Support namespace packages in conjunction with system packagers, by omitting - the installation of any ``__init__.py`` files for namespace packages, and - adding a special ``.pth`` file to create a working package in - ``sys.modules``. - - * Made ``--single-version-externally-managed`` automatic when ``--root`` is - used, so that most system packagers won't require special support for - setuptools. - - * Fixed ``setup_requires``, ``tests_require``, etc. not using ``setup.cfg`` or - other configuration files for their option defaults when installing, and - also made the install use ``--multi-version`` mode so that the project - directory doesn't need to support .pth files. - - * ``MANIFEST.in`` is now forcibly closed when any errors occur while reading - it. Previously, the file could be left open and the actual error would be - masked by problems trying to remove the open file on Windows systems. - -0.6a10 - * Fixed the ``develop`` command ignoring ``--find-links``. - -0.6a9 - * The ``sdist`` command no longer uses the traditional ``MANIFEST`` file to - create source distributions. ``MANIFEST.in`` is still read and processed, - as are the standard defaults and pruning. But the manifest is built inside - the project's ``.egg-info`` directory as ``SOURCES.txt``, and it is rebuilt - every time the ``egg_info`` command is run. - - * Added the ``include_package_data`` keyword to ``setup()``, allowing you to - automatically include any package data listed in revision control or - ``MANIFEST.in`` - - * Added the ``exclude_package_data`` keyword to ``setup()``, allowing you to - trim back files included via the ``package_data`` and - ``include_package_data`` options. - - * Fixed ``--tag-svn-revision`` not working when run from a source - distribution. - - * Added warning for namespace packages with missing ``declare_namespace()`` - - * Added ``tests_require`` keyword to ``setup()``, so that e.g. packages - requiring ``nose`` to run unit tests can make this dependency optional - unless the ``test`` command is run. - - * Made all commands that use ``easy_install`` respect its configuration - options, as this was causing some problems with ``setup.py install``. - - * Added an ``unpack_directory()`` driver to ``setuptools.archive_util``, so - that you can process a directory tree through a processing filter as if it - were a zipfile or tarfile. - - * Added an internal ``install_egg_info`` command to use as part of old-style - ``install`` operations, that installs an ``.egg-info`` directory with the - package. - - * Added a ``--single-version-externally-managed`` option to the ``install`` - command so that you can more easily wrap a "flat" egg in a system package. - - * Enhanced ``bdist_rpm`` so that it installs single-version eggs that - don't rely on a ``.pth`` file. The ``--no-egg`` option has been removed, - since all RPMs are now built in a more backwards-compatible format. - - * Support full roundtrip translation of eggs to and from ``bdist_wininst`` - format. Running ``bdist_wininst`` on a setuptools-based package wraps the - egg in an .exe that will safely install it as an egg (i.e., with metadata - and entry-point wrapper scripts), and ``easy_install`` can turn the .exe - back into an ``.egg`` file or directory and install it as such. - - -0.6a8 - * Fixed some problems building extensions when Pyrex was installed, especially - with Python 2.4 and/or packages using SWIG. - - * Made ``develop`` command accept all the same options as ``easy_install``, - and use the ``easy_install`` command's configuration settings as defaults. - - * Made ``egg_info --tag-svn-revision`` fall back to extracting the revision - number from ``PKG-INFO`` in case it is being run on a source distribution of - a snapshot taken from a Subversion-based project. - - * Automatically detect ``.dll``, ``.so`` and ``.dylib`` files that are being - installed as data, adding them to ``native_libs.txt`` automatically. - - * Fixed some problems with fresh checkouts of projects that don't include - ``.egg-info/PKG-INFO`` under revision control and put the project's source - code directly in the project directory. If such a package had any - requirements that get processed before the ``egg_info`` command can be run, - the setup scripts would fail with a "Missing 'Version:' header and/or - PKG-INFO file" error, because the egg runtime interpreted the unbuilt - metadata in a directory on ``sys.path`` (i.e. the current directory) as - being a corrupted egg. Setuptools now monkeypatches the distribution - metadata cache to pretend that the egg has valid version information, until - it has a chance to make it actually be so (via the ``egg_info`` command). - -0.6a5 - * Fixed missing gui/cli .exe files in distribution. Fixed bugs in tests. - -0.6a3 - * Added ``gui_scripts`` entry point group to allow installing GUI scripts - on Windows and other platforms. (The special handling is only for Windows; - other platforms are treated the same as for ``console_scripts``.) - -0.6a2 - * Added ``console_scripts`` entry point group to allow installing scripts - without the need to create separate script files. On Windows, console - scripts get an ``.exe`` wrapper so you can just type their name. On other - platforms, the scripts are written without a file extension. - -0.6a1 - * Added support for building "old-style" RPMs that don't install an egg for - the target package, using a ``--no-egg`` option. - - * The ``build_ext`` command now works better when using the ``--inplace`` - option and multiple Python versions. It now makes sure that all extensions - match the current Python version, even if newer copies were built for a - different Python version. - - * The ``upload`` command no longer attaches an extra ``.zip`` when uploading - eggs, as PyPI now supports egg uploads without trickery. - - * The ``ez_setup`` script/module now displays a warning before downloading - the setuptools egg, and attempts to check the downloaded egg against an - internal MD5 checksum table. - - * Fixed the ``--tag-svn-revision`` option of ``egg_info`` not finding the - latest revision number; it was using the revision number of the directory - containing ``setup.py``, not the highest revision number in the project. - - * Added ``eager_resources`` setup argument - - * The ``sdist`` command now recognizes Subversion "deleted file" entries and - does not include them in source distributions. - - * ``setuptools`` now embeds itself more thoroughly into the distutils, so that - other distutils extensions (e.g. py2exe, py2app) will subclass setuptools' - versions of things, rather than the native distutils ones. - - * Added ``entry_points`` and ``setup_requires`` arguments to ``setup()``; - ``setup_requires`` allows you to automatically find and download packages - that are needed in order to *build* your project (as opposed to running it). - - * ``setuptools`` now finds its commands, ``setup()`` argument validators, and - metadata writers using entry points, so that they can be extended by - third-party packages. See `Creating distutils Extensions`_ above for more - details. - - * The vestigial ``depends`` command has been removed. It was never finished - or documented, and never would have worked without EasyInstall - which it - pre-dated and was never compatible with. - -0.5a12 - * The zip-safety scanner now checks for modules that might be used with - ``python -m``, and marks them as unsafe for zipping, since Python 2.4 can't - handle ``-m`` on zipped modules. - -0.5a11 - * Fix breakage of the "develop" command that was caused by the addition of - ``--always-unzip`` to the ``easy_install`` command. - -0.5a9 - * Include ``svn:externals`` directories in source distributions as well as - normal subversion-controlled files and directories. - - * Added ``exclude=patternlist`` option to ``setuptools.find_packages()`` - - * Changed --tag-svn-revision to include an "r" in front of the revision number - for better readability. - - * Added ability to build eggs without including source files (except for any - scripts, of course), using the ``--exclude-source-files`` option to - ``bdist_egg``. - - * ``setup.py install`` now automatically detects when an "unmanaged" package - or module is going to be on ``sys.path`` ahead of a package being installed, - thereby preventing the newer version from being imported. If this occurs, - a warning message is output to ``sys.stderr``, but installation proceeds - anyway. The warning message informs the user what files or directories - need deleting, and advises them they can also use EasyInstall (with the - ``--delete-conflicting`` option) to do it automatically. - - * The ``egg_info`` command now adds a ``top_level.txt`` file to the metadata - directory that lists all top-level modules and packages in the distribution. - This is used by the ``easy_install`` command to find possibly-conflicting - "unmanaged" packages when installing the distribution. - - * Added ``zip_safe`` and ``namespace_packages`` arguments to ``setup()``. - Added package analysis to determine zip-safety if the ``zip_safe`` flag - is not given, and advise the author regarding what code might need changing. - - * Fixed the swapped ``-d`` and ``-b`` options of ``bdist_egg``. - -0.5a8 - * The "egg_info" command now always sets the distribution metadata to "safe" - forms of the distribution name and version, so that distribution files will - be generated with parseable names (i.e., ones that don't include '-' in the - name or version). Also, this means that if you use the various ``--tag`` - options of "egg_info", any distributions generated will use the tags in the - version, not just egg distributions. - - * Added support for defining command aliases in distutils configuration files, - under the "[aliases]" section. To prevent recursion and to allow aliases to - call the command of the same name, a given alias can be expanded only once - per command-line invocation. You can define new aliases with the "alias" - command, either for the local, global, or per-user configuration. - - * Added "rotate" command to delete old distribution files, given a set of - patterns to match and the number of files to keep. (Keeps the most - recently-modified distribution files matching each pattern.) - - * Added "saveopts" command that saves all command-line options for the current - invocation to the local, global, or per-user configuration file. Useful for - setting defaults without having to hand-edit a configuration file. - - * Added a "setopt" command that sets a single option in a specified distutils - configuration file. - -0.5a7 - * Added "upload" support for egg and source distributions, including a bug - fix for "upload" and a temporary workaround for lack of .egg support in - PyPI. - -0.5a6 - * Beefed up the "sdist" command so that if you don't have a MANIFEST.in, it - will include all files under revision control (CVS or Subversion) in the - current directory, and it will regenerate the list every time you create a - source distribution, not just when you tell it to. This should make the - default "do what you mean" more often than the distutils' default behavior - did, while still retaining the old behavior in the presence of MANIFEST.in. - - * Fixed the "develop" command always updating .pth files, even if you - specified ``-n`` or ``--dry-run``. - - * Slightly changed the format of the generated version when you use - ``--tag-build`` on the "egg_info" command, so that you can make tagged - revisions compare *lower* than the version specified in setup.py (e.g. by - using ``--tag-build=dev``). - -0.5a5 - * Added ``develop`` command to ``setuptools``-based packages. This command - installs an ``.egg-link`` pointing to the package's source directory, and - script wrappers that ``execfile()`` the source versions of the package's - scripts. This lets you put your development checkout(s) on sys.path without - having to actually install them. (To uninstall the link, use - use ``setup.py develop --uninstall``.) - - * Added ``egg_info`` command to ``setuptools``-based packages. This command - just creates or updates the "projectname.egg-info" directory, without - building an egg. (It's used by the ``bdist_egg``, ``test``, and ``develop`` - commands.) - - * Enhanced the ``test`` command so that it doesn't install the package, but - instead builds any C extensions in-place, updates the ``.egg-info`` - metadata, adds the source directory to ``sys.path``, and runs the tests - directly on the source. This avoids an "unmanaged" installation of the - package to ``site-packages`` or elsewhere. - - * Made ``easy_install`` a standard ``setuptools`` command, moving it from - the ``easy_install`` module to ``setuptools.command.easy_install``. Note - that if you were importing or extending it, you must now change your imports - accordingly. ``easy_install.py`` is still installed as a script, but not as - a module. - -0.5a4 - * Setup scripts using setuptools can now list their dependencies directly in - the setup.py file, without having to manually create a ``depends.txt`` file. - The ``install_requires`` and ``extras_require`` arguments to ``setup()`` - are used to create a dependencies file automatically. If you are manually - creating ``depends.txt`` right now, please switch to using these setup - arguments as soon as practical, because ``depends.txt`` support will be - removed in the 0.6 release cycle. For documentation on the new arguments, - see the ``setuptools.dist.Distribution`` class. - - * Setup scripts using setuptools now always install using ``easy_install`` - internally, for ease of uninstallation and upgrading. - -0.5a1 - * Added support for "self-installation" bootstrapping. Packages can now - include ``ez_setup.py`` in their source distribution, and add the following - to their ``setup.py``, in order to automatically bootstrap installation of - setuptools as part of their setup process:: - - from ez_setup import use_setuptools - use_setuptools() - - from setuptools import setup - # etc... - -0.4a2 - * Added ``ez_setup.py`` installer/bootstrap script to make initial setuptools - installation easier, and to allow distributions using setuptools to avoid - having to include setuptools in their source distribution. - - * All downloads are now managed by the ``PackageIndex`` class (which is now - subclassable and replaceable), so that embedders can more easily override - download logic, give download progress reports, etc. The class has also - been moved to the new ``setuptools.package_index`` module. - - * The ``Installer`` class no longer handles downloading, manages a temporary - directory, or tracks the ``zip_ok`` option. Downloading is now handled - by ``PackageIndex``, and ``Installer`` has become an ``easy_install`` - command class based on ``setuptools.Command``. - - * There is a new ``setuptools.sandbox.run_setup()`` API to invoke a setup - script in a directory sandbox, and a new ``setuptools.archive_util`` module - with an ``unpack_archive()`` API. These were split out of EasyInstall to - allow reuse by other tools and applications. - - * ``setuptools.Command`` now supports reinitializing commands using keyword - arguments to set/reset options. Also, ``Command`` subclasses can now set - their ``command_consumes_arguments`` attribute to ``True`` in order to - receive an ``args`` option containing the rest of the command line. - -0.3a2 - * Added new options to ``bdist_egg`` to allow tagging the egg's version number - with a subversion revision number, the current date, or an explicit tag - value. Run ``setup.py bdist_egg --help`` to get more information. - - * Misc. bug fixes - -0.3a1 - * Initial release. Mailing List and Bug Tracker ============================ -- cgit v1.2.1 From 7f2f3ad3ef977afd8973abd180390692e23c2e10 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 07:15:41 -0400 Subject: Update links to point to local documentation, not legacy docs. --- docs/setuptools.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 6e9a6927..9cda7195 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -88,9 +88,9 @@ current stable version of setuptools. In particular, be sure to read the section on `Custom Installation Locations`_ if you are installing anywhere other than Python's ``site-packages`` directory. -.. _EasyInstall Installation Instructions: http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions +.. _EasyInstall Installation Instructions: easy_install.html#installation-instructions -.. _Custom Installation Locations: http://peak.telecommunity.com/DevCenter/EasyInstall#custom-installation-locations +.. _Custom Installation Locations: easy_install.html#custom-installation-locations If you want the current in-development version of setuptools, you should first install a stable version, and then run:: -- cgit v1.2.1 From b0126d08b69e1eb9e238db49767e2120f6079a12 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 07:16:06 -0400 Subject: Fix typo --- docs/setuptools.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 9cda7195..bd80b960 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -652,7 +652,7 @@ A more complete example would be: ``vcs+proto://host/path@revision#egg=project-version`` Be careful with the version. It should match the one inside the project files. -If you want do disregard the version, you have to omit it both in the +If you want to disregard the version, you have to omit it both in the ``requires`` and in the URL's fragment. This will do a checkout (or a clone, in Git and Mercurial parlance) to a -- cgit v1.2.1 From 82cff1a329896a88f3ee53a9303c295efc99206e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 7 Aug 2013 07:23:37 -0400 Subject: Updated more references to EasyInstall documentation. --- docs/setuptools.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index bd80b960..dfa9ecdd 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -20,7 +20,7 @@ package from source and doesn't have a suitable version already installed. Feature Highlights: * Automatically find/download/install/upgrade dependencies at build time using - the `EasyInstall tool `_, + the `EasyInstall tool `_, which supports downloading via HTTP, FTP, Subversion, and SourceForge, and automatically scans web pages linked from PyPI to find download links. (It's the closest thing to CPAN currently available for Python.) @@ -1947,7 +1947,7 @@ them in a ``[develop]`` section or on the command line. ============================================ This command runs the `EasyInstall tool -`_ for you. It is exactly +`_ for you. It is exactly equivalent to running the ``easy_install`` command. All command line arguments following this command are consumed and not processed further by the distutils, so this must be the last command listed on the command line. Please see -- cgit v1.2.1 From 409327e443b73125a1a8803a5323a6dadbef7119 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 20:25:04 -0400 Subject: Clean up imports --- setuptools.egg-info/requires.txt | 14 +++++++------- setuptools/tests/test_resources.py | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 668f4ee2..e4fb4954 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ -[certs] -certifi==0.0.8 - -[ssl:python_version in '2.4, 2.5'] -ssl==1.16 - [ssl:sys_platform=='win32' and python_version=='2.4'] ctypes==1.0.2 [ssl:sys_platform=='win32'] -wincertstore==0.1 \ No newline at end of file +wincertstore==0.1 + +[certs] +certifi==0.0.8 + +[ssl:python_version in '2.4, 2.5'] +ssl==1.16 \ No newline at end of file diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index df5261d1..949ebef4 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -1,11 +1,21 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove -from unittest import TestCase, makeSuite; from pkg_resources import * + +import os +import sys +import tempfile +import shutil +from unittest import TestCase + +import pkg_resources +from pkg_resources import * + from setuptools.command.easy_install import get_script_header, is_sh from setuptools.compat import StringIO, iteritems -import os, pkg_resources, sys, tempfile, shutil -try: frozenset + +try: + frozenset except NameError: from sets import ImmutableSet as frozenset -- cgit v1.2.1 From a2d99b96997341955cd281ab8454b60555c0af48 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 20:36:15 -0400 Subject: Spruce up syntax to to address linter warnings --- setuptools/tests/test_resources.py | 68 +++++++++++++++----------------------- 1 file changed, 26 insertions(+), 42 deletions(-) diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 949ebef4..909f1df3 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove +# NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove import os import sys @@ -83,14 +83,20 @@ class DistroTests(TestCase): # Nominal case: no distros on path, should yield all applicable self.assertEqual(ad.best_match(req,ws).version, '1.9') # If a matching distro is already installed, should return only that - ws.add(foo14); self.assertEqual(ad.best_match(req,ws).version, '1.4') + ws.add(foo14) + self.assertEqual(ad.best_match(req,ws).version, '1.4') # If the first matching distro is unsuitable, it's a version conflict - ws = WorkingSet([]); ws.add(foo12); ws.add(foo14) + ws = WorkingSet([]) + ws.add(foo12) + ws.add(foo14) self.assertRaises(VersionConflict, ad.best_match, req, ws) # If more than one match on the path, the first one takes precedence - ws = WorkingSet([]); ws.add(foo14); ws.add(foo12); ws.add(foo14); + ws = WorkingSet([]) + ws.add(foo14) + ws.add(foo12) + ws.add(foo14) self.assertEqual(ad.best_match(req,ws).version, '1.4') def checkFooPkg(self,d): @@ -127,7 +133,6 @@ class DistroTests(TestCase): ) self.checkFooPkg(d) - def distRequires(self, txt): return Distribution("/foo", metadata=Metadata(('depends.txt', txt))) @@ -141,11 +146,11 @@ class DistroTests(TestCase): for v in "Twisted>=1.5", "Twisted>=1.5\nZConfig>=2.0": self.checkRequires(self.distRequires(v), v) - def testResolve(self): - ad = Environment([]); ws = WorkingSet([]) + ad = Environment([]) + ws = WorkingSet([]) # Resolving no requirements -> nothing to install - self.assertEqual( list(ws.resolve([],ad)), [] ) + self.assertEqual(list(ws.resolve([],ad)), []) # Request something not in the collection -> DistributionNotFound self.assertRaises( DistributionNotFound, ws.resolve, parse_requirements("Foo"), ad @@ -154,7 +159,8 @@ class DistroTests(TestCase): "/foo_dir/Foo-1.2.egg", metadata=Metadata(('depends.txt', "[bar]\nBaz>=2.0")) ) - ad.add(Foo); ad.add(Distribution.from_filename("Foo-0.9.egg")) + ad.add(Foo) + ad.add(Distribution.from_filename("Foo-0.9.egg")) # Request thing(s) that are available -> list to activate for i in range(3): @@ -179,9 +185,8 @@ class DistroTests(TestCase): list(ws.resolve(parse_requirements("Foo[bar]"), ad)), [Foo,Baz] ) # Requests for conflicting versions produce VersionConflict - self.assertRaises( VersionConflict, - ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad - ) + self.assertRaises(VersionConflict, + ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad) def testDistroDependsOptions(self): d = self.distRequires(""" @@ -314,8 +319,8 @@ class RequirementsTests(TestCase): def testBasicContains(self): r = Requirement("Twisted", [('>=','1.2')], ()) foo_dist = Distribution.from_filename("FooPkg-1.3_1.egg") - twist11 = Distribution.from_filename("Twisted-1.1.egg") - twist12 = Distribution.from_filename("Twisted-1.2.egg") + twist11 = Distribution.from_filename("Twisted-1.1.egg") + twist12 = Distribution.from_filename("Twisted-1.2.egg") self.assertTrue(parse_version('1.2') in r) self.assertTrue(parse_version('1.1') not in r) self.assertTrue('1.2' in r) @@ -331,7 +336,6 @@ class RequirementsTests(TestCase): for v in ('1.2c1','1.3.1','1.5','1.9.1','2.0','2.5','3.0','4.0'): self.assertTrue(v not in r, (v,r)) - def testOptionsAndHashing(self): r1 = Requirement.parse("Twisted[foo,bar]>=1.2") r2 = Requirement.parse("Twisted[bar,FOO]>=1.2") @@ -376,15 +380,6 @@ class RequirementsTests(TestCase): Requirement.parse('setuptools >= 0.7').project_name, 'setuptools') - - - - - - - - - class ParseTests(TestCase): def testEmptyParse(self): @@ -398,9 +393,7 @@ class ParseTests(TestCase): self.assertEqual(list(pkg_resources.yield_lines(inp)),out) def testSplitting(self): - self.assertEqual( - list( - pkg_resources.split_sections(""" + sample = """ x [Y] z @@ -413,8 +406,7 @@ class ParseTests(TestCase): [q] v """ - ) - ), + self.assertEqual(list(pkg_resources.split_sections(sample)), [(None,["x"]), ("Y",["z","a"]), ("b",["c"]), ("d",[]), ("q",["v"])] ) self.assertRaises(ValueError,list,pkg_resources.split_sections("[foo")) @@ -465,7 +457,8 @@ class ParseTests(TestCase): c('0pre1', '0.0c1') c('0.0.0preview1', '0c1') c('0.0c1', '0-rc1') - c('1.2a1', '1.2.a.1'); c('1.2...a', '1.2a') + c('1.2a1', '1.2.a.1') + c('1.2...a', '1.2a') def testVersionOrdering(self): def c(s1,s2): @@ -502,12 +495,6 @@ class ParseTests(TestCase): c(v2,v1) - - - - - - class ScriptHeaderTests(TestCase): non_ascii_exe = '/Users/José/bin/python' @@ -525,7 +512,7 @@ class ScriptHeaderTests(TestCase): def test_get_script_header_jython_workaround(self): # This test doesn't work with Python 3 in some locales if (sys.version_info >= (3,) and os.environ.get("LC_CTYPE") - in (None, "C", "POSIX")): + in (None, "C", "POSIX")): return class java: @@ -564,8 +551,6 @@ class ScriptHeaderTests(TestCase): sys.stdout, sys.stderr = stdout, stderr - - class NamespaceTests(TestCase): def setUp(self): @@ -620,6 +605,5 @@ class NamespaceTests(TestCase): self.assertEqual(pkg_resources._namespace_packages["pkg1"], ["pkg1.pkg2"]) # check the __path__ attribute contains both paths self.assertEqual(pkg1.pkg2.__path__, [ - os.path.join(self._tmpdir, "site-pkgs", "pkg1", "pkg2"), - os.path.join(self._tmpdir, "site-pkgs2", "pkg1", "pkg2") ]) - + os.path.join(self._tmpdir, "site-pkgs", "pkg1", "pkg2"), + os.path.join(self._tmpdir, "site-pkgs2", "pkg1", "pkg2")]) -- cgit v1.2.1 From 27d755c7c26d3b677134accf6a92de58e6e97827 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 21:18:21 -0400 Subject: Remove import * --- setuptools.egg-info/requires.txt | 8 ++++---- setuptools/tests/test_resources.py | 40 +++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index e4fb4954..5ff415da 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,8 +1,5 @@ -[ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 - [ssl:sys_platform=='win32'] wincertstore==0.1 @@ -10,4 +7,7 @@ wincertstore==0.1 certifi==0.0.8 [ssl:python_version in '2.4, 2.5'] -ssl==1.16 \ No newline at end of file +ssl==1.16 + +[ssl:sys_platform=='win32' and python_version=='2.4'] +ctypes==1.0.2 \ No newline at end of file diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 909f1df3..06fbba50 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -9,7 +9,9 @@ import shutil from unittest import TestCase import pkg_resources -from pkg_resources import * +from pkg_resources import (parse_requirements, VersionConflict, parse_version, + Distribution, EntryPoint, Requirement, safe_version, safe_name, + WorkingSet) from setuptools.command.easy_install import get_script_header, is_sh from setuptools.compat import StringIO, iteritems @@ -25,11 +27,11 @@ def safe_repr(obj, short=False): result = repr(obj) except Exception: result = object.__repr__(obj) - if not short or len(result) < _MAX_LENGTH: + if not short or len(result) < pkg_resources._MAX_LENGTH: return result - return result[:_MAX_LENGTH] + ' [truncated]...' + return result[:pkg_resources._MAX_LENGTH] + ' [truncated]...' -class Metadata(EmptyProvider): +class Metadata(pkg_resources.EmptyProvider): """Mock object to return metadata as if from an on-disk distribution""" def __init__(self,*pairs): @@ -42,18 +44,20 @@ class Metadata(EmptyProvider): return self.metadata[name] def get_metadata_lines(self,name): - return yield_lines(self.get_metadata(name)) + return pkg_resources.yield_lines(self.get_metadata(name)) + +dist_from_fn = pkg_resources.Distribution.from_filename class DistroTests(TestCase): def testCollection(self): # empty path should produce no distributions - ad = Environment([], platform=None, python=None) + ad = pkg_resources.Environment([], platform=None, python=None) self.assertEqual(list(ad), []) self.assertEqual(ad['FooPkg'],[]) - ad.add(Distribution.from_filename("FooPkg-1.3_1.egg")) - ad.add(Distribution.from_filename("FooPkg-1.4-py2.4-win32.egg")) - ad.add(Distribution.from_filename("FooPkg-1.2-py2.4.egg")) + ad.add(dist_from_fn("FooPkg-1.3_1.egg")) + ad.add(dist_from_fn("FooPkg-1.4-py2.4-win32.egg")) + ad.add(dist_from_fn("FooPkg-1.2-py2.4.egg")) # Name is in there now self.assertTrue(ad['FooPkg']) @@ -70,14 +74,14 @@ class DistroTests(TestCase): [dist.version for dist in ad['FooPkg']], ['1.4','1.2'] ) # And inserting adds them in order - ad.add(Distribution.from_filename("FooPkg-1.9.egg")) + ad.add(dist_from_fn("FooPkg-1.9.egg")) self.assertEqual( [dist.version for dist in ad['FooPkg']], ['1.9','1.4','1.2'] ) ws = WorkingSet([]) - foo12 = Distribution.from_filename("FooPkg-1.2-py2.4.egg") - foo14 = Distribution.from_filename("FooPkg-1.4-py2.4-win32.egg") + foo12 = dist_from_fn("FooPkg-1.2-py2.4.egg") + foo14 = dist_from_fn("FooPkg-1.4-py2.4-win32.egg") req, = parse_requirements("FooPkg>=1.3") # Nominal case: no distros on path, should yield all applicable @@ -119,9 +123,9 @@ class DistroTests(TestCase): self.assertEqual(d.platform, None) def testDistroParse(self): - d = Distribution.from_filename("FooPkg-1.3_1-py2.4-win32.egg") + d = dist_from_fn("FooPkg-1.3_1-py2.4-win32.egg") self.checkFooPkg(d) - d = Distribution.from_filename("FooPkg-1.3_1-py2.4-win32.egg-info") + d = dist_from_fn("FooPkg-1.3_1-py2.4-win32.egg-info") self.checkFooPkg(d) def testDistroMetadata(self): @@ -147,13 +151,13 @@ class DistroTests(TestCase): self.checkRequires(self.distRequires(v), v) def testResolve(self): - ad = Environment([]) + ad = pkg_resources.Environment([]) ws = WorkingSet([]) # Resolving no requirements -> nothing to install self.assertEqual(list(ws.resolve([],ad)), []) # Request something not in the collection -> DistributionNotFound self.assertRaises( - DistributionNotFound, ws.resolve, parse_requirements("Foo"), ad + pkg_resources.DistributionNotFound, ws.resolve, parse_requirements("Foo"), ad ) Foo = Distribution.from_filename( "/foo_dir/Foo-1.2.egg", @@ -173,7 +177,7 @@ class DistroTests(TestCase): # Request an extra that causes an unresolved dependency for "Baz" self.assertRaises( - DistributionNotFound, ws.resolve,parse_requirements("Foo[bar]"), ad + pkg_resources.DistributionNotFound, ws.resolve,parse_requirements("Foo[bar]"), ad ) Baz = Distribution.from_filename( "/foo_dir/Baz-2.1.egg", metadata=Metadata(('depends.txt', "Foo")) @@ -211,7 +215,7 @@ class DistroTests(TestCase): d,"Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3".split(), ["fastcgi", "docgen"] ) - self.assertRaises(UnknownExtra, d.requires, ["foo"]) + self.assertRaises(pkg_resources.UnknownExtra, d.requires, ["foo"]) class EntryPointTests(TestCase): -- cgit v1.2.1 From 4378eda9d4c5d20a79d6df6770ed83421fc1abcb Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 21:52:34 -0400 Subject: Fixed test_get_script_header failures on Windows when Python is in a directory with spaces --- setuptools/tests/test_resources.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 06fbba50..15f44da4 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -13,7 +13,8 @@ from pkg_resources import (parse_requirements, VersionConflict, parse_version, Distribution, EntryPoint, Requirement, safe_version, safe_name, WorkingSet) -from setuptools.command.easy_install import get_script_header, is_sh +from setuptools.command.easy_install import (get_script_header, is_sh, + nt_quote_arg) from setuptools.compat import StringIO, iteritems try: @@ -505,10 +506,12 @@ class ScriptHeaderTests(TestCase): def test_get_script_header(self): if not sys.platform.startswith('java') or not is_sh(sys.executable): # This test is for non-Jython platforms + expected = '#!%s\n' % nt_quote_arg(os.path.normpath(sys.executable)) self.assertEqual(get_script_header('#!/usr/local/bin/python'), - '#!%s\n' % os.path.normpath(sys.executable)) + expected) + expected = '#!%s -x\n' % nt_quote_arg(os.path.normpath(sys.executable)) self.assertEqual(get_script_header('#!/usr/bin/python -x'), - '#!%s -x\n' % os.path.normpath(sys.executable)) + expected) self.assertEqual(get_script_header('#!/usr/bin/python', executable=self.non_ascii_exe), '#!%s -x\n' % self.non_ascii_exe) -- cgit v1.2.1 From c5779cbe9f0e1b77ad650c2ce19e4358ddce7226 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 22:02:00 -0400 Subject: Added test to capture behavior expected behavior on Windows with spaces in the filename --- setuptools.egg-info/requires.txt | 12 ++++++------ setuptools/tests/test_resources.py | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 5ff415da..5de4d6e7 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ -[ssl:sys_platform=='win32'] -wincertstore==0.1 - [certs] certifi==0.0.8 -[ssl:python_version in '2.4, 2.5'] -ssl==1.16 +[ssl:sys_platform=='win32'] +wincertstore==0.1 [ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 \ No newline at end of file +ctypes==1.0.2 + +[ssl:python_version in '2.4, 2.5'] +ssl==1.16 \ No newline at end of file diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 15f44da4..c9fcf76c 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -502,6 +502,7 @@ class ParseTests(TestCase): class ScriptHeaderTests(TestCase): non_ascii_exe = '/Users/José/bin/python' + exe_with_spaces = r'C:\Program Files\Python33\python.exe' def test_get_script_header(self): if not sys.platform.startswith('java') or not is_sh(sys.executable): @@ -515,6 +516,9 @@ class ScriptHeaderTests(TestCase): self.assertEqual(get_script_header('#!/usr/bin/python', executable=self.non_ascii_exe), '#!%s -x\n' % self.non_ascii_exe) + candidate = get_script_header('#!/usr/bin/python', + executable=self.exe_with_spaces) + self.assertEqual(candidate, '#!"%s"\n' % self.exe_with_spaces) def test_get_script_header_jython_workaround(self): # This test doesn't work with Python 3 in some locales -- cgit v1.2.1 From f3f0c144dcfec41924e2e3eac3cbbaa81cb53819 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 22:12:06 -0400 Subject: Fixed script header generation in easy_install tests. Fixes #37. --- setuptools/tests/test_easy_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 2732bb3e..189e3d55 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -14,7 +14,7 @@ import distutils.core from setuptools.compat import StringIO, BytesIO, next, urlparse from setuptools.sandbox import run_setup, SandboxViolation -from setuptools.command.easy_install import easy_install, fix_jython_executable, get_script_args +from setuptools.command.easy_install import easy_install, fix_jython_executable, get_script_args, nt_quote_arg from setuptools.command.easy_install import PthDistributions from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution @@ -52,7 +52,7 @@ if __name__ == '__main__': sys.exit( load_entry_point('spec', 'console_scripts', 'name')() ) -""" % fix_jython_executable(sys.executable, "") +""" % nt_quote_arg(fix_jython_executable(sys.executable, "")) SETUP_PY = """\ from setuptools import setup -- cgit v1.2.1 From 4b432e0f50e9f5871a2f7375b406be7258bfa22c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 22:45:59 -0400 Subject: Issue 50: Removed filename and line number from SyntaxErrors returned by invalid_marker. This change simplifies the test and paves the way for supporting PyPy. --- CHANGES.txt | 10 ++++++++++ pkg_resources.py | 12 +++++++++++- tests/api_tests.txt | 8 ++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b2729aac..d3c6f989 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,16 @@ CHANGES ======= +--- +1.0 +--- + +* Issue #50: Normalized API of environment marker support. Specifically, + removed line number and filename from SyntaxErrors when returned from + `pkg_resources.invalid_marker`. Any clients depending on the specific + string representation of exceptions returned by that function may need to + be updated to account for this change. + ----- 0.9.8 ----- diff --git a/pkg_resources.py b/pkg_resources.py index 36a0e6ed..7c3bdccd 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1267,12 +1267,22 @@ def _pyimp(): else: return 'CPython' +def normalize_exception(exc): + """ + Given a SyntaxError from a marker evaluation, normalize the error message: + - Remove indications of filename and line number. + """ + exc.filename = None + exc.lineno = None + return exc + + def invalid_marker(text): """Validate text as a PEP 426 environment marker; return exception or False""" try: evaluate_marker(text) except SyntaxError: - return sys.exc_info()[1] + return normalize_exception(sys.exc_info()[1]) return False def evaluate_marker(text, extra=None, _ops={}): diff --git a/tests/api_tests.txt b/tests/api_tests.txt index 86ca245d..38b762d2 100644 --- a/tests/api_tests.txt +++ b/tests/api_tests.txt @@ -341,8 +341,8 @@ Environment Markers >>> print(im("sys_platform")) Comparison or logical expression expected - >>> print(im("sys_platform==")) # doctest: +ELLIPSIS - unexpected EOF while parsing (...line 1) + >>> print(im("sys_platform==")) + unexpected EOF while parsing >>> print(im("sys_platform=='win32'")) False @@ -353,8 +353,8 @@ Environment Markers >>> print(im("(extra)")) Comparison or logical expression expected - >>> print(im("(extra")) # doctest: +ELLIPSIS - unexpected EOF while parsing (...line 1) + >>> print(im("(extra")) + unexpected EOF while parsing >>> print(im("os.open('foo')=='y'")) Language feature not supported in environment markers -- cgit v1.2.1 From b383fe311089ed6488916614acbf085521c12e48 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 22:53:38 -0400 Subject: Replaced overly-specific error messages with more general ones for improved cross-implementation compatibility. Fixes #50. --- CHANGES.txt | 2 ++ pkg_resources.py | 6 ++++++ tests/api_tests.txt | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d3c6f989..b9a53a0c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -11,6 +11,8 @@ CHANGES `pkg_resources.invalid_marker`. Any clients depending on the specific string representation of exceptions returned by that function may need to be updated to account for this change. +* Issue #50: SyntaxErrors generated by `pkg_resources.invalid_marker` are + normalized for cross-implementation consistency. ----- 0.9.8 diff --git a/pkg_resources.py b/pkg_resources.py index 7c3bdccd..5514a099 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1271,9 +1271,15 @@ def normalize_exception(exc): """ Given a SyntaxError from a marker evaluation, normalize the error message: - Remove indications of filename and line number. + - Replace platform-specific error messages with standard error messages. """ + subs = { + 'unexpected EOF while parsing': 'invalid syntax', + 'parenthesis is never closed': 'invalid syntax', + } exc.filename = None exc.lineno = None + exc.msg = subs.get(exc.msg, exc.msg) return exc diff --git a/tests/api_tests.txt b/tests/api_tests.txt index 38b762d2..d34f2314 100644 --- a/tests/api_tests.txt +++ b/tests/api_tests.txt @@ -342,7 +342,7 @@ Environment Markers Comparison or logical expression expected >>> print(im("sys_platform==")) - unexpected EOF while parsing + invalid syntax >>> print(im("sys_platform=='win32'")) False @@ -354,7 +354,7 @@ Environment Markers Comparison or logical expression expected >>> print(im("(extra")) - unexpected EOF while parsing + invalid syntax >>> print(im("os.open('foo')=='y'")) Language feature not supported in environment markers -- cgit v1.2.1 From da1761c890a5d754caece50df870c30f9dfdd4f7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 9 Aug 2013 22:57:08 -0400 Subject: Bumped to 1.0 in preparation for next release. --- ez_setup.py | 2 +- setuptools/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 4eb79510..5a5ff260 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -28,7 +28,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "0.9.9" +DEFAULT_VERSION = "1.0" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools/version.py b/setuptools/version.py index 1b1a934d..7e49527e 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '0.9.9' +__version__ = '1.0' -- cgit v1.2.1 From 3e6dd67c4ae9a6df3c25fb4a04d62f7297d47f3b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 09:04:34 -0400 Subject: Issue 60: Implemented experimental opt-in support for using native launchers rather than installing launcher executables. My initial experience with this technique has been very positive. --- CHANGES.txt | 7 +++++ docs/easy_install.txt | 9 ++++++ setuptools/command/easy_install.py | 63 ++++++++++++++++++++++++++------------ 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b9a53a0c..c45b793b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,13 @@ CHANGES 1.0 --- +* On Windows, Setuptools supports deferring to Vinay Sajip's `pylauncher + `_ (included with Python 3.3) to + launch console and GUI scripts and not install its own launcher + executables. This experimental functionality is currently only enabled if + the ``SETUPTOOLS_USE_PYLAUNCHER`` environment variable is set (to anything). + In the future, this behavior may become default, but only after it has + matured and seen substantial adoption. * Issue #50: Normalized API of environment marker support. Specifically, removed line number and filename from SyntaxErrors when returned from `pkg_resources.invalid_marker`. Any clients depending on the specific diff --git a/docs/easy_install.txt b/docs/easy_install.txt index 12bc73ea..92e770b7 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -96,6 +96,15 @@ sections below on `Command-Line Options`_ and `Configuration Files`_. You can pass command line options (such as ``--script-dir``) to ``ez_setup.py`` to control where ``easy_install.exe`` will be installed. +Setuptools also supports deferring to an external launcher such as +`pylauncher `_ for launching scripts. +Enable this experimental functionality by setting the +``SETUPTOOLS_USE_PYLAUNCHER`` environment variable. Setuptools will then not +install its own launcher executable, but will install scripts as simple +scripts with a .py (or .pyw) extension appended. If these extensions are +associated with the pylauncher and listed in the PATHEXT environment variable, +these scripts can then be invoked simply and directly just like any other +executable. Downloading and Installing a Package diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 5be48bb1..6a45e596 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1818,7 +1818,7 @@ class ScriptWriter(object): @classmethod def get_writer(cls, force_windows): if force_windows or sys.platform=='win32': - return WindowsScriptWriter + return WindowsScriptWriter.get_writer() return cls @classmethod @@ -1828,6 +1828,49 @@ class ScriptWriter(object): class WindowsScriptWriter(ScriptWriter): + @classmethod + def get_writer(cls): + """ + Get a script writer suitable for Windows + """ + # for compatibility, return the writer that creates exe launchers + # unless the SETUPTOOLS_USE_PYLAUNCHER is set, indicating + # future behavior. + use_legacy = 'SETUPTOOLS_USE_PYLAUNCHER' not in os.environ + if use_legacy: + return WindowsLauncherScriptWriter + return cls + + @classmethod + def _get_script_args(cls, type_, name, header, script_text): + "For Windows, add a .py extension" + ext = dict(console='.py', gui='.pyw')[type_] + old = ['.py', '.pyc', '.pyo', '.pyw', '.exe'] + old.remove(ext) + header = cls._adjust_header(type_, header) + blockers = [name+x for x in old] + yield name+ext, header+script_text, 't', blockers + + @staticmethod + def _adjust_header(type_, orig_header): + """ + Make sure 'pythonw' is used for gui and and 'python' is used for + console (regardless of what sys.executable is). + """ + pattern = 'pythonw.exe' + repl = 'python.exe' + if type_ == 'gui': + pattern, repl = repl, pattern + pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE) + new_header = pattern_ob.sub(string=orig_header, repl=repl) + 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 + + +class WindowsLauncherScriptWriter(WindowsScriptWriter): @classmethod def _get_script_args(cls, type_, name, header, script_text): """ @@ -1857,24 +1900,6 @@ class WindowsScriptWriter(ScriptWriter): m_name = name + '.exe.manifest' yield (m_name, load_launcher_manifest(name), 't') - @staticmethod - def _adjust_header(type_, orig_header): - """ - Make sure 'pythonw' is used for gui and and 'python' is used for - console (regardless of what sys.executable is). - """ - pattern = 'pythonw.exe' - repl = 'python.exe' - if type_ == 'gui': - pattern, repl = repl, pattern - pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE) - new_header = pattern_ob.sub(string=orig_header, repl=repl) - 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 - # for backward-compatibility get_script_args = ScriptWriter.get_script_args -- cgit v1.2.1 From 8f7b0128ebb408b980162863eb865bf9e6e3ce22 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 09:27:33 -0400 Subject: Minimum Python version is 2.4 --- docs/easy_install.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/easy_install.txt b/docs/easy_install.txt index 92e770b7..03f816de 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -35,9 +35,8 @@ Please see the `setuptools PyPI page `_ for download links and basic installation instructions for each of the supported platforms. -You will need at least Python 2.3.5, or if you are on a 64-bit platform, Python -2.4. An ``easy_install`` script will be installed in the normal location for -Python scripts on your platform. +You will need at least Python 2.4. An ``easy_install`` script will be +installed in the normal location for Python scripts on your platform. Note that the instructions on the setuptools PyPI page assume that you are are installling to Python's primary ``site-packages`` directory. If this is -- cgit v1.2.1 From e29ad44c0a1e8025c154c9afb4418f143019379f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 10:14:22 -0400 Subject: Issue #63: Initial implementation of a mechanism for securely bootstrapping setuptools, leveraging system tools for trust validation. --- ez_setup.py | 75 ++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 5a5ff260..98d15f22 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -20,6 +20,7 @@ import tempfile import tarfile import optparse import subprocess +import platform from distutils import log @@ -141,6 +142,59 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, return _do_download(version, download_base, to_dir, download_delay) +def download_file_powershell(url, target): + """ + Download the file at url to target using Powershell (which will validate + trust). Raise an exception if the command cannot complete. + """ + target = os.path.abspath(target) + cmd = [ + 'powershell', + '-Command', + "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" % vars(), + ] + subprocess.check_call(cmd) + +download_file_powershell.viable = ( + lambda: platform.name() == 'Windows' and platform.win32_ver()[1] >= '6' +) + +def download_file_insecure(url, target): + """ + Use Python to download the file, even though it cannot authenticate the + connection. + """ + try: + from urllib.request import urlopen + except ImportError: + from urllib2 import urlopen + src = dst = None + try: + src = urlopen(url) + # Read/write all in one block, so we don't create a corrupt file + # if the download is interrupted. + data = src.read() + dst = open(target, "wb") + dst.write(data) + finally: + if src: + src.close() + if dst: + dst.close() + +download_file_insecure.viable = lambda: True + +def get_best_downloader(): + downloaders = [ + download_file_powershell, + #download_file_curl, + #download_file_wget, + download_file_insecure, + ] + + for dl in downloaders: + if dl.viable(): + return dl def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15): @@ -154,28 +208,13 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, """ # making sure we use the absolute path to_dir = os.path.abspath(to_dir) - try: - from urllib.request import urlopen - except ImportError: - from urllib2 import urlopen tgz_name = "setuptools-%s.tar.gz" % version url = download_base + tgz_name saveto = os.path.join(to_dir, tgz_name) - src = dst = None if not os.path.exists(saveto): # Avoid repeated downloads - try: - log.warn("Downloading %s", url) - src = urlopen(url) - # Read/write all in one block, so we don't create a corrupt file - # if the download is interrupted. - data = src.read() - dst = open(saveto, "wb") - dst.write(data) - finally: - if src: - src.close() - if dst: - dst.close() + log.warn("Downloading %s", url) + downloader = get_best_downloader() + downloader(url, saveto) return os.path.realpath(saveto) -- cgit v1.2.1 From 87a0b2190cb40c18f5dd98e7842c197e17a452e2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 12:35:20 -0400 Subject: Implemented curl support for bootstrapping. --- ez_setup.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ez_setup.py b/ez_setup.py index 98d15f22..3b086260 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -159,6 +159,20 @@ download_file_powershell.viable = ( lambda: platform.name() == 'Windows' and platform.win32_ver()[1] >= '6' ) +def download_file_curl(url, target): + cmd = ['curl %(url)r -o %(target)s'] + subprocess.check_call(cmd) + +def has_curl(): + cmd = ['curl --version'] + try: + subprocess.check_call(cmd) + except: + return False + return True + +download_file_curl.viable = has_curl + def download_file_insecure(url, target): """ Use Python to download the file, even though it cannot authenticate the @@ -187,7 +201,7 @@ download_file_insecure.viable = lambda: True def get_best_downloader(): downloaders = [ download_file_powershell, - #download_file_curl, + download_file_curl, #download_file_wget, download_file_insecure, ] -- cgit v1.2.1 From 6e757a7f0364d7a43ea2c2844b28690d30137661 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 12:43:23 -0400 Subject: Implemented download using wget --- ez_setup.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 3b086260..3b41ab8b 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -160,11 +160,11 @@ download_file_powershell.viable = ( ) def download_file_curl(url, target): - cmd = ['curl %(url)r -o %(target)s'] + cmd = ['curl', url, '-o', target] subprocess.check_call(cmd) def has_curl(): - cmd = ['curl --version'] + cmd = ['curl', '--version'] try: subprocess.check_call(cmd) except: @@ -173,6 +173,20 @@ def has_curl(): download_file_curl.viable = has_curl +def download_file_wget(url, target): + cmd = ['wget', url, '-q', '-O', target] + subprocess.check_call(cmd) + +def has_wget(): + cmd = ['wget', '--version'] + try: + subprocess.check_call(cmd) + except: + return False + return True + +download_file_curl.viable = has_wget + def download_file_insecure(url, target): """ Use Python to download the file, even though it cannot authenticate the @@ -202,7 +216,7 @@ def get_best_downloader(): downloaders = [ download_file_powershell, download_file_curl, - #download_file_wget, + download_file_wget, download_file_insecure, ] -- cgit v1.2.1 From 3f9eef3cde6b1a03d64535fa02dd4f1c5d8b2a08 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 12:48:35 -0400 Subject: Use more explicit command-line parameters --- ez_setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 3b41ab8b..72d250a2 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -160,7 +160,7 @@ download_file_powershell.viable = ( ) def download_file_curl(url, target): - cmd = ['curl', url, '-o', target] + cmd = ['curl', url, '--silent', '--output', target] subprocess.check_call(cmd) def has_curl(): @@ -174,7 +174,7 @@ def has_curl(): download_file_curl.viable = has_curl def download_file_wget(url, target): - cmd = ['wget', url, '-q', '-O', target] + cmd = ['wget', url, '--quiet', '--output-document', target] subprocess.check_call(cmd) def has_wget(): -- cgit v1.2.1 From 8e7f9858be7f4869b4ff9d9b81fea2093086be3d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 13:09:56 -0400 Subject: Suppress output when checking viability of wget/curl. Fixed viability assignment and Windows platform detection. --- ez_setup.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 72d250a2..a9c9cbf0 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -156,7 +156,7 @@ def download_file_powershell(url, target): subprocess.check_call(cmd) download_file_powershell.viable = ( - lambda: platform.name() == 'Windows' and platform.win32_ver()[1] >= '6' + lambda: platform.system() == 'Windows' and platform.win32_ver()[1] >= '6' ) def download_file_curl(url, target): @@ -165,10 +165,13 @@ def download_file_curl(url, target): def has_curl(): cmd = ['curl', '--version'] + devnull = open(os.path.devnull, 'wb') try: - subprocess.check_call(cmd) + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) except: return False + finally: + devnull.close() return True download_file_curl.viable = has_curl @@ -179,13 +182,16 @@ def download_file_wget(url, target): def has_wget(): cmd = ['wget', '--version'] + devnull = open(os.path.devnull, 'wb') try: - subprocess.check_call(cmd) + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) except: return False + finally: + devnull.close() return True -download_file_curl.viable = has_wget +download_file_wget.viable = has_wget def download_file_insecure(url, target): """ -- cgit v1.2.1 From 38798cd5dcb8c5353d31ed0f882118067f09547f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 13:18:06 -0400 Subject: Restore Python 2.4 compatibility in ez_setup --- ez_setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ez_setup.py b/ez_setup.py index a9c9cbf0..00cf47aa 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -36,6 +36,15 @@ def _python_cmd(*args): args = (sys.executable,) + args return subprocess.call(args) == 0 +def _check_call_py24(cmd, *args, **kwargs): + res = subprocess.call(cmd, *args, **kwargs) + class CalledProcessError(Exception): + pass + if not res == 0: + msg = "Command '%s' return non-zero exit status %d" % (cmd, res) + raise CalledProcessError(msg) +vars(subprocess).setdefault('check_call', _check_call_py24) + def _install(tarball, install_args=()): # extracting the tarball tmpdir = tempfile.mkdtemp() -- cgit v1.2.1 From ab7021eb36d66bbe00f711f31a5471af2bc73974 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 13:23:42 -0400 Subject: Updated changelog. Fixes #63. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index c45b793b..a030c151 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,6 +20,10 @@ CHANGES be updated to account for this change. * Issue #50: SyntaxErrors generated by `pkg_resources.invalid_marker` are normalized for cross-implementation consistency. +* Issue #63: Bootstrap script (ez_setup.py) now prefers Powershell, curl, or + wget for retrieving the Setuptools tarball for improved security of the + install. The script will still fall back to a simple ``urlopen`` on + platforms that do not have these tools. ----- 0.9.8 -- cgit v1.2.1 From 6f6edeb7c7b1fb95b02f78ff3794c387afce084c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 10 Aug 2013 13:29:00 -0400 Subject: Added tag 1.0b1 for changeset 7b91ff93a30e --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 21e59929..b91a42d7 100644 --- a/.hgtags +++ b/.hgtags @@ -89,3 +89,4 @@ e3d70539e79f39a97f69674ab038661961a1eb43 0.8 acc6c5d61d0f82040c237ac7ea010c0fc9e67d66 0.9.6 19965a03c1d5231c894e0fabfaf45af1fd99f484 0.9.7 e0a6e225ad6b28471cd42cfede6e8a334bb548fb 0.9.8 +7b91ff93a30ef78634b7bb34f4a6229a5de281ee 1.0b1 -- cgit v1.2.1 From 8a33154bb30c9c0ca193d13d8b8ce3818e045d71 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Aug 2013 08:24:29 -0400 Subject: Officially deprecated Features functionality (per #65). --- CHANGES.txt | 1 + setuptools/dist.py | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a030c151..50310ef2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,6 +24,7 @@ CHANGES wget for retrieving the Setuptools tarball for improved security of the install. The script will still fall back to a simple ``urlopen`` on platforms that do not have these tools. +* Issue #65: Deprecated the ``Features`` functionality. ----- 0.9.8 diff --git a/setuptools/dist.py b/setuptools/dist.py index 01889215..e9d0b5a2 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -2,6 +2,7 @@ __all__ = ['Distribution'] import re import sys +import warnings from distutils.core import Distribution as _Distribution from setuptools.depends import Require from setuptools.command.install import install @@ -132,7 +133,7 @@ def check_packages(dist, attr, value): "WARNING: %r not a valid package name; please use only" ".-separated package names in setup.py", pkgname ) - + @@ -194,7 +195,8 @@ class Distribution(_Distribution): EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. - 'features' -- a dictionary mapping option names to 'setuptools.Feature' + 'features' **deprecated** -- a dictionary mapping option names to + 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted @@ -252,6 +254,8 @@ class Distribution(_Distribution): have_package_data = hasattr(self, "package_data") if not have_package_data: self.package_data = {} + if 'features' in attrs or 'require_features' in attrs: + Feature.warn_deprecated() self.require_features = [] self.features = {} self.dist_files = [] @@ -745,7 +749,13 @@ for module in distutils.dist, distutils.core, distutils.cmd: class Feature: - """A subset of the distribution that can be excluded if unneeded/wanted + """ + **deprecated** -- The `Feature` facility was never completely implemented + or supported, `has reported issues + `_ and will be removed in + a future version. + + A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: @@ -794,9 +804,17 @@ class Feature: Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. """ + + @staticmethod + def warn_deprecated(): + warnings.warn("Features are deprecated and will be removed in " + "a future version. See http://bitbucket.org/pypa/setuptools/65.", + DeprecationWarning) + def __init__(self, description, standard=False, available=True, optional=True, require_features=(), remove=(), **extras ): + self.warn_deprecated() self.description = description self.standard = standard -- cgit v1.2.1 From ebff930a7530b053c6d058d6213f2673331b350e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Aug 2013 08:44:47 -0400 Subject: Restored tunnel (proxy) support in SSL connections. Fixes #52. --- CHANGES.txt | 2 ++ setuptools/ssl_support.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 50310ef2..be1061e9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -25,6 +25,8 @@ CHANGES install. The script will still fall back to a simple ``urlopen`` on platforms that do not have these tools. * Issue #65: Deprecated the ``Features`` functionality. +* Issue #52: In ``VerifyingHTTPSConn``, handle a tunnelled (proxied) + connection. ----- 0.9.8 diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py index f8a780a9..90359b2c 100644 --- a/setuptools/ssl_support.py +++ b/setuptools/ssl_support.py @@ -194,6 +194,12 @@ class VerifyingHTTPSConn(HTTPSConnection): sock = create_connection( (self.host, self.port), getattr(self,'source_address',None) ) + + # Handle the socket if a (proxy) tunnel is present + if hasattr(self, '_tunnel') and getattr(self, '_tunnel_host', None): + self.sock = sock + self._tunnel() + self.sock = ssl.wrap_socket( sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=self.ca_bundle ) -- cgit v1.2.1 From e621ce6f3099b83548cede7425a5af25b0f0ec8c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Aug 2013 08:54:56 -0400 Subject: Fix TypeError when no attrs were passed --- setuptools/dist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index e9d0b5a2..9dbf04ba 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -254,7 +254,8 @@ class Distribution(_Distribution): have_package_data = hasattr(self, "package_data") if not have_package_data: self.package_data = {} - if 'features' in attrs or 'require_features' in attrs: + _attrs_dict = attrs or {} + if 'features' in _attrs_dict or 'require_features' in _attrs_dict: Feature.warn_deprecated() self.require_features = [] self.features = {} -- cgit v1.2.1 From f9a347b122e96104599befa5c7d73ca1d74f4cd5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Aug 2013 08:57:35 -0400 Subject: Added tag 1.0b2 for changeset aba16323ec93 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index b91a42d7..27fca8d4 100644 --- a/.hgtags +++ b/.hgtags @@ -90,3 +90,4 @@ acc6c5d61d0f82040c237ac7ea010c0fc9e67d66 0.9.6 19965a03c1d5231c894e0fabfaf45af1fd99f484 0.9.7 e0a6e225ad6b28471cd42cfede6e8a334bb548fb 0.9.8 7b91ff93a30ef78634b7bb34f4a6229a5de281ee 1.0b1 +aba16323ec9382da7bc77c633990ccb3bd58d050 1.0b2 -- cgit v1.2.1 From a64f2c39bc2e5d3382f2573a570a161a41499fa7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 11 Aug 2013 09:18:52 -0400 Subject: Allow the test to fail on its own merits rather than failing with a not-so-useful message; removed Python 2.3 support. --- tests/manual_test.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/tests/manual_test.py b/tests/manual_test.py index 3eab99e1..e6489b1c 100644 --- a/tests/manual_test.py +++ b/tests/manual_test.py @@ -1,31 +1,16 @@ #!/usr/bin/env python -import sys - -if sys.version_info[0] >= 3: - raise NotImplementedError('Py3 not supported in this test yet') +import sys import os import shutil import tempfile +import subprocess from distutils.command.install import INSTALL_SCHEMES from string import Template from setuptools.compat import urlopen -try: - import subprocess - def _system_call(*args): - assert subprocess.call(args) == 0 -except ImportError: - # Python 2.3 - def _system_call(*args): - # quoting arguments if windows - if sys.platform == 'win32': - def quote(arg): - if ' ' in arg: - return '"%s"' % arg - return arg - args = [quote(arg) for arg in args] - assert os.system(' '.join(args)) == 0 +def _system_call(*args): + assert subprocess.call(args) == 0 def tempdir(func): def _tempdir(*args, **kwargs): -- cgit v1.2.1 From 561255d9c8572edf080614ca6d9e2176e903cef5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 18:00:33 -0400 Subject: Reorganize imports --- pkg_resources.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg_resources.py b/pkg_resources.py index 5514a099..0e079242 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -13,7 +13,14 @@ The package resource API is designed to work with normal filesystem packages, method. """ -import sys, os, time, re, imp, types, zipfile, zipimport +import sys +import os +import time +import re +import imp +import types +import zipfile +import zipimport import warnings import stat try: -- cgit v1.2.1 From 578adf060369c2b705559754ac584c48cb61e0d4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 18:00:46 -0400 Subject: Remove unused import --- pkg_resources.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg_resources.py b/pkg_resources.py index 0e079242..c6f57089 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -18,7 +18,6 @@ import os import time import re import imp -import types import zipfile import zipimport import warnings -- cgit v1.2.1 From dc61ad53fcfa41cfc6d980b0114c9ea5d9daf2ec Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 18:11:50 -0400 Subject: Normalize whitespace --- pkg_resources.py | 332 ++++++++----------------------------------------------- 1 file changed, 48 insertions(+), 284 deletions(-) diff --git a/pkg_resources.py b/pkg_resources.py index c6f57089..02976016 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -128,8 +128,6 @@ def _sset_object(key, ob, state): _sget_none = _sset_none = lambda *args: None - - def get_supported_platform(): """Return this platform's maximum compatible version. @@ -143,33 +141,14 @@ def get_supported_platform(): If this condition occurs for any other platform with a version in its platform strings, this function should be extended accordingly. """ - plat = get_build_platform(); m = macosVersionString.match(plat) + plat = get_build_platform() + m = macosVersionString.match(plat) if m is not None and sys.platform == "darwin": try: plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3)) except ValueError: pass # not Mac OS X return plat - - - - - - - - - - - - - - - - - - - - __all__ = [ # Basic resource access and distribution/entry point discovery @@ -212,6 +191,7 @@ __all__ = [ # Deprecated/backward compatibility only 'run_main', 'AvailableDistributions', ] + class ResolutionError(Exception): """Abstract base for dependency resolution errors""" def __repr__(self): @@ -228,7 +208,7 @@ class UnknownExtra(ResolutionError): _provider_factories = {} PY_MAJOR = sys.version[:3] -EGG_DIST = 3 +EGG_DIST = 3 BINARY_DIST = 2 SOURCE_DIST = 1 CHECKOUT_DIST = 0 @@ -305,11 +285,6 @@ darwinVersionString = re.compile(r"darwin-(\d+)\.(\d+)\.(\d+)-(.*)") get_platform = get_build_platform # XXX backward compat - - - - - def compatible_platforms(provided,required): """Can code for the `provided` platform run on the `required` platform? @@ -335,7 +310,7 @@ def compatible_platforms(provided,required): dversion = int(provDarwin.group(1)) macosversion = "%s.%s" % (reqMac.group(1), reqMac.group(2)) if dversion == 7 and macosversion >= "10.3" or \ - dversion == 8 and macosversion >= "10.4": + dversion == 8 and macosversion >= "10.4": #import warnings #warnings.warn("Mac eggs should be rebuilt to " @@ -346,11 +321,9 @@ def compatible_platforms(provided,required): # are they the same major version and machine type? if provMac.group(1) != reqMac.group(1) or \ - provMac.group(3) != reqMac.group(3): + provMac.group(3) != reqMac.group(3): return False - - # is the required OS major update >= the provided one? if int(provMac.group(2)) > int(reqMac.group(2)): return False @@ -416,14 +389,6 @@ class IMetadataProvider: """Execute the named script in the supplied namespace dictionary""" - - - - - - - - class IResourceProvider(IMetadataProvider): """An object that provides access to package resources""" @@ -452,19 +417,6 @@ class IResourceProvider(IMetadataProvider): """List of resource names in the directory (like ``os.listdir()``)""" - - - - - - - - - - - - - class WorkingSet(object): """A collection of active distributions on sys.path (or a similar list)""" @@ -481,7 +433,6 @@ class WorkingSet(object): for entry in entries: self.add_entry(entry) - def add_entry(self, entry): """Add a path item to ``.entries``, finding any distributions on it @@ -497,15 +448,10 @@ class WorkingSet(object): for dist in find_distributions(entry, True): self.add(dist, entry, False) - def __contains__(self,dist): """True if `dist` is the active distribution for its project""" return self.by_key.get(dist.key) == dist - - - - def find(self, req): """Find a distribution matching requirement `req` @@ -545,8 +491,6 @@ class WorkingSet(object): ns['__name__'] = name self.require(requires)[0].run_script(script_name, ns) - - def __iter__(self): """Yield distributions for non-duplicate projects in the working set @@ -639,9 +583,8 @@ class WorkingSet(object): return to_activate # return list of distros to activate - def find_plugins(self, - plugin_env, full_env=None, installer=None, fallback=True - ): + def find_plugins(self, plugin_env, full_env=None, installer=None, + fallback=True): """Find all activatable distributions in `plugin_env` Example usage:: @@ -718,10 +661,6 @@ class WorkingSet(object): return distributions, error_info - - - - def require(self, *requirements): """Ensure that distributions matching `requirements` are activated @@ -799,7 +738,7 @@ class Environment(object): """ return (self.python is None or dist.py_version is None or dist.py_version==self.python) \ - and compatible_platforms(dist.platform,self.platform) + and compatible_platforms(dist.platform,self.platform) def remove(self, dist): """Remove `dist` from the environment""" @@ -845,7 +784,6 @@ class Environment(object): if dist.key in self._cache: _sort_dists(self._cache[dist.key]) - def best_match(self, req, working_set, installer=None): """Find distribution best matching `req` and usable on `working_set` @@ -884,9 +822,6 @@ class Environment(object): for key in self._distmap.keys(): if self[key]: yield key - - - def __iadd__(self, other): """In-place addition of a distribution or environment""" if isinstance(other,Distribution): @@ -926,8 +861,6 @@ class ExtractionError(RuntimeError): """ - - class ResourceManager: """Manage resource extraction and packages""" extraction_path = None @@ -989,27 +922,13 @@ The Python egg cache directory is currently set to: Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory. -""" % (old_exc, cache_path) +""" % (old_exc, cache_path) ) - err.manager = self - err.cache_path = cache_path + err.manager = self + err.cache_path = cache_path err.original_error = old_exc raise err - - - - - - - - - - - - - - def get_cache_path(self, archive_name, names=()): """Return absolute location in cache for `archive_name` and `names` @@ -1059,23 +978,6 @@ variable to point to an accessible directory. "PYTHON_EGG_CACHE environment variable)." % path) warnings.warn(msg, UserWarning) - - - - - - - - - - - - - - - - - def postprocess(self, tempname, filename): """Perform any platform-specific postprocessing of `tempname` @@ -1096,27 +998,6 @@ variable to point to an accessible directory. mode = ((os.stat(tempname).st_mode) | 0x16D) & 0xFFF # 0555, 07777 os.chmod(tempname, mode) - - - - - - - - - - - - - - - - - - - - - def set_extraction_path(self, path): """Set the base path where resources will be extracted to, if needed. @@ -1156,8 +1037,6 @@ variable to point to an accessible directory. """ # XXX - - def get_default_cache(): """Determine the default cache location @@ -1233,13 +1112,6 @@ def to_filename(name): """ return name.replace('-','_') - - - - - - - _marker_names = { 'os': ['name'], 'sys': ['platform'], 'platform': ['version','machine','python_implementation'], @@ -1311,7 +1183,9 @@ def evaluate_marker(text, extra=None, _ops={}): if not _ops: from token import NAME, STRING - import token, symbol, operator + import token + import symbol + import operator def and_test(nodelist): # MUST NOT short-circuit evaluation, or invalid syntax can be skipped! @@ -1377,7 +1251,7 @@ def evaluate_marker(text, extra=None, _ops={}): if kind==STRING: s = nodelist[1] if s[:1] not in "'\"" or s.startswith('"""') or s.startswith("'''") \ - or '\\' in s: + or '\\' in s: raise SyntaxError( "Only plain strings allowed in environment markers") return s[1:-1] @@ -1456,7 +1330,6 @@ class NullProvider: def metadata_isdir(self,name): return self.egg_info and self._isdir(self._fn(self.egg_info,name)) - def resource_listdir(self,resource_name): return self._listdir(self._fn(self.module_path,resource_name)) @@ -1534,11 +1407,6 @@ class EggProvider(NullProvider): old = path path, base = os.path.split(path) - - - - - class DefaultProvider(EggProvider): """Provides access to package resources in the filesystem""" @@ -1571,9 +1439,9 @@ class EmptyProvider(NullProvider): """Provider that returns nothing for all requests""" _isdir = _has = lambda self,path: False - _get = lambda self,path: '' - _listdir = lambda self,path: [] - module_path = None + _get = lambda self,path: '' + _listdir = lambda self,path: [] + module_path = None def __init__(self): pass @@ -1774,28 +1642,6 @@ class ZipProvider(EggProvider): register_loader_type(zipimport.zipimporter, ZipProvider) - - - - - - - - - - - - - - - - - - - - - - class FileMetadata(EmptyProvider): """Metadata handler for standalone PKG-INFO files @@ -1826,20 +1672,6 @@ class FileMetadata(EmptyProvider): return yield_lines(self.get_metadata(name)) - - - - - - - - - - - - - - class PathMetadata(DefaultProvider): """Metadata provider for egg directories @@ -1920,8 +1752,6 @@ class ImpLoader: return mod - - def get_importer(path_item): """Retrieve a PEP 302 "importer" for the given path item @@ -1959,10 +1789,6 @@ else: del ImpLoader, ImpImporter - - - - _declare_state('dict', _distribution_finders = {}) def register_finder(importer_type, distribution_finder): @@ -2186,12 +2012,12 @@ def yield_lines(strs): LINE_END = re.compile(r"\s*(#.*)?$").match # whitespace and comment CONTINUE = re.compile(r"\s*\\\s*(#.*)?$").match # line continuation -DISTRO = re.compile(r"\s*((\w|[-.])+)").match # Distribution or extra -VERSION = re.compile(r"\s*(<=?|>=?|==|!=)\s*((\w|[-.])+)").match # ver. info -COMMA = re.compile(r"\s*,").match # comma between items +DISTRO = re.compile(r"\s*((\w|[-.])+)").match # Distribution or extra +VERSION = re.compile(r"\s*(<=?|>=?|==|!=)\s*((\w|[-.])+)").match # ver. info +COMMA = re.compile(r"\s*,").match # comma between items OBRACKET = re.compile(r"\s*\[").match CBRACKET = re.compile(r"\s*\]").match -MODULE = re.compile(r"\w+(\.\w+)*$").match +MODULE = re.compile(r"\w+(\.\w+)*$").match EGG_NAME = re.compile( r"(?P[^-]+)" r"( -(?P[^-]+) (-py(?P[^-]+) (-(?P.+))? )? )?", @@ -2293,8 +2119,6 @@ class EntryPoint(object): list(map(working_set.add, working_set.resolve(self.dist.requires(self.extras),env,installer))) - - #@classmethod def parse(cls, src, dist=None): """Parse a single entry point from string `src` @@ -2329,13 +2153,6 @@ class EntryPoint(object): parse = classmethod(parse) - - - - - - - #@classmethod def parse_group(cls, group, lines, dist=None): """Parse an entry point group""" @@ -2386,10 +2203,9 @@ class Distribution(object): """Wrap an actual or potential sys.path entry w/metadata""" PKG_INFO = 'PKG-INFO' - def __init__(self, - location=None, metadata=None, project_name=None, version=None, - py_version=PY_MAJOR, platform=None, precedence = EGG_DIST - ): + def __init__(self, location=None, metadata=None, project_name=None, + version=None, py_version=PY_MAJOR, platform=None, + precedence=EGG_DIST): self.project_name = safe_name(project_name or 'Unknown') if version is not None: self._version = safe_version(version) @@ -2417,7 +2233,6 @@ class Distribution(object): ) from_location = classmethod(from_location) - hashcmp = property( lambda self: ( getattr(self,'parsed_version',()), @@ -2483,9 +2298,6 @@ class Distribution(object): ) version = property(version) - - - #@property def _dep_map(self): try: @@ -2525,8 +2337,6 @@ class Distribution(object): for line in self.get_metadata_lines(name): yield line - - def activate(self,path=None): """Ensure distribution is importable on `path` (default=sys.path)""" if path is None: path = sys.path @@ -2535,7 +2345,6 @@ class Distribution(object): fixup_namespace_packages(self.location) list(map(declare_namespace, self._get_metadata('namespace_packages.txt'))) - def egg_name(self): """Return what this distribution's standard .egg filename should be""" filename = "%s-%s-py%s" % ( @@ -2565,9 +2374,6 @@ class Distribution(object): raise AttributeError(attr) return getattr(self._provider, attr) - - - #@classmethod def from_filename(cls,filename,metadata=None, **kw): return cls.from_location( @@ -2603,12 +2409,6 @@ class Distribution(object): """Return the EntryPoint object for `group`+`name`, or ``None``""" return self.get_entry_map(group).get(name) - - - - - - def insert_on(self, path, loc = None): """Insert self.location in path before its nearest parent directory""" @@ -2649,7 +2449,6 @@ class Distribution(object): return - def check_version_conflict(self): if self.key=='setuptools': return # ignore the inevitable setuptools self-conflicts :( @@ -2658,8 +2457,7 @@ class Distribution(object): loc = normalize_path(self.location) for modname in self._get_metadata('top_level.txt'): if (modname not in sys.modules or modname in nsp - or modname in _namespace_packages - ): + or modname in _namespace_packages): continue if modname in ('pkg_resources', 'setuptools', 'site'): continue @@ -2690,9 +2488,6 @@ class Distribution(object): kw.setdefault('metadata', self._provider) return self.__class__(**kw) - - - #@property def extras(self): return [dep for dep in self._dep_map if dep] @@ -2762,9 +2557,11 @@ class DistInfoDistribution(Distribution): return dm -_distributionImpl = {'.egg': Distribution, - '.egg-info': Distribution, - '.dist-info': DistInfoDistribution } +_distributionImpl = { + '.egg': Distribution, + '.egg-info': Distribution, + '.dist-info': DistInfoDistribution, + } def issue_warning(*args,**kw): @@ -2781,27 +2578,6 @@ def issue_warning(*args,**kw): warn(stacklevel = level+1, *args, **kw) - - - - - - - - - - - - - - - - - - - - - def parse_requirements(strs): """Yield ``Requirement`` objects for each specification in `strs` @@ -2818,7 +2594,8 @@ def parse_requirements(strs): while not TERMINATOR(line,p): if CONTINUE(line,p): try: - line = next(lines); p = 0 + line = next(lines) + p = 0 except StopIteration: raise ValueError( "\\ must not appear on the last nonblank line" @@ -2869,21 +2646,6 @@ def _sort_dists(dists): dists[::-1] = [d for hc,d in tmp] - - - - - - - - - - - - - - - class Requirement: def __init__(self, project_name, specs, extras): """DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!""" @@ -2918,14 +2680,16 @@ class Requirement: compare = lambda a, b: (a > b) - (a < b) # -1, 0, 1 for parsed,trans,op,ver in self.index: action = trans[compare(item,parsed)] # Indexing: 0, 1, -1 - if action=='F': return False - elif action=='T': return True - elif action=='+': last = True + if action=='F': + return False + elif action=='T': + return True + elif action=='+': + last = True elif action=='-' or last is None: last = False if last is None: last = True # no rules encountered return last - def __hash__(self): return self.__hash @@ -2944,12 +2708,12 @@ class Requirement: state_machine = { # =>< - '<' : '--T', - '<=': 'T-T', - '>' : 'F+F', - '>=': 'T+F', - '==': 'T..', - '!=': 'F++', + '<': '--T', + '<=': 'T-T', + '>': 'F+F', + '>=': 'T+F', + '==': 'T..', + '!=': 'F++', } @@ -3047,5 +2811,5 @@ run_main = run_script # backward compatibility # all distributions added to the working set in the future (e.g. by # calling ``require()``) will get activated as well. add_activation_listener(lambda dist: dist.activate()) -working_set.entries=[]; list(map(working_set.add_entry,sys.path)) # match order - +working_set.entries=[] +list(map(working_set.add_entry,sys.path)) # match order -- cgit v1.2.1 From e78ad5671effbd18d7e5c2a803c462d54c401b35 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 23:20:09 -0400 Subject: Remove -script scripts also --- setuptools/command/easy_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 6a45e596..6322c9b6 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1845,7 +1845,7 @@ class WindowsScriptWriter(ScriptWriter): def _get_script_args(cls, type_, name, header, script_text): "For Windows, add a .py extension" ext = dict(console='.py', gui='.pyw')[type_] - old = ['.py', '.pyc', '.pyo', '.pyw', '.exe'] + old = ['.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe'] old.remove(ext) header = cls._adjust_header(type_, header) blockers = [name+x for x in old] -- cgit v1.2.1 From 78baec3378b60814b0062d4f89a9fe6bec41885a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 23:34:30 -0400 Subject: Use .pya extension instead of simply .py to avoid creating scripts that are importable as modules. --HG-- extra : histedit_source : ef811b339d08652c845c5556fd7e2d0f38ee12df --- setuptools/command/easy_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 6322c9b6..53f2e7cf 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1844,8 +1844,8 @@ class WindowsScriptWriter(ScriptWriter): @classmethod def _get_script_args(cls, type_, name, header, script_text): "For Windows, add a .py extension" - ext = dict(console='.py', gui='.pyw')[type_] - old = ['.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe'] + ext = dict(console='.pya', gui='.pyw')[type_] + old = ['.pya', '.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe'] old.remove(ext) header = cls._adjust_header(type_, header) blockers = [name+x for x in old] -- cgit v1.2.1 From 372be090c5acab13a5cc88893c50c09a7b7ec56e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Aug 2013 23:48:42 -0400 Subject: Warn when scripts are installed but PATHEXT isn't set --HG-- extra : histedit_source : a1c329f92ee71a707955e352b63987af9de6e120 --- setuptools/command/easy_install.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 53f2e7cf..a0171e3d 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -23,6 +23,7 @@ import stat import random import platform import textwrap +import warnings from glob import glob from distutils import log, dir_util @@ -1845,6 +1846,9 @@ class WindowsScriptWriter(ScriptWriter): def _get_script_args(cls, type_, name, header, script_text): "For Windows, add a .py extension" ext = dict(console='.pya', gui='.pyw')[type_] + if ext not in os.environ['PATHEXT'].lower().split(';'): + warnings.warn("%s not listed in PATHEXT; scripts will not be " + "recognized as executables." % ext, UserWarning) old = ['.pya', '.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe'] old.remove(ext) header = cls._adjust_header(type_, header) -- cgit v1.2.1 From 38c43e388fe9aeff84388ff73447504353adc3f4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 14 Aug 2013 13:30:54 -0400 Subject: Fix template rendering error --- setuptools/command/easy_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index febfdcd1..8b88cd1d 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1260,7 +1260,7 @@ Here are some of your options for correcting the problem: https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.""" - return template % self.install_dir, os.environ.get('PYTHONPATH','') + return template % (self.install_dir, os.environ.get('PYTHONPATH','')) def install_site_py(self): """Make sure there's a site.py in the target dir, if needed""" -- cgit v1.2.1 From 9ccb56080758c5056b5af308af8dec0ac2fe5568 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 14 Aug 2013 13:33:53 -0400 Subject: Added tag 1.0b3 for changeset 8a98492f0d85 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 27fca8d4..35ccbea6 100644 --- a/.hgtags +++ b/.hgtags @@ -91,3 +91,4 @@ acc6c5d61d0f82040c237ac7ea010c0fc9e67d66 0.9.6 e0a6e225ad6b28471cd42cfede6e8a334bb548fb 0.9.8 7b91ff93a30ef78634b7bb34f4a6229a5de281ee 1.0b1 aba16323ec9382da7bc77c633990ccb3bd58d050 1.0b2 +8a98492f0d852402c93ddbbf3f07081909a9105f 1.0b3 -- cgit v1.2.1 From 25f13ea57a53b04866f1c3a0a961c951812bdb43 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Aug 2013 19:58:54 -0400 Subject: Set stacklevel on DeprecationWarning for more relevant locality. --- setuptools/dist.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index 9dbf04ba..5c84b8d4 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -808,9 +808,12 @@ class Feature: @staticmethod def warn_deprecated(): - warnings.warn("Features are deprecated and will be removed in " - "a future version. See http://bitbucket.org/pypa/setuptools/65.", - DeprecationWarning) + warnings.warn( + "Features are deprecated and will be removed in a future " + "version. See http://bitbucket.org/pypa/setuptools/65.", + DeprecationWarning, + stacklevel=3, + ) def __init__(self, description, standard=False, available=True, optional=True, require_features=(), remove=(), **extras -- cgit v1.2.1 From bb513b623c58b69cc7cf846c99c9e10762fa76c3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 10:24:43 -0400 Subject: Updated changelog to highlight backward-incompatible changes --- CHANGES.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index be1061e9..16160f7a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,13 +13,6 @@ CHANGES the ``SETUPTOOLS_USE_PYLAUNCHER`` environment variable is set (to anything). In the future, this behavior may become default, but only after it has matured and seen substantial adoption. -* Issue #50: Normalized API of environment marker support. Specifically, - removed line number and filename from SyntaxErrors when returned from - `pkg_resources.invalid_marker`. Any clients depending on the specific - string representation of exceptions returned by that function may need to - be updated to account for this change. -* Issue #50: SyntaxErrors generated by `pkg_resources.invalid_marker` are - normalized for cross-implementation consistency. * Issue #63: Bootstrap script (ez_setup.py) now prefers Powershell, curl, or wget for retrieving the Setuptools tarball for improved security of the install. The script will still fall back to a simple ``urlopen`` on @@ -28,6 +21,16 @@ CHANGES * Issue #52: In ``VerifyingHTTPSConn``, handle a tunnelled (proxied) connection. +Backward-incompatible changes: + +* Issue #50: Normalized API of environment marker support. Specifically, + removed line number and filename from SyntaxErrors when returned from + `pkg_resources.invalid_marker`. Any clients depending on the specific + string representation of exceptions returned by that function may need to + be updated to account for this change. +* Issue #50: SyntaxErrors generated by `pkg_resources.invalid_marker` are + normalized for cross-implementation consistency. + ----- 0.9.8 ----- -- cgit v1.2.1 From 3eb3c69afbe1d2ebbc98943a896ccbfc913113c1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 10:28:20 -0400 Subject: Updated changelog once more to provide a re-assuring narrative about the backward-incompatible changes. --- CHANGES.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 16160f7a..db9c637c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -21,7 +21,11 @@ CHANGES * Issue #52: In ``VerifyingHTTPSConn``, handle a tunnelled (proxied) connection. -Backward-incompatible changes: +Backward-Incompatible Changes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This release includes a couple of backward-incompatible changes, but most if +not all users will find 1.0 a drop-in replacement for 0.9. * Issue #50: Normalized API of environment marker support. Specifically, removed line number and filename from SyntaxErrors when returned from -- cgit v1.2.1 From 2473aa6da27cb95c1582aee1bb188f76e0deb258 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 10:44:18 -0400 Subject: Changed the launcher relevant environment variable to SETUPTOOLS_LAUNCHER and it now accepts different strings 'natural' and 'executable', instead of only reflecting a boolean value. --- CHANGES.txt | 6 ++++-- docs/easy_install.txt | 8 +++++--- setuptools/command/easy_install.py | 16 ++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index db9c637c..b2e26770 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,9 +10,11 @@ CHANGES `_ (included with Python 3.3) to launch console and GUI scripts and not install its own launcher executables. This experimental functionality is currently only enabled if - the ``SETUPTOOLS_USE_PYLAUNCHER`` environment variable is set (to anything). + the ``SETUPTOOLS_LAUNCHER`` environment variable is set to "natural". In the future, this behavior may become default, but only after it has - matured and seen substantial adoption. + matured and seen substantial adoption. The ``SETUPTOOLS_LAUNCHER`` also + accepts "executable" to force the default behavior of creating launcher + executables. * Issue #63: Bootstrap script (ez_setup.py) now prefers Powershell, curl, or wget for retrieving the Setuptools tarball for improved security of the install. The script will still fall back to a simple ``urlopen`` on diff --git a/docs/easy_install.txt b/docs/easy_install.txt index 03f816de..744b4967 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -98,12 +98,14 @@ can pass command line options (such as ``--script-dir``) to Setuptools also supports deferring to an external launcher such as `pylauncher `_ for launching scripts. Enable this experimental functionality by setting the -``SETUPTOOLS_USE_PYLAUNCHER`` environment variable. Setuptools will then not +``SETUPTOOLS_LAUNCHER`` environment variable to "natural". Setuptools will +then not install its own launcher executable, but will install scripts as simple -scripts with a .py (or .pyw) extension appended. If these extensions are +scripts with a .pya (or .pyw) extension appended. If these extensions are associated with the pylauncher and listed in the PATHEXT environment variable, these scripts can then be invoked simply and directly just like any other -executable. +executable. This behavior may become default in a future version. To force +the use of executable launchers, set ``SETUPTOOLS_LAUNCHER`` to "executable". Downloading and Installing a Package diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index cf4402a5..19d6e494 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1834,13 +1834,13 @@ class WindowsScriptWriter(ScriptWriter): """ Get a script writer suitable for Windows """ - # for compatibility, return the writer that creates exe launchers - # unless the SETUPTOOLS_USE_PYLAUNCHER is set, indicating - # future behavior. - use_legacy = 'SETUPTOOLS_USE_PYLAUNCHER' not in os.environ - if use_legacy: - return WindowsLauncherScriptWriter - return cls + writer_lookup = dict( + executable=WindowsExecutableLauncherWriter, + natural=cls, + ) + # for compatibility, use the executable launcher by default + launcher = os.environ.get('SETUPTOOLS_LAUNCHER', 'executable') + return writer_lookup[launcher] @classmethod def _get_script_args(cls, type_, name, header, script_text): @@ -1874,7 +1874,7 @@ class WindowsScriptWriter(ScriptWriter): return new_header -class WindowsLauncherScriptWriter(WindowsScriptWriter): +class WindowsExecutableLauncherWriter(WindowsScriptWriter): @classmethod def _get_script_args(cls, type_, name, header, script_text): """ -- cgit v1.2.1 From dcbb8ac6ad28f5cdc924ddf7482fa9b856b49681 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 12:13:20 -0400 Subject: Reorganized the documentation to cover the different launcher techniques. --- docs/easy_install.txt | 92 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/docs/easy_install.txt b/docs/easy_install.txt index 744b4967..cb05aacc 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -76,36 +76,10 @@ section on `Custom Installation Locations`_ for more details. Windows Notes ~~~~~~~~~~~~~ -On Windows, an ``easy_install.exe`` launcher will also be installed, so that -you can just type ``easy_install`` as long as it's on your ``PATH``. If typing -``easy_install`` at the command prompt doesn't work, check to make sure your -``PATH`` includes the appropriate ``C:\\Python2X\\Scripts`` directory. On -most current versions of Windows, you can change the ``PATH`` by right-clicking -"My Computer", choosing "Properties" and selecting the "Advanced" tab, then -clicking the "Environment Variables" button. ``PATH`` will be in the "System -Variables" section, and you will need to exit and restart your command shell -(command.com, cmd.exe, bash, or other) for the change to take effect. Be sure -to add a ``;`` after the last item on ``PATH`` before adding the scripts -directory to it. - -Note that instead of changing your ``PATH`` to include the Python scripts -directory, you can also retarget the installation location for scripts so they -go on a directory that's already on the ``PATH``. For more information see the -sections below on `Command-Line Options`_ and `Configuration Files`_. You -can pass command line options (such as ``--script-dir``) to -``ez_setup.py`` to control where ``easy_install.exe`` will be installed. - -Setuptools also supports deferring to an external launcher such as -`pylauncher `_ for launching scripts. -Enable this experimental functionality by setting the -``SETUPTOOLS_LAUNCHER`` environment variable to "natural". Setuptools will -then not -install its own launcher executable, but will install scripts as simple -scripts with a .pya (or .pyw) extension appended. If these extensions are -associated with the pylauncher and listed in the PATHEXT environment variable, -these scripts can then be invoked simply and directly just like any other -executable. This behavior may become default in a future version. To force -the use of executable launchers, set ``SETUPTOOLS_LAUNCHER`` to "executable". +Installing setuptools will provide an ``easy_install`` command according to +the techniques described in `Executables and Launchers`_. If the +``easy_install`` command is not available after installation, that section +provides details on how to configure Windows to make the commands available. Downloading and Installing a Package @@ -315,6 +289,64 @@ installations, so that Python won't lock us out of using anything but the most recently-installed version of the package.) +Executables and Launchers +------------------------- + +On Unix systems, scripts are installed with as natural files with a "#!" +header and no extension and they launch under the Python version indicated in +the header. + +On Windows, there is no mechanism to "execute" files without extensions, so +EasyInstall provides two techniques to mirror the Unix behavior. The behavior +is indicated by the SETUPTOOLS_LAUNCHER environment variable, which may be +"executable" (default) or "natural". + +Regardless of the technique used, the script(s) will be installed to a Scripts +directory (by default in the Python installation directory). It is recommended +for EasyInstall that you ensure this directory is in the PATH environment +variable. The easiest way to ensure the Scripts directory is in the PATH is +to run ``Tools\Scripts\win_add2path.py`` from the Python directory (requires +Python 2.6 or later). + +Note that instead of changing your ``PATH`` to include the Python scripts +directory, you can also retarget the installation location for scripts so they +go on a directory that's already on the ``PATH``. For more information see +`Command-Line Options`_ and `Configuration Files`_. During installation, +pass command line options (such as ``--script-dir``) to +``ez_setup.py`` to control where ``easy_install.exe`` will be installed. + + +Windows Executable Launcher +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If the "executable" launcher is used, EasyInstall will create a '.exe' +launcher of the same name beside each installed script (including +``easy_install`` itself). These small .exe files launch the script of the +same name using the Python version indicated in the '#!' header. + +This behavior is currently default. To force +the use of executable launchers, set ``SETUPTOOLS_LAUNCHER`` to "executable". + +Natural Script Launcher +~~~~~~~~~~~~~~~~~~~~~~~ + +EasyInstall also supports deferring to an external launcher such as +`pylauncher `_ for launching scripts. +Enable this experimental functionality by setting the +``SETUPTOOLS_LAUNCHER`` environment variable to "natural". EasyInstall will +then install scripts as simple +scripts with a .pya (or .pyw) extension appended. If these extensions are +associated with the pylauncher and listed in the PATHEXT environment variable, +these scripts can then be invoked simply and directly just like any other +executable. This behavior may become default in a future version. + +EasyInstall uses the .pya extension instead of simply +the typical '.py' extension. This distinct extension is necessary to prevent +Python +from treating the scripts as importable modules (where name conflicts exist). +Current releases of pylauncher do not yet associate with .pya files by +default, but future versions should do so. + Tips & Techniques ----------------- -- cgit v1.2.1 From d1d7dc6411b95ca5908c9628b4d74079b774f458 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 14:22:10 -0400 Subject: Updated docs in Multiple Python Versions to reference supported Python versions. --- docs/easy_install.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/easy_install.txt b/docs/easy_install.txt index cb05aacc..26001c75 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -351,20 +351,18 @@ default, but future versions should do so. Tips & Techniques ----------------- - Multiple Python Versions ~~~~~~~~~~~~~~~~~~~~~~~~ -As of version 0.6a11, EasyInstall installs itself under two names: +EasyInstall installs itself under two names: ``easy_install`` and ``easy_install-N.N``, where ``N.N`` is the Python version -used to install it. Thus, if you install EasyInstall for both Python 2.3 and -2.4, you can use the ``easy_install-2.3`` or ``easy_install-2.4`` scripts to -install packages for Python 2.3 or 2.4, respectively. - -Also, if you're working with Python version 2.4 or higher, you can run Python -with ``-m easy_install`` to run that particular Python version's -``easy_install`` command. +used to install it. Thus, if you install EasyInstall for both Python 3.2 and +2.7, you can use the ``easy_install-3.2`` or ``easy_install-2.7`` scripts to +install packages for the respective Python version. +Setuptools also supplies easy_install as a runnable module which may be +invoked using ``python -m easy_install`` for any Python with Setuptools +installed. Restricting Downloads with ``--allow-hosts`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.1 From e282a1f42c47484c4fa52b8321c4ee367a150f2d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 14:45:02 -0400 Subject: Removed the --delete-conflicting and --ignore-conflicts-at-my-risk options, which have long been deprecated and indicated that they're not used. --- CHANGES.txt | 2 ++ docs/easy_install.txt | 29 +++---------------------- setuptools/command/easy_install.py | 44 ++++---------------------------------- 3 files changed, 9 insertions(+), 66 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b2e26770..a075c3c8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -36,6 +36,8 @@ not all users will find 1.0 a drop-in replacement for 0.9. be updated to account for this change. * Issue #50: SyntaxErrors generated by `pkg_resources.invalid_marker` are normalized for cross-implementation consistency. +* Removed ``--ignore-conflicts-at-my-risk`` and ``--delete-conflicting`` + options to easy_install. These options have been deprecated since 0.6a11. ----- 0.9.8 diff --git a/docs/easy_install.txt b/docs/easy_install.txt index 26001c75..42a5323d 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -572,14 +572,12 @@ install``, becuase the ``distutils`` just install new packages on top of old ones, possibly combining two unrelated packages or leaving behind modules that have been deleted in the newer version of the package.) -By default, EasyInstall will stop the installation if it detects a conflict +EasyInstall will stop the installation if it detects a conflict between an existing, "unmanaged" package, and a module or package in any of the distributions you're installing. It will display a list of all of the existing files and directories that would need to be deleted for the new -package to be able to function correctly. You can then either delete these -conflicting files and directories yourself and re-run EasyInstall, or you can -just use the ``--delete-conflicting`` or ``--ignore-conflicts-at-my-risk`` -options, as described under `Command-Line Options`_, below. +package to be able to function correctly. To proceed, you must manually +delete these conflicting files and directories and re-run EasyInstall. Of course, once you've replaced all of your existing "unmanaged" packages with versions managed by EasyInstall, you won't have any more conflicts to worry @@ -823,27 +821,6 @@ Command-Line Options Added in Distribute 0.6.11 and Setuptools 0.7. -``--delete-conflicting, -D`` (Removed in 0.6a11) - (As of 0.6a11, this option is no longer necessary; please do not use it!) - - If you are replacing a package that was previously installed *without* - using EasyInstall, the old version may end up on ``sys.path`` before the - version being installed with EasyInstall. EasyInstall will normally abort - the installation of a package if it detects such a conflict, and ask you to - manually remove the conflicting files or directories. If you specify this - option, however, EasyInstall will attempt to delete the files or - directories itself, and then proceed with the installation. - -``--ignore-conflicts-at-my-risk`` (Removed in 0.6a11) - (As of 0.6a11, this option is no longer necessary; please do not use it!) - - Ignore conflicting packages and proceed with installation anyway, even - though it means the package probably won't work properly. If the - conflicting package is in a directory you can't write to, this may be your - only option, but you will need to take more invasive measures to get the - installed package to work, like manually adding it to ``PYTHONPATH`` or to - ``sys.path`` at runtime. - ``--index-url=URL, -i URL`` (New in 0.4a1; default changed in 0.6c7) Specifies the base URL of the Python Package Index. The default is https://pypi.python.org/simple if not specified. When a package is requested diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 19d6e494..66dc798b 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -125,9 +125,6 @@ class easy_install(Command): ("always-copy", "a", "Copy all needed packages to install dir"), ("index-url=", "i", "base URL of Python Package Index"), ("find-links=", "f", "additional URL(s) to search for packages"), - ("delete-conflicting", "D", "no longer needed; don't use this"), - ("ignore-conflicts-at-my-risk", None, - "no longer needed; don't use this"), ("build-directory=", "b", "download/extract/build in DIR; keep the results"), ('optimize=', 'O', @@ -148,7 +145,7 @@ class easy_install(Command): ] boolean_options = [ 'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy', - 'delete-conflicting', 'ignore-conflicts-at-my-risk', 'editable', + 'editable', 'no-deps', 'local-snapshots-ok', 'version' ] @@ -197,8 +194,6 @@ class easy_install(Command): # Options not specifiable via command line self.package_index = None self.pth_file = self.always_copy_from = None - self.delete_conflicting = None - self.ignore_conflicts_at_my_risk = None self.site_dirs = None self.installed_projects = {} self.sitepy_installed = False @@ -342,11 +337,6 @@ class easy_install(Command): except ValueError: raise DistutilsOptionError("--optimize must be 0, 1, or 2") - if self.delete_conflicting and self.ignore_conflicts_at_my_risk: - raise DistutilsOptionError( - "Can't use both --delete-conflicting and " - "--ignore-conflicts-at-my-risk at the same time" - ) if self.editable and not self.build_directory: raise DistutilsArgError( "Must specify a build directory (-b) when using --editable" @@ -411,12 +401,7 @@ class easy_install(Command): return os.path.join(self.install_dir, "test-easy-install-%s" % pid) def warn_deprecated_options(self): - if self.delete_conflicting or self.ignore_conflicts_at_my_risk: - log.warn( - "Note: The -D, --delete-conflicting and" - " --ignore-conflicts-at-my-risk no longer have any purpose" - " and should not be used." - ) + pass def check_site_dir(self): """Verify that self.install_dir is .pth-capable dir, if needed""" @@ -1005,10 +990,6 @@ Please make the appropriate changes for your system and try again. return dist def found_conflicts(self, dist, blockers): - if self.delete_conflicting: - log.warn("Attempting to delete conflicting packages:") - return self.delete_blockers(blockers) - msg = """\ ------------------------------------------------------------------------- CONFLICT WARNING: @@ -1021,29 +1002,12 @@ installing: %s +------------------------------------------------------------------------- """ % '\n '.join(blockers) - if self.ignore_conflicts_at_my_risk: - msg += """\ -(Note: you can run EasyInstall on '%s' with the ---delete-conflicting option to attempt deletion of the above files -and/or directories.) -""" % dist.project_name - else: - msg += """\ -Note: you can attempt this installation again with EasyInstall, and use -either the --delete-conflicting (-D) option or the ---ignore-conflicts-at-my-risk option, to either delete the above files -and directories, or to ignore the conflicts, respectively. Note that if -you ignore the conflicts, the installed package(s) may not work. -""" - msg += """\ -------------------------------------------------------------------------- -""" sys.stderr.write(msg) sys.stderr.flush() - if not self.ignore_conflicts_at_my_risk: - raise DistutilsError("Installation aborted due to conflicts") + raise DistutilsError("Installation aborted due to conflicts") def installation_report(self, req, dist, what="Installed"): """Helpful installation message for display to package users""" -- cgit v1.2.1 From 6af26d45169f1632beb50f3071155c0bfd0d5b38 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 15:28:07 -0400 Subject: Added tag 1.0 for changeset c385fdf1f976 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 35ccbea6..96735c09 100644 --- a/.hgtags +++ b/.hgtags @@ -92,3 +92,4 @@ e0a6e225ad6b28471cd42cfede6e8a334bb548fb 0.9.8 7b91ff93a30ef78634b7bb34f4a6229a5de281ee 1.0b1 aba16323ec9382da7bc77c633990ccb3bd58d050 1.0b2 8a98492f0d852402c93ddbbf3f07081909a9105f 1.0b3 +c385fdf1f976fb1d2a6accc9292d8eca419180fa 1.0 -- cgit v1.2.1 From 16e24b7f483babb855aaeb62f72d63b7315fe33d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 15:28:27 -0400 Subject: Bumped to 1.1 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 124 +++++++++++++++++------------------ setuptools.egg-info/requires.txt | 8 +-- setuptools/version.py | 2 +- 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 00cf47aa..3d835d3a 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.0" +DEFAULT_VERSION = "1.1" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index ba887a08..df9b9c2d 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[setuptools.file_finders] -svn_cvs = setuptools.command.sdist:_default_revctrl - -[egg_info.writers] -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -top_level.txt = setuptools.command.egg_info:write_toplevel_names -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -eager_resources.txt = setuptools.command.egg_info:overwrite_arg -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -requires.txt = setuptools.command.egg_info:write_requirements -PKG-INFO = setuptools.command.egg_info:write_pkg_info -entry_points.txt = setuptools.command.egg_info:write_entries - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main - -[distutils.setup_keywords] -dependency_links = setuptools.dist:assert_string_list -packages = setuptools.dist:check_packages -exclude_package_data = setuptools.dist:check_package_data -use_2to3_exclude_fixers = setuptools.dist:assert_string_list -package_data = setuptools.dist:check_package_data -use_2to3 = setuptools.dist:assert_bool -tests_require = setuptools.dist:check_requirements -entry_points = setuptools.dist:check_entry_points -extras_require = setuptools.dist:check_extras -include_package_data = setuptools.dist:assert_bool -eager_resources = setuptools.dist:assert_string_list -zip_safe = setuptools.dist:assert_bool -install_requires = setuptools.dist:check_requirements -use_2to3_fixers = setuptools.dist:assert_string_list -test_suite = setuptools.dist:check_test_suite -test_loader = setuptools.dist:check_importable -namespace_packages = setuptools.dist:check_nsp -convert_2to3_doctests = setuptools.dist:assert_string_list - -[distutils.commands] -bdist_egg = setuptools.command.bdist_egg:bdist_egg -egg_info = setuptools.command.egg_info:egg_info -alias = setuptools.command.alias:alias -sdist = setuptools.command.sdist:sdist -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -test = setuptools.command.test:test -easy_install = setuptools.command.easy_install:easy_install -register = setuptools.command.register:register -setopt = setuptools.command.setopt:setopt -install = setuptools.command.install:install -install_scripts = setuptools.command.install_scripts:install_scripts -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -build_ext = setuptools.command.build_ext:build_ext -rotate = setuptools.command.rotate:rotate -develop = setuptools.command.develop:develop -install_lib = setuptools.command.install_lib:install_lib -upload_docs = setuptools.command.upload_docs:upload_docs -install_egg_info = setuptools.command.install_egg_info:install_egg_info -build_py = setuptools.command.build_py:build_py -saveopts = setuptools.command.saveopts:saveopts - +[distutils.commands] +install_scripts = setuptools.command.install_scripts:install_scripts +install = setuptools.command.install:install +setopt = setuptools.command.setopt:setopt +register = setuptools.command.register:register +easy_install = setuptools.command.easy_install:easy_install +test = setuptools.command.test:test +sdist = setuptools.command.sdist:sdist +alias = setuptools.command.alias:alias +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +egg_info = setuptools.command.egg_info:egg_info +bdist_egg = setuptools.command.bdist_egg:bdist_egg +build_py = setuptools.command.build_py:build_py +upload_docs = setuptools.command.upload_docs:upload_docs +install_lib = setuptools.command.install_lib:install_lib +develop = setuptools.command.develop:develop +rotate = setuptools.command.rotate:rotate +build_ext = setuptools.command.build_ext:build_ext +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +saveopts = setuptools.command.saveopts:saveopts +install_egg_info = setuptools.command.install_egg_info:install_egg_info + +[distutils.setup_keywords] +tests_require = setuptools.dist:check_requirements +install_requires = setuptools.dist:check_requirements +package_data = setuptools.dist:check_package_data +use_2to3_exclude_fixers = setuptools.dist:assert_string_list +exclude_package_data = setuptools.dist:check_package_data +dependency_links = setuptools.dist:assert_string_list +convert_2to3_doctests = setuptools.dist:assert_string_list +use_2to3_fixers = setuptools.dist:assert_string_list +test_loader = setuptools.dist:check_importable +use_2to3 = setuptools.dist:assert_bool +test_suite = setuptools.dist:check_test_suite +namespace_packages = setuptools.dist:check_nsp +zip_safe = setuptools.dist:assert_bool +packages = setuptools.dist:check_packages +eager_resources = setuptools.dist:assert_string_list +include_package_data = setuptools.dist:assert_bool +extras_require = setuptools.dist:check_extras +entry_points = setuptools.dist:check_entry_points + +[console_scripts] +easy_install-3.3 = setuptools.command.easy_install:main +easy_install = setuptools.command.easy_install:main + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + +[egg_info.writers] +entry_points.txt = setuptools.command.egg_info:write_entries +PKG-INFO = setuptools.command.egg_info:write_pkg_info +requires.txt = setuptools.command.egg_info:write_requirements +namespace_packages.txt = setuptools.command.egg_info:overwrite_arg +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +eager_resources.txt = setuptools.command.egg_info:overwrite_arg +top_level.txt = setuptools.command.egg_info:write_toplevel_names +depends.txt = setuptools.command.egg_info:warn_depends_obsolete + +[setuptools.file_finders] +svn_cvs = setuptools.command.sdist:_default_revctrl + diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 5de4d6e7..c06a8a0b 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,8 +1,5 @@ -[certs] -certifi==0.0.8 - [ssl:sys_platform=='win32'] wincertstore==0.1 @@ -10,4 +7,7 @@ wincertstore==0.1 ctypes==1.0.2 [ssl:python_version in '2.4, 2.5'] -ssl==1.16 \ No newline at end of file +ssl==1.16 + +[certs] +certifi==0.0.8 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index 7e49527e..439eb0cd 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.0' +__version__ = '1.1' -- cgit v1.2.1 From 3ce0aff78df0d02864946a34a622dd08d7a29c5b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 15:44:47 -0400 Subject: Use jaraco.packaging 2.0 to invoke pushing the bookmark as a separate operation from pushing the other changesets. --- release.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/release.py b/release.py index c2b331c7..221d8a67 100644 --- a/release.py +++ b/release.py @@ -9,7 +9,7 @@ import subprocess import pkg_resources -pkg_resources.require('jaraco.packaging>=1.1') +pkg_resources.require('jaraco.packaging>=2.0') def before_upload(): _linkify('CHANGES.txt', 'CHANGES (links).txt') @@ -24,7 +24,15 @@ test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools" os.environ["SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"] = "1" # override the push command to include the bootstrap bookmark. -push_command = ['hg', 'push', '-B', 'bootstrap'] +def after_push(): + """ + Push the bootstrap bookmark + """ + push_command = ['hg', 'push', '-B', 'bootstrap'] + # don't use check_call here because mercurial will return a non-zero + # code even if it succeeds at pushing the bookmark (because there are + # no changesets to be pushed). !dm mercurial + subprocess.call(push_command) link_patterns = [ r"(Issue )?#(?P\d+)", -- cgit v1.2.1 From 271dfce00c557029b348a170c9eab15e9f3a430b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 15:46:35 -0400 Subject: Refactor for clarity --- release.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/release.py b/release.py index 221d8a67..4c9df8cc 100644 --- a/release.py +++ b/release.py @@ -15,6 +15,9 @@ def before_upload(): _linkify('CHANGES.txt', 'CHANGES (links).txt') _add_bootstrap_bookmark() +def after_push(): + _push_bootstrap_bookmark() + files_with_versions = ( 'ez_setup.py', 'setuptools/version.py', ) @@ -23,17 +26,6 @@ test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools" os.environ["SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"] = "1" -# override the push command to include the bootstrap bookmark. -def after_push(): - """ - Push the bootstrap bookmark - """ - push_command = ['hg', 'push', '-B', 'bootstrap'] - # don't use check_call here because mercurial will return a non-zero - # code even if it succeeds at pushing the bookmark (because there are - # no changesets to be pushed). !dm mercurial - subprocess.call(push_command) - link_patterns = [ r"(Issue )?#(?P\d+)", r"Distribute #(?P\d+)", @@ -73,3 +65,13 @@ def replacer(match): def _add_bootstrap_bookmark(): cmd = ['hg', 'bookmark', '-i', 'bootstrap', '-f'] subprocess.Popen(cmd) + +def _push_bootstrap_bookmark(): + """ + Push the bootstrap bookmark + """ + push_command = ['hg', 'push', '-B', 'bootstrap'] + # don't use check_call here because mercurial will return a non-zero + # code even if it succeeds at pushing the bookmark (because there are + # no changesets to be pushed). !dm mercurial + subprocess.call(push_command) -- cgit v1.2.1 From de71398660ecb616b5285334fa7c9fc10610126c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 15:48:00 -0400 Subject: Encapsulate bootstrap bookmark functionality --- release.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/release.py b/release.py index 4c9df8cc..edf6f4be 100644 --- a/release.py +++ b/release.py @@ -13,10 +13,10 @@ pkg_resources.require('jaraco.packaging>=2.0') def before_upload(): _linkify('CHANGES.txt', 'CHANGES (links).txt') - _add_bootstrap_bookmark() + BootstrapBookmark.add() def after_push(): - _push_bootstrap_bookmark() + BootstrapBookmark.push() files_with_versions = ( 'ez_setup.py', 'setuptools/version.py', @@ -61,17 +61,19 @@ def replacer(match): url = issue_urls[key].format(**match_dict) return "`{text} <{url}>`_".format(text=text, url=url) - -def _add_bootstrap_bookmark(): - cmd = ['hg', 'bookmark', '-i', 'bootstrap', '-f'] - subprocess.Popen(cmd) - -def _push_bootstrap_bookmark(): - """ - Push the bootstrap bookmark - """ - push_command = ['hg', 'push', '-B', 'bootstrap'] - # don't use check_call here because mercurial will return a non-zero - # code even if it succeeds at pushing the bookmark (because there are - # no changesets to be pushed). !dm mercurial - subprocess.call(push_command) +class BootstrapBookmark: + @staticmethod + def add(): + cmd = ['hg', 'bookmark', '-i', 'bootstrap', '-f'] + subprocess.Popen(cmd) + + @staticmethod + def push(): + """ + Push the bootstrap bookmark + """ + push_command = ['hg', 'push', '-B', 'bootstrap'] + # don't use check_call here because mercurial will return a non-zero + # code even if it succeeds at pushing the bookmark (because there are + # no changesets to be pushed). !dm mercurial + subprocess.call(push_command) -- cgit v1.2.1 From d3eaf21c8918ce65bde30893b00adf18cf2f3a70 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 15:48:59 -0400 Subject: Extract bookmark name into the class --- release.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/release.py b/release.py index edf6f4be..85d8f86f 100644 --- a/release.py +++ b/release.py @@ -62,17 +62,19 @@ def replacer(match): return "`{text} <{url}>`_".format(text=text, url=url) class BootstrapBookmark: - @staticmethod - def add(): - cmd = ['hg', 'bookmark', '-i', 'bootstrap', '-f'] + name = 'bootstrap' + + @classmethod + def add(cls): + cmd = ['hg', 'bookmark', '-i', cls.name, '-f'] subprocess.Popen(cmd) - @staticmethod - def push(): + @classmethod + def push(cls): """ Push the bootstrap bookmark """ - push_command = ['hg', 'push', '-B', 'bootstrap'] + push_command = ['hg', 'push', '-B', cls.name] # don't use check_call here because mercurial will return a non-zero # code even if it succeeds at pushing the bookmark (because there are # no changesets to be pushed). !dm mercurial -- cgit v1.2.1 From b7bff0cdb501916d9f99edcd5e9d453066f982a5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 16:42:00 -0400 Subject: Remove linked changes file after upload and push --- release.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release.py b/release.py index 85d8f86f..15f71a2d 100644 --- a/release.py +++ b/release.py @@ -11,11 +11,14 @@ import pkg_resources pkg_resources.require('jaraco.packaging>=2.0') + def before_upload(): _linkify('CHANGES.txt', 'CHANGES (links).txt') BootstrapBookmark.add() + def after_push(): + os.remove('CHANGES (links).txt') BootstrapBookmark.push() files_with_versions = ( -- cgit v1.2.1 From cc220f8f36d5b873e377329906dbd1a7d1f99833 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 17 Aug 2013 16:55:20 -0400 Subject: Corrected title formatting and hyperlink to correct Sphinx errors --- CHANGES.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a075c3c8..9f1d15b3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,7 +24,7 @@ CHANGES connection. Backward-Incompatible Changes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +============================= This release includes a couple of backward-incompatible changes, but most if not all users will find 1.0 a drop-in replacement for 0.9. @@ -1162,8 +1162,9 @@ easy_install * ``setuptools`` now finds its commands, ``setup()`` argument validators, and metadata writers using entry points, so that they can be extended by - third-party packages. See `Creating distutils Extensions`_ above for more - details. + third-party packages. See `Creating distutils Extensions + `_ + for more details. * The vestigial ``depends`` command has been removed. It was never finished or documented, and never would have worked without EasyInstall - which it -- cgit v1.2.1 From a72b003bd4caedb79e8e1d2c168fd8b5f111b5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20N=C3=A9ri?= Date: Sun, 18 Aug 2013 21:03:04 +0200 Subject: Fix spelling --- docs/using.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/using.txt b/docs/using.txt index 6f93c386..e44847d6 100644 --- a/docs/using.txt +++ b/docs/using.txt @@ -4,7 +4,7 @@ Using Setuptools in your project To use Setuptools in your project, the recommended way is to ship `ez_setup.py` alongside your `setup.py` script and call -it at the very begining of `setup.py` like this:: +it at the very beginning of `setup.py` like this:: from ez_setup import use_setuptools use_setuptools() -- cgit v1.2.1 From c8d8126ffba6a9201b293fab0c8b0fc6346c129b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 19 Aug 2013 09:59:04 -0400 Subject: Powershell isn't installed by default on Windows Server 2008. Also it's possible that Powershell is present on older systems. Now use direct detection of a Powershell executable to determine viability of that technique for a downloader. Fixes #67. --- ez_setup.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 00cf47aa..837ef3f3 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -164,9 +164,20 @@ def download_file_powershell(url, target): ] subprocess.check_call(cmd) -download_file_powershell.viable = ( - lambda: platform.system() == 'Windows' and platform.win32_ver()[1] >= '6' -) +def has_powershell(): + if platform.system() != 'Windows': + return False + cmd = ['powershell', '-Command', 'echo test'] + devnull = open(os.path.devnull, 'wb') + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False + finally: + devnull.close() + return True + +download_file_powershell.viable = has_powershell def download_file_curl(url, target): cmd = ['curl', url, '--silent', '--output', target] -- cgit v1.2.1 From b72b9d1d538f200a3531903c6cd7a1bf7e3e22bd Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Sun, 25 Aug 2013 20:56:46 +1000 Subject: Document __main__.__requires__ Also modernises the initial overview for pkg_resources, and helps make it clear that it covers anything with an egg-info directory, not just egg files. --HG-- branch : docs_update_for_requires --- docs/pkg_resources.txt | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt index 480f9547..b2166b54 100644 --- a/docs/pkg_resources.txt +++ b/docs/pkg_resources.txt @@ -18,19 +18,16 @@ packages. Overview -------- -Eggs are a distribution format for Python modules, similar in concept to Java's -"jars" or Ruby's "gems". They differ from previous Python distribution formats -in that they are importable (i.e. they can be added to ``sys.path``), and they -are *discoverable*, meaning that they carry metadata that unambiguously -identifies their contents and dependencies, and thus can be *automatically* -found and added to ``sys.path`` in response to simple requests of the form, -"get me everything I need to use docutils' PDF support". - The ``pkg_resources`` module provides runtime facilities for finding, -introspecting, activating and using eggs and other "pluggable" distribution -formats. Because these are new concepts in Python (and not that well- -established in other languages either), it helps to have a few special terms -for talking about eggs and how they can be used: +introspecting, activating and using installed Python distributions. Some +of the more advanced features (notably the support for parallel installation +of multiple versions) rely specifically on the "egg" format (either as a +zip archive or subdirectory), while others (such as plugin discovery) will +work correctly so long as "egg-info" metadata directories are available for +relevant distributions. + +The following terms are needed in order to explain the capabilities offered +by this module: project A library, framework, script, plugin, application, or collection of data @@ -79,9 +76,13 @@ eggs with ``.egg`` and follows the egg naming conventions, and contain an ``EGG-INFO`` subdirectory (zipped or otherwise). Development eggs are normal directories of Python code with one or more ``ProjectName.egg-info`` - subdirectories. And egg links are ``*.egg-link`` files that contain the - name of a built or development egg, to support symbolic linking on - platforms that do not have native symbolic links. + subdirectories. The development egg format is also used to provide a + default version of a distribution that is available to software that + doesn't use ``pkg_resources`` to request specific versions. Egg links + are ``*.egg-link`` files that contain the name of a built or + development egg, to support symbolic linking on platforms that do not + have native symbolic links (or where the symbolic link support is + limited). (For more information about these terms and concepts, see also this `architectural overview`_ of ``pkg_resources`` and Python Eggs in general.) @@ -190,6 +191,17 @@ not provide any way to detect arbitrary changes to a list object like is designed so that the ``working_set`` is used by default, such that you don't have to explicitly refer to it most of the time. +All distributions available directly on ``sys.path`` will be activated +automatically when ``pkg_resources`` is imported. This behaviour can cause +version conflicts for applications which require non-default versions of +those distributions. To handle this situation, ``pkg_resources`` checks for a +``__requires__`` attribute in the ``__main__`` module when initializing the +default working set, and uses this to ensure a suitable version of each +affected distribution is activated. For example:: + + __requires__ = ["CherryPy < 3"] # Must be set before pkg_resources import + import pkg_resources + Basic ``WorkingSet`` Methods ---------------------------- -- cgit v1.2.1 From 0c3e350abfd455c6bf2678308cc26bef015b8d48 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Aug 2013 14:39:24 -0400 Subject: Reorganize imports --- setuptools/dist.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index 5c84b8d4..dfce015d 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -1,18 +1,23 @@ __all__ = ['Distribution'] import re +import os import sys import warnings +import distutils.log +import distutils.core +import distutils.cmd from distutils.core import Distribution as _Distribution +from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, + DistutilsSetupError) + from setuptools.depends import Require from setuptools.command.install import install from setuptools.command.sdist import sdist from setuptools.command.install_lib import install_lib from setuptools.compat import numeric_types, basestring -from distutils.errors import DistutilsOptionError, DistutilsPlatformError -from distutils.errors import DistutilsSetupError -import setuptools, pkg_resources, distutils.core, distutils.dist, distutils.cmd -import os, distutils.log +import setuptools +import pkg_resources def _get_unpatched(cls): """Protect against re-patching the distutils if reloaded -- cgit v1.2.1 From aece98c7d09ab1107ad77d2d4bfbec8d91fca127 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Aug 2013 14:40:08 -0400 Subject: Remove unused imports --- setuptools/dist.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index dfce015d..c90f73c2 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -12,11 +12,7 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError) from setuptools.depends import Require -from setuptools.command.install import install -from setuptools.command.sdist import sdist -from setuptools.command.install_lib import install_lib from setuptools.compat import numeric_types, basestring -import setuptools import pkg_resources def _get_unpatched(cls): -- cgit v1.2.1 From 2ec8add337856baa2fba48b161ef380d5d007a02 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Aug 2013 14:42:33 -0400 Subject: Trim excess whitespace --- setuptools/dist.py | 127 ++--------------------------------------------------- 1 file changed, 4 insertions(+), 123 deletions(-) diff --git a/setuptools/dist.py b/setuptools/dist.py index c90f73c2..c5b02f99 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -136,38 +136,6 @@ def check_packages(dist, attr, value): ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class Distribution(_Distribution): """Distribution with support for features, tests, and package data @@ -251,7 +219,7 @@ class Distribution(_Distribution): dist._version = pkg_resources.safe_version(str(attrs['version'])) self._patched_dist = dist - def __init__ (self, attrs=None): + def __init__(self, attrs=None): have_package_data = hasattr(self, "package_data") if not have_package_data: self.package_data = {} @@ -368,23 +336,6 @@ class Distribution(_Distribution): self.global_options = self.feature_options = go + self.global_options self.negative_opt = self.feature_negopt = no - - - - - - - - - - - - - - - - - def _finalize_features(self): """Add/remove features and resolve dependencies between them""" @@ -402,7 +353,6 @@ class Distribution(_Distribution): feature.exclude_from(self) self._set_feature(name,0) - def get_command_class(self, command): """Pluggable version of get_command_class()""" if command in self.cmdclass: @@ -422,10 +372,6 @@ class Distribution(_Distribution): self.cmdclass[ep.name] = cmdclass return _Distribution.print_commands(self) - - - - def _set_feature(self,name,status): """Set feature's inclusion status""" setattr(self,self._feature_attrname(name),status) @@ -440,8 +386,8 @@ class Distribution(_Distribution): if self.feature_is_included(name)==0: descr = self.features[name].description raise DistutilsOptionError( - descr + " is required, but was excluded or is not available" - ) + descr + " is required, but was excluded or is not available" + ) self.features[name].include_in(self) self._set_feature(name,1) @@ -489,7 +435,6 @@ class Distribution(_Distribution): if p.name != package and not p.name.startswith(pfx) ] - def has_contents_for(self,package): """Return true if 'exclude_package(package)' would do something""" @@ -499,15 +444,6 @@ class Distribution(_Distribution): if p==package or p.startswith(pfx): return True - - - - - - - - - def _exclude_misc(self,name,value): """Handle 'exclude()' for list/tuple attrs without a special handler""" if not isinstance(value,sequence): @@ -579,17 +515,6 @@ class Distribution(_Distribution): ) list(map(self.exclude_package, packages)) - - - - - - - - - - - def _parse_command_opts(self, parser, args): # Remove --with-X/--without-X options when processing command args self.global_options = self.__class__.global_options @@ -616,21 +541,6 @@ class Distribution(_Distribution): return nargs - - - - - - - - - - - - - - - def get_cmdline_options(self): """Return a '{cmd: {opt:val}}' map of all command-line options @@ -671,7 +581,6 @@ class Distribution(_Distribution): return d - def iter_distribution_names(self): """Yield all packages, modules, and extension names in distribution""" @@ -690,7 +599,6 @@ class Distribution(_Distribution): name = name[:-6] yield name - def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command @@ -732,24 +640,6 @@ for module in distutils.dist, distutils.core, distutils.cmd: module.Distribution = Distribution - - - - - - - - - - - - - - - - - - class Feature: """ **deprecated** -- The `Feature` facility was never completely implemented @@ -817,8 +707,7 @@ class Feature: ) def __init__(self, description, standard=False, available=True, - optional=True, require_features=(), remove=(), **extras - ): + optional=True, require_features=(), remove=(), **extras): self.warn_deprecated() self.description = description @@ -870,8 +759,6 @@ class Feature: for f in self.require_features: dist.include_feature(f) - - def exclude_from(self,dist): """Ensure feature is excluded from distribution @@ -888,8 +775,6 @@ class Feature: for item in self.remove: dist.exclude_package(item) - - def validate(self,dist): """Verify that feature makes sense in context of distribution @@ -909,7 +794,3 @@ class Feature: " doesn't contain any packages or modules under %s" % (self.description, item, item) ) - - - - -- cgit v1.2.1 From 4041d1f4667aa4bd7f7373ff7cc626b0d9f5d10c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Aug 2013 21:22:34 -0400 Subject: Updated error message reported when `--allow-hosts` blocks a link to provide a less startling user experience. Fixes #71. --- CHANGES.txt | 7 +++++++ setuptools/package_index.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9f1d15b3..b95b7102 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,13 @@ CHANGES ======= +--- +1.1 +--- + +* Issue #71 (Distribute Issue #333): EasyInstall now puts less emphasis on the + condition when a host is blocked via ``--allow-hosts``. + --- 1.0 --- diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 9c9d76a1..d949063e 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -343,7 +343,8 @@ class PackageIndex(Environment): s = URL_SCHEME(url) if (s and s.group(1).lower()=='file') or self.allows(urlparse(url)[1]): return True - msg = "\nLink to % s ***BLOCKED*** by --allow-hosts\n" + msg = ("\nNote: Bypassing %s (disallowed host; see " + "http://bit.ly/1dg9ijs for details).\n") if fatal: raise DistutilsError(msg % url) else: -- cgit v1.2.1 From 57e2b3119270044162edf4263b4ec7ea1e2adca9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 25 Aug 2013 21:27:33 -0400 Subject: Updated changelog entry to reference the pertinent issue. --- CHANGES.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b95b7102..70c0ffd6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,14 +13,14 @@ CHANGES 1.0 --- -* On Windows, Setuptools supports deferring to Vinay Sajip's `pylauncher - `_ (included with Python 3.3) to - launch console and GUI scripts and not install its own launcher - executables. This experimental functionality is currently only enabled if - the ``SETUPTOOLS_LAUNCHER`` environment variable is set to "natural". - In the future, this behavior may become default, but only after it has - matured and seen substantial adoption. The ``SETUPTOOLS_LAUNCHER`` also - accepts "executable" to force the default behavior of creating launcher +* Issue #60: On Windows, Setuptools supports deferring to another launcher, + such as Vinay Sajip's `pylauncher `_ + (included with Python 3.3) to launch console and GUI scripts and not install + its own launcher executables. This experimental functionality is currently + only enabled if the ``SETUPTOOLS_LAUNCHER`` environment variable is set to + "natural". In the future, this behavior may become default, but only after + it has matured and seen substantial adoption. The ``SETUPTOOLS_LAUNCHER`` + also accepts "executable" to force the default behavior of creating launcher executables. * Issue #63: Bootstrap script (ez_setup.py) now prefers Powershell, curl, or wget for retrieving the Setuptools tarball for improved security of the -- cgit v1.2.1 From ae675b923b2079bad5d2bba83502cefc83a1edc2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 26 Aug 2013 21:27:34 -0400 Subject: Nest try/except/finally for use on Python 2.4. Fixes #72. --- CHANGES.txt | 1 + ez_setup.py | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 70c0ffd6..3e2caeb0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ CHANGES * Issue #71 (Distribute Issue #333): EasyInstall now puts less emphasis on the condition when a host is blocked via ``--allow-hosts``. +* Issue #72: Restored Python 2.4 compatibility in ``ez_setup.py``. --- 1.0 diff --git a/ez_setup.py b/ez_setup.py index 40db5a57..7a597d22 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -170,9 +170,10 @@ def has_powershell(): cmd = ['powershell', '-Command', 'echo test'] devnull = open(os.path.devnull, 'wb') try: - subprocess.check_call(cmd, stdout=devnull, stderr=devnull) - except: - return False + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False finally: devnull.close() return True @@ -187,9 +188,10 @@ def has_curl(): cmd = ['curl', '--version'] devnull = open(os.path.devnull, 'wb') try: - subprocess.check_call(cmd, stdout=devnull, stderr=devnull) - except: - return False + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False finally: devnull.close() return True @@ -204,9 +206,10 @@ def has_wget(): cmd = ['wget', '--version'] devnull = open(os.path.devnull, 'wb') try: - subprocess.check_call(cmd, stdout=devnull, stderr=devnull) - except: - return False + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False finally: devnull.close() return True -- cgit v1.2.1 From 7fa044fd170dc56ac8c484aa4739285d568150a4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 26 Aug 2013 21:42:33 -0400 Subject: Added tag 1.1 for changeset d943b67fe80d --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 96735c09..3957034c 100644 --- a/.hgtags +++ b/.hgtags @@ -93,3 +93,4 @@ e0a6e225ad6b28471cd42cfede6e8a334bb548fb 0.9.8 aba16323ec9382da7bc77c633990ccb3bd58d050 1.0b2 8a98492f0d852402c93ddbbf3f07081909a9105f 1.0b3 c385fdf1f976fb1d2a6accc9292d8eca419180fa 1.0 +d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 -- cgit v1.2.1 From db4b127a0370bb7f2bfaa77b3163c0f26ee980ea Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 26 Aug 2013 21:43:00 -0400 Subject: Bumped to 1.2 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 90 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 14 +++--- setuptools/version.py | 2 +- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 7a597d22..13d0949f 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1" +DEFAULT_VERSION = "1.2" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index df9b9c2d..abcafd65 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[distutils.commands] -install_scripts = setuptools.command.install_scripts:install_scripts -install = setuptools.command.install:install -setopt = setuptools.command.setopt:setopt -register = setuptools.command.register:register -easy_install = setuptools.command.easy_install:easy_install -test = setuptools.command.test:test -sdist = setuptools.command.sdist:sdist -alias = setuptools.command.alias:alias -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -egg_info = setuptools.command.egg_info:egg_info -bdist_egg = setuptools.command.bdist_egg:bdist_egg -build_py = setuptools.command.build_py:build_py -upload_docs = setuptools.command.upload_docs:upload_docs -install_lib = setuptools.command.install_lib:install_lib -develop = setuptools.command.develop:develop -rotate = setuptools.command.rotate:rotate -build_ext = setuptools.command.build_ext:build_ext -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -saveopts = setuptools.command.saveopts:saveopts -install_egg_info = setuptools.command.install_egg_info:install_egg_info +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap [distutils.setup_keywords] -tests_require = setuptools.dist:check_requirements -install_requires = setuptools.dist:check_requirements -package_data = setuptools.dist:check_package_data -use_2to3_exclude_fixers = setuptools.dist:assert_string_list exclude_package_data = setuptools.dist:check_package_data -dependency_links = setuptools.dist:assert_string_list +eager_resources = setuptools.dist:assert_string_list convert_2to3_doctests = setuptools.dist:assert_string_list -use_2to3_fixers = setuptools.dist:assert_string_list -test_loader = setuptools.dist:check_importable -use_2to3 = setuptools.dist:assert_bool test_suite = setuptools.dist:check_test_suite -namespace_packages = setuptools.dist:check_nsp -zip_safe = setuptools.dist:assert_bool +package_data = setuptools.dist:check_package_data packages = setuptools.dist:check_packages -eager_resources = setuptools.dist:assert_string_list +use_2to3 = setuptools.dist:assert_bool +entry_points = setuptools.dist:check_entry_points include_package_data = setuptools.dist:assert_bool +use_2to3_exclude_fixers = setuptools.dist:assert_string_list extras_require = setuptools.dist:check_extras -entry_points = setuptools.dist:check_entry_points - -[console_scripts] -easy_install-3.3 = setuptools.command.easy_install:main -easy_install = setuptools.command.easy_install:main +test_loader = setuptools.dist:check_importable +install_requires = setuptools.dist:check_requirements +use_2to3_fixers = setuptools.dist:assert_string_list +tests_require = setuptools.dist:check_requirements +dependency_links = setuptools.dist:assert_string_list +namespace_packages = setuptools.dist:check_nsp +zip_safe = setuptools.dist:assert_bool -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap +[setuptools.file_finders] +svn_cvs = setuptools.command.sdist:_default_revctrl [egg_info.writers] -entry_points.txt = setuptools.command.egg_info:write_entries -PKG-INFO = setuptools.command.egg_info:write_pkg_info +dependency_links.txt = setuptools.command.egg_info:overwrite_arg requires.txt = setuptools.command.egg_info:write_requirements namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -dependency_links.txt = setuptools.command.egg_info:overwrite_arg +entry_points.txt = setuptools.command.egg_info:write_entries +depends.txt = setuptools.command.egg_info:warn_depends_obsolete eager_resources.txt = setuptools.command.egg_info:overwrite_arg +PKG-INFO = setuptools.command.egg_info:write_pkg_info top_level.txt = setuptools.command.egg_info:write_toplevel_names -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -[setuptools.file_finders] -svn_cvs = setuptools.command.sdist:_default_revctrl +[distutils.commands] +easy_install = setuptools.command.easy_install:easy_install +build_ext = setuptools.command.build_ext:build_ext +install = setuptools.command.install:install +saveopts = setuptools.command.saveopts:saveopts +install_egg_info = setuptools.command.install_egg_info:install_egg_info +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +test = setuptools.command.test:test +install_scripts = setuptools.command.install_scripts:install_scripts +egg_info = setuptools.command.egg_info:egg_info +upload_docs = setuptools.command.upload_docs:upload_docs +sdist = setuptools.command.sdist:sdist +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +alias = setuptools.command.alias:alias +rotate = setuptools.command.rotate:rotate +register = setuptools.command.register:register +develop = setuptools.command.develop:develop +bdist_egg = setuptools.command.bdist_egg:bdist_egg +install_lib = setuptools.command.install_lib:install_lib +build_py = setuptools.command.build_py:build_py +setopt = setuptools.command.setopt:setopt diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index c06a8a0b..6d385dc7 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ -[ssl:sys_platform=='win32'] -wincertstore==0.1 - -[ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 - [ssl:python_version in '2.4, 2.5'] ssl==1.16 [certs] -certifi==0.0.8 \ No newline at end of file +certifi==0.0.8 + +[ssl:sys_platform=='win32'] +wincertstore==0.1 + +[ssl:sys_platform=='win32' and python_version=='2.4'] +ctypes==1.0.2 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index 439eb0cd..64477cf2 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1' +__version__ = '1.2' -- cgit v1.2.1 From 48ab068f3683139591a03a47ffc50f0b42b767cd Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 26 Aug 2013 21:45:05 -0400 Subject: Update reference to distribute. --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3e2caeb0..928673bc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,7 +6,7 @@ CHANGES 1.1 --- -* Issue #71 (Distribute Issue #333): EasyInstall now puts less emphasis on the +* Issue #71 (Distribute #333): EasyInstall now puts less emphasis on the condition when a host is blocked via ``--allow-hosts``. * Issue #72: Restored Python 2.4 compatibility in ``ez_setup.py``. -- cgit v1.2.1 From afe5e690c83adb9efea6f2eb774d9bf9798053fb Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Fri, 30 Aug 2013 21:55:23 +1000 Subject: Add back a more descriptive intro --HG-- branch : docs_update_for_requires --- docs/pkg_resources.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt index b2166b54..6c93b57d 100644 --- a/docs/pkg_resources.txt +++ b/docs/pkg_resources.txt @@ -26,6 +26,21 @@ zip archive or subdirectory), while others (such as plugin discovery) will work correctly so long as "egg-info" metadata directories are available for relevant distributions. +Eggs are a distribution format for Python modules, similar in concept to +Java's "jars" or Ruby's "gems", or the "wheel" format defined in PEP 427. +However, unlike a pure distribution format, egg can also be installed and +added directly to ``sys.path`` as an import location. When installed in +this way, eggs are *discoverable*, meaning that they carry metadata that +unambiguously identifies their contents and dependencies. This means that +an installed egg can be *automatically* found and added to ``sys.path`` in +response to simple requests of the form, "get me everything I need to use +docutils' PDF support". This feature allows mutually conflicting versions of +a distribution to co-exist in the same Python installation, with individual +applications activating the desired version at runtime by manipulating the +contents of ``sys.path`` (this differs from the virtual environment +approach, which involves creating isolated environments for each +application). + The following terms are needed in order to explain the capabilities offered by this module: -- cgit v1.2.1 From b9ae0569d22adc9f83301f180ebcb17ae7ae2e6f Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Fri, 30 Aug 2013 21:58:51 +1000 Subject: Typo fix --HG-- branch : docs_update_for_requires --- docs/pkg_resources.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt index 6c93b57d..3aac4720 100644 --- a/docs/pkg_resources.txt +++ b/docs/pkg_resources.txt @@ -28,7 +28,7 @@ relevant distributions. Eggs are a distribution format for Python modules, similar in concept to Java's "jars" or Ruby's "gems", or the "wheel" format defined in PEP 427. -However, unlike a pure distribution format, egg can also be installed and +However, unlike a pure distribution format, eggs can also be installed and added directly to ``sys.path`` as an import location. When installed in this way, eggs are *discoverable*, meaning that they carry metadata that unambiguously identifies their contents and dependencies. This means that -- cgit v1.2.1 From 0424d55854a4814a17377460975b791a8cb24a62 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 31 Aug 2013 12:12:16 -0400 Subject: ez_setup.py now takes a --insecure argument to bypass the secure downloaders. download_setuptools also now accepts a new keyword argument 'download_factory', enabling programmitic invocation to customize the downloader resolution. Fixes #75. Thanks to Pablo Algarvio for the report and suggestions. --- CHANGES.txt | 7 +++++++ CONTRIBUTORS.txt | 1 + ez_setup.py | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3e2caeb0..7ac75d7d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,13 @@ CHANGES ======= +---- +next +---- + +* Issue #75: Add ``--insecure`` option to ez_setup.py to accommodate + environments where a trusted SSL connection cannot be validated. + --- 1.1 --- diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index f1966505..dd0b8c7f 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -21,6 +21,7 @@ Contributors * Marc Abramowitz * Martin von Löwis * Noufal Ibrahim +* Pedro Algarvio * Pete Hollobon * Phillip J. Eby * Philip Jenvey diff --git a/ez_setup.py b/ez_setup.py index 7a597d22..5c494460 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -254,7 +254,8 @@ def get_best_downloader(): return dl def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, - to_dir=os.curdir, delay=15): + to_dir=os.curdir, delay=15, + downloader_factory=get_best_downloader): """Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available @@ -262,6 +263,9 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. + + ``downloader_factory`` should be a function taking no arguments and + returning a function for downloading a URL to a target. """ # making sure we use the absolute path to_dir = os.path.abspath(to_dir) @@ -270,7 +274,7 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, saveto = os.path.join(to_dir, tgz_name) if not os.path.exists(saveto): # Avoid repeated downloads log.warn("Downloading %s", url) - downloader = get_best_downloader() + downloader = downloader_factory() downloader(url, saveto) return os.path.realpath(saveto) @@ -346,6 +350,11 @@ def _parse_args(): '--download-base', dest='download_base', metavar="URL", default=DEFAULT_URL, help='alternative URL from where to download the setuptools package') + parser.add_option( + '--insecure', dest='downloader_factory', action='store_const', + const=lambda: download_file_insecure, default=get_best_downloader, + help='Use internal, non-validating downloader' + ) options, args = parser.parse_args() # positional arguments are ignored return options @@ -353,7 +362,8 @@ def _parse_args(): def main(version=DEFAULT_VERSION): """Install or upgrade setuptools and EasyInstall""" options = _parse_args() - tarball = download_setuptools(download_base=options.download_base) + tarball = download_setuptools(download_base=options.download_base, + downloader_factory=options.downloader_factory) return _install(tarball, _build_install_args(options)) if __name__ == '__main__': -- cgit v1.2.1 From 01ef8a46f78d30526b57339e71f80f79e5a0d9dc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 13:51:42 -0400 Subject: Remove unused import --- setuptools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 45b95f90..266661bc 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -1,5 +1,5 @@ """Extensions to the 'distutils' for large or complex distributions""" -from setuptools.extension import Extension, Library +from setuptools.extension import Extension from setuptools.dist import Distribution, Feature, _get_unpatched import distutils.core, setuptools.command from setuptools.depends import Require -- cgit v1.2.1 From 231b4c70dee105919e04c9ee3e1dcadb52546251 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 13:53:47 -0400 Subject: Remove unused import --- setuptools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 266661bc..3373e240 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -1,7 +1,7 @@ """Extensions to the 'distutils' for large or complex distributions""" from setuptools.extension import Extension from setuptools.dist import Distribution, Feature, _get_unpatched -import distutils.core, setuptools.command +import distutils.core from setuptools.depends import Require from distutils.core import Command as _Command from distutils.util import convert_path -- cgit v1.2.1 From 396a217ad725e25c8761edf3678dea349d06e023 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 13:55:59 -0400 Subject: Reorganize imports --- setuptools/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 3373e240..b048d9fd 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -1,19 +1,23 @@ """Extensions to the 'distutils' for large or complex distributions""" -from setuptools.extension import Extension -from setuptools.dist import Distribution, Feature, _get_unpatched + +import os +import sys import distutils.core -from setuptools.depends import Require from distutils.core import Command as _Command from distutils.util import convert_path -import os -import sys -from setuptools.version import __version__ + +import setuptools.version +from setuptools.extension import Extension +from setuptools.dist import Distribution, Feature, _get_unpatched +from setuptools.depends import Require __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'find_packages' ] +__version__ = setuptools.version.__version__ + bootstrap_install_from = None # If we run 2to3 on .py files, should we also convert docstrings? -- cgit v1.2.1 From 053ed7e2f6885b001a85fc0a8759f2226a2f178a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:00:19 -0400 Subject: Refactor for clarity --- setuptools/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index b048d9fd..2eb51a1f 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -41,10 +41,14 @@ def find_packages(where='.', exclude=()): where,prefix = stack.pop(0) for name in os.listdir(where): fn = os.path.join(where,name) - if ('.' not in name and os.path.isdir(fn) and - os.path.isfile(os.path.join(fn,'__init__.py')) - ): - out.append(prefix+name); stack.append((fn,prefix+name+'.')) + looks_like_package = ( + '.' not in name + and os.path.isdir(fn) + and os.path.isfile(os.path.join(fn,'__init__.py')) + ) + if looks_like_package: + out.append(prefix+name) + stack.append((fn,prefix+name+'.')) for pat in list(exclude)+['ez_setup']: from fnmatch import fnmatchcase out = [item for item in out if not fnmatchcase(item,pat)] -- cgit v1.2.1 From 26ea618c278baa8ea77bf3f81f8abf5e3c1cf416 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:01:55 -0400 Subject: Move imports to leader --- setuptools/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 2eb51a1f..820f7f55 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -3,6 +3,7 @@ import os import sys import distutils.core +import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path @@ -44,11 +45,11 @@ def find_packages(where='.', exclude=()): looks_like_package = ( '.' not in name and os.path.isdir(fn) - and os.path.isfile(os.path.join(fn,'__init__.py')) + and os.path.isfile(os.path.join(fn, '__init__.py')) ) if looks_like_package: out.append(prefix+name) - stack.append((fn,prefix+name+'.')) + stack.append((fn, prefix+name+'.')) for pat in list(exclude)+['ez_setup']: from fnmatch import fnmatchcase out = [item for item in out if not fnmatchcase(item,pat)] @@ -75,7 +76,6 @@ class Command(_Command): setattr(cmd,k,v) # update command with keywords return cmd -import distutils.core distutils.core.Command = Command # we can't patch distutils.cmd, alas def findall(dir = os.curdir): @@ -91,7 +91,6 @@ def findall(dir = os.curdir): all_files.extend(filter(os.path.isfile, files)) return all_files -import distutils.filelist distutils.filelist.findall = findall # fix findall bug in distutils. # sys.dont_write_bytecode was introduced in Python 2.6. -- cgit v1.2.1 From 352f5f5c49dbd9d0a71106b7d380adce2543d020 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:04:53 -0400 Subject: Refactor _dont_write_bytecode detection --- setuptools/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 820f7f55..48bc1a4b 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -94,8 +94,10 @@ def findall(dir = os.curdir): distutils.filelist.findall = findall # fix findall bug in distutils. # sys.dont_write_bytecode was introduced in Python 2.6. -if ((hasattr(sys, "dont_write_bytecode") and sys.dont_write_bytecode) or - (not hasattr(sys, "dont_write_bytecode") and os.environ.get("PYTHONDONTWRITEBYTECODE"))): - _dont_write_bytecode = True -else: - _dont_write_bytecode = False +_dont_write_bytecode = ( + (hasattr(sys, "dont_write_bytecode") and sys.dont_write_bytecode) + or ( + not hasattr(sys, "dont_write_bytecode") + and os.environ.get("PYTHONDONTWRITEBYTECODE") + ) +) -- cgit v1.2.1 From 420493f6338b6511cddb6b6bcafcdb33415afe4b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:12:15 -0400 Subject: More simply resolve _dont_write_bytecode. --- setuptools/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 48bc1a4b..fc9b7b93 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -94,10 +94,5 @@ def findall(dir = os.curdir): distutils.filelist.findall = findall # fix findall bug in distutils. # sys.dont_write_bytecode was introduced in Python 2.6. -_dont_write_bytecode = ( - (hasattr(sys, "dont_write_bytecode") and sys.dont_write_bytecode) - or ( - not hasattr(sys, "dont_write_bytecode") - and os.environ.get("PYTHONDONTWRITEBYTECODE") - ) -) +_dont_write_bytecode = getattr(sys, 'dont_write_bytecode', + bool(os.environ.get("PYTHONDONTWRITEBYTECODE"))) -- cgit v1.2.1 From a81b616547845b80c52e642bfe56180676d46d0c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:16:19 -0400 Subject: Move imports to header --- setuptools/command/easy_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 66dc798b..a7a40e26 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -24,6 +24,8 @@ import random import platform import textwrap import warnings +import site +import struct from glob import glob from distutils import log, dir_util @@ -73,10 +75,8 @@ __all__ = [ 'main', 'get_exe_prefixes', ] -import site HAS_USER_SITE = not sys.version < "2.6" and site.ENABLE_USER_SITE -import struct def is_64bit(): return struct.calcsize("P") == 8 -- cgit v1.2.1 From 05ea2dae700821c491b3fd1cc665c26e1b7a5ed8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:18:14 -0400 Subject: Normalize style --- setuptools/command/easy_install.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index a7a40e26..7aff9c84 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -502,7 +502,8 @@ Please make the appropriate changes for your system and try again. else: try: f.write("import os; f = open(%r, 'w'); f.write('OK'); f.close()\n" % (ok_file,)) - f.close(); f=None + f.close() + f=None executable = sys.executable if os.name=='nt': dirname,basename = os.path.split(executable) @@ -521,9 +522,12 @@ Please make the appropriate changes for your system and try again. ) return True finally: - if f: f.close() - if os.path.exists(ok_file): os.unlink(ok_file) - if os.path.exists(pth_file): os.unlink(pth_file) + if f: + f.close() + if os.path.exists(ok_file): + os.unlink(ok_file) + if os.path.exists(pth_file): + os.unlink(pth_file) if not self.multi_version: log.warn("TEST FAILED: %s does NOT support .pth files", instdir) return False -- cgit v1.2.1 From 3860484b6cc33cc499b56c96a6332263be562bfe Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:21:33 -0400 Subject: Refactor for nicer indentation --- setuptools/command/easy_install.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 7aff9c84..755b15d6 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -81,14 +81,13 @@ def is_64bit(): return struct.calcsize("P") == 8 def samefile(p1, p2): - if hasattr(os.path,'samefile') and ( - os.path.exists(p1) and os.path.exists(p2) - ): - return os.path.samefile(p1,p2) - return ( - os.path.normpath(os.path.normcase(p1)) == - os.path.normpath(os.path.normcase(p2)) - ) + both_exist = os.path.exists(p1) and os.path.exists(p2) + use_samefile = hasattr(os.path, 'samefile') and both_exist + if use_samefile: + return os.path.samefile(p1, p2) + norm_p1 = os.path.normpath(os.path.normcase(p1)) + norm_p2 = os.path.normpath(os.path.normcase(p2)) + return norm_p1 == norm_p2 if sys.version_info <= (3,): def _to_ascii(s): -- cgit v1.2.1 From b1dfe6c40f83f5b1efab707c356aa08fdeb1b62b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:23:39 -0400 Subject: Rename variable to avoid conflation with global --- setuptools/command/easy_install.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 755b15d6..78d96696 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -882,10 +882,10 @@ Please make the appropriate changes for your system and try again. # Convert the .exe to an unpacked egg egg_path = dist.location = os.path.join(tmpdir, dist.egg_name()+'.egg') egg_tmp = egg_path + '.tmp' - egg_info = os.path.join(egg_tmp, 'EGG-INFO') - pkg_inf = os.path.join(egg_info, 'PKG-INFO') + _egg_info = os.path.join(egg_tmp, 'EGG-INFO') + pkg_inf = os.path.join(_egg_info, 'PKG-INFO') ensure_directory(pkg_inf) # make sure EGG-INFO dir exists - dist._provider = PathMetadata(egg_tmp, egg_info) # XXX + dist._provider = PathMetadata(egg_tmp, _egg_info) # XXX self.exe_to_egg(dist_filename, egg_tmp) # Write EGG-INFO/PKG-INFO @@ -896,7 +896,7 @@ Please make the appropriate changes for your system and try again. if k != 'target_version': f.write('%s: %s\n' % (k.replace('_','-').title(), v)) f.close() - script_dir = os.path.join(egg_info,'scripts') + script_dir = os.path.join(_egg_info,'scripts') self.delete_blockers( # delete entry-point scripts to avoid duping [os.path.join(script_dir,args[0]) for args in get_script_args(dist)] ) -- cgit v1.2.1 From 6826957239fac24794af05c81a8fb176467c698f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:24:03 -0400 Subject: Remove unused import --- setuptools/command/easy_install.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 78d96696..737a6fc3 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -962,7 +962,6 @@ Please make the appropriate changes for your system and try again. return dist # XXX temporarily disable until new strategy is stable from imp import find_module, get_suffixes - from glob import glob blockers = [] names = dict.fromkeys(dist._get_metadata('top_level.txt')) # XXX private attr -- cgit v1.2.1 From 234c0fc5d3ecde835fd130a8d072fcffba7e172c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Sep 2013 14:29:35 -0400 Subject: Remove long-disabled functionality 'check_conflicts'. --- setuptools/command/easy_install.py | 57 +------------------------------------- 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 737a6fc3..6ce19fa4 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -640,7 +640,7 @@ Please make the appropriate changes for your system and try again. for dist in dists: self.process_distribution(spec, dist, deps) else: - dists = [self.check_conflicts(self.egg_distribution(download))] + dists = [self.egg_distribution(download)] self.process_distribution(spec, dists[0], deps, "Using") if spec is not None: @@ -838,7 +838,6 @@ Please make the appropriate changes for your system and try again. ensure_directory(destination) dist = self.egg_distribution(egg_path) - self.check_conflicts(dist) if not samefile(egg_path, destination): if os.path.isdir(destination) and not os.path.islink(destination): dir_util.remove_tree(destination, dry_run=self.dry_run) @@ -957,60 +956,6 @@ Please make the appropriate changes for your system and try again. f.write('\n'.join(locals()[name])+'\n') f.close() - def check_conflicts(self, dist): - """Verify that there are no conflicting "old-style" packages""" - - return dist # XXX temporarily disable until new strategy is stable - from imp import find_module, get_suffixes - - blockers = [] - names = dict.fromkeys(dist._get_metadata('top_level.txt')) # XXX private attr - - exts = {'.pyc':1, '.pyo':1} # get_suffixes() might leave one out - for ext,mode,typ in get_suffixes(): - exts[ext] = 1 - - for path,files in expand_paths([self.install_dir]+self.all_site_dirs): - for filename in files: - base,ext = os.path.splitext(filename) - if base in names: - if not ext: - # no extension, check for package - try: - f, filename, descr = find_module(base, [path]) - except ImportError: - continue - else: - if f: f.close() - if filename not in blockers: - blockers.append(filename) - elif ext in exts and base!='site': # XXX ugh - blockers.append(os.path.join(path,filename)) - if blockers: - self.found_conflicts(dist, blockers) - - return dist - - def found_conflicts(self, dist, blockers): - msg = """\ -------------------------------------------------------------------------- -CONFLICT WARNING: - -The following modules or packages have the same names as modules or -packages being installed, and will be *before* the installed packages in -Python's search path. You MUST remove all of the relevant files and -directories before you will be able to use the package(s) you are -installing: - - %s - -------------------------------------------------------------------------- -""" % '\n '.join(blockers) - - sys.stderr.write(msg) - sys.stderr.flush() - raise DistutilsError("Installation aborted due to conflicts") - def installation_report(self, req, dist, what="Installed"): """Helpful installation message for display to package users""" msg = "\n%(what)s %(eggloc)s%(extras)s" -- cgit v1.2.1 From bd959a59df72cacea485bedccd8f5d452e0aa353 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:39:26 -0400 Subject: Remove import * --- setuptools/command/upload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 02d955ed..8d258d5a 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -2,10 +2,10 @@ Implements the Distutils 'upload' subcommand (upload package to PyPI).""" -from distutils.errors import * +from distutils import errors +from distutils import log from distutils.core import Command from distutils.spawn import spawn -from distutils import log try: from hashlib import md5 except ImportError: @@ -45,7 +45,7 @@ class upload(Command): def finalize_options(self): if self.identity and not self.sign: - raise DistutilsOptionError( + raise errors.DistutilsOptionError( "Must use --sign for --identity to have meaning" ) if 'HOME' in os.environ: @@ -68,7 +68,7 @@ class upload(Command): def run(self): if not self.distribution.dist_files: - raise DistutilsOptionError("No dist file created in earlier command") + raise errors.DistutilsOptionError("No dist file created in earlier command") for command, pyversion, filename in self.distribution.dist_files: self.upload_file(command, pyversion, filename) -- cgit v1.2.1 From 701115d88ba8b59b890672d131bc061c80e889c9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:40:40 -0400 Subject: Use isinstance for type comparison --- setuptools/command/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 8d258d5a..93da7a39 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -122,7 +122,7 @@ class upload(Command): body = StringIO.StringIO() for key, value in data.items(): # handle multiple entries for the same name - if type(value) != type([]): + if isinstance(value, list): value = [value] for value in value: if type(value) is tuple: -- cgit v1.2.1 From aa3e70d8a887dc71ecc8170d04a623fa5542360f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:41:05 -0400 Subject: Remove unused variable --- setuptools/command/upload.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 93da7a39..dde4decd 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -158,7 +158,6 @@ class upload(Command): raise AssertionError("unsupported schema " + schema) data = '' - loglevel = log.INFO try: http.connect() http.putrequest("POST", url) -- cgit v1.2.1 From ca3e8a370652c0735cb3921d43152e1014bbd946 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:46:55 -0400 Subject: Correct AttributeError in upload command on Python 2.4. Fixes #76 --- CHANGES.txt | 7 ++++--- setuptools/command/upload.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 5a739571..b0d0da3e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,12 +2,13 @@ CHANGES ======= ----- -next ----- +----- +1.1.1 +----- * Issue #75: Add ``--insecure`` option to ez_setup.py to accommodate environments where a trusted SSL connection cannot be validated. +* Issue #76: Fix AttributeError in upload command with Python 2.4. --- 1.1 diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index dde4decd..5476b5ec 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -119,7 +119,7 @@ class upload(Command): boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = '\n--' + boundary end_boundary = sep_boundary + '--' - body = StringIO.StringIO() + body = StringIO() for key, value in data.items(): # handle multiple entries for the same name if isinstance(value, list): -- cgit v1.2.1 From 5840ec69294a4ff2f499f2465434aaf9288a7177 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:48:50 -0400 Subject: Bumped to 1.1.1 in preparation for next release. --- ez_setup.py | 2 +- setuptools/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 975501e4..da0522f1 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.2" +DEFAULT_VERSION = "1.1.1" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools/version.py b/setuptools/version.py index 64477cf2..b3ddbc41 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.2' +__version__ = '1.1.1' -- cgit v1.2.1 From cd04261b69743dd545338cd9628ac18afc526d94 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:48:52 -0400 Subject: Added tag 1.1.1 for changeset 2e42e8654610 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3957034c..040273df 100644 --- a/.hgtags +++ b/.hgtags @@ -94,3 +94,4 @@ aba16323ec9382da7bc77c633990ccb3bd58d050 1.0b2 8a98492f0d852402c93ddbbf3f07081909a9105f 1.0b3 c385fdf1f976fb1d2a6accc9292d8eca419180fa 1.0 d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 +2e42e86546100c9f6845b04eb31b75c5add05f78 1.1.1 -- cgit v1.2.1 From bb6bcc421feb339c8cb876edc1f3eb18159aa6a0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 3 Sep 2013 22:49:15 -0400 Subject: Bumped to 1.1.2 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 90 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 6 +-- setuptools/version.py | 2 +- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index da0522f1..62bcd0a7 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1.1" +DEFAULT_VERSION = "1.1.2" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index abcafd65..73898c72 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - [distutils.setup_keywords] -exclude_package_data = setuptools.dist:check_package_data -eager_resources = setuptools.dist:assert_string_list +test_loader = setuptools.dist:check_importable convert_2to3_doctests = setuptools.dist:assert_string_list -test_suite = setuptools.dist:check_test_suite -package_data = setuptools.dist:check_package_data +namespace_packages = setuptools.dist:check_nsp packages = setuptools.dist:check_packages -use_2to3 = setuptools.dist:assert_bool -entry_points = setuptools.dist:check_entry_points +test_suite = setuptools.dist:check_test_suite +eager_resources = setuptools.dist:assert_string_list include_package_data = setuptools.dist:assert_bool +zip_safe = setuptools.dist:assert_bool use_2to3_exclude_fixers = setuptools.dist:assert_string_list extras_require = setuptools.dist:check_extras -test_loader = setuptools.dist:check_importable -install_requires = setuptools.dist:check_requirements -use_2to3_fixers = setuptools.dist:assert_string_list +entry_points = setuptools.dist:check_entry_points +use_2to3 = setuptools.dist:assert_bool tests_require = setuptools.dist:check_requirements +package_data = setuptools.dist:check_package_data +install_requires = setuptools.dist:check_requirements +exclude_package_data = setuptools.dist:check_package_data dependency_links = setuptools.dist:assert_string_list -namespace_packages = setuptools.dist:check_nsp -zip_safe = setuptools.dist:assert_bool +use_2to3_fixers = setuptools.dist:assert_string_list -[setuptools.file_finders] -svn_cvs = setuptools.command.sdist:_default_revctrl +[distutils.commands] +upload_docs = setuptools.command.upload_docs:upload_docs +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +build_py = setuptools.command.build_py:build_py +develop = setuptools.command.develop:develop +install_lib = setuptools.command.install_lib:install_lib +build_ext = setuptools.command.build_ext:build_ext +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +rotate = setuptools.command.rotate:rotate +install_egg_info = setuptools.command.install_egg_info:install_egg_info +setopt = setuptools.command.setopt:setopt +saveopts = setuptools.command.saveopts:saveopts +install_scripts = setuptools.command.install_scripts:install_scripts +install = setuptools.command.install:install +test = setuptools.command.test:test +register = setuptools.command.register:register +easy_install = setuptools.command.easy_install:easy_install +alias = setuptools.command.alias:alias +sdist = setuptools.command.sdist:sdist +bdist_egg = setuptools.command.bdist_egg:bdist_egg +egg_info = setuptools.command.egg_info:egg_info + +[console_scripts] +easy_install-3.3 = setuptools.command.easy_install:main +easy_install = setuptools.command.easy_install:main + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap [egg_info.writers] +entry_points.txt = setuptools.command.egg_info:write_entries dependency_links.txt = setuptools.command.egg_info:overwrite_arg -requires.txt = setuptools.command.egg_info:write_requirements +PKG-INFO = setuptools.command.egg_info:write_pkg_info namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -entry_points.txt = setuptools.command.egg_info:write_entries +requires.txt = setuptools.command.egg_info:write_requirements +top_level.txt = setuptools.command.egg_info:write_toplevel_names depends.txt = setuptools.command.egg_info:warn_depends_obsolete eager_resources.txt = setuptools.command.egg_info:overwrite_arg -PKG-INFO = setuptools.command.egg_info:write_pkg_info -top_level.txt = setuptools.command.egg_info:write_toplevel_names -[distutils.commands] -easy_install = setuptools.command.easy_install:easy_install -build_ext = setuptools.command.build_ext:build_ext -install = setuptools.command.install:install -saveopts = setuptools.command.saveopts:saveopts -install_egg_info = setuptools.command.install_egg_info:install_egg_info -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -test = setuptools.command.test:test -install_scripts = setuptools.command.install_scripts:install_scripts -egg_info = setuptools.command.egg_info:egg_info -upload_docs = setuptools.command.upload_docs:upload_docs -sdist = setuptools.command.sdist:sdist -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -alias = setuptools.command.alias:alias -rotate = setuptools.command.rotate:rotate -register = setuptools.command.register:register -develop = setuptools.command.develop:develop -bdist_egg = setuptools.command.bdist_egg:bdist_egg -install_lib = setuptools.command.install_lib:install_lib -build_py = setuptools.command.build_py:build_py -setopt = setuptools.command.setopt:setopt +[setuptools.file_finders] +svn_cvs = setuptools.command.sdist:_default_revctrl diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 6d385dc7..e7f0f3b8 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ +[ssl:sys_platform=='win32'] +wincertstore==0.1 + [ssl:python_version in '2.4, 2.5'] ssl==1.16 [certs] certifi==0.0.8 -[ssl:sys_platform=='win32'] -wincertstore==0.1 - [ssl:sys_platform=='win32' and python_version=='2.4'] ctypes==1.0.2 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index b3ddbc41..7b344eca 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1.1' +__version__ = '1.1.2' -- cgit v1.2.1 From 705e6255fca83f5ff2b194e6529968017cefaaa3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:33:13 -0400 Subject: Correct 404 errors when URLs contain fragments. Fixes #69. --- setuptools/compat.py | 5 +++-- setuptools/package_index.py | 2 +- setuptools/py26compat.py | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 setuptools/py26compat.py diff --git a/setuptools/compat.py b/setuptools/compat.py index e2f64de2..6094ca74 100644 --- a/setuptools/compat.py +++ b/setuptools/compat.py @@ -26,7 +26,7 @@ if sys.version_info[0] < 3: reduce = reduce unichr = unichr unicode = unicode - from urllib import url2pathname + from urllib import url2pathname, splittag import urllib2 from urllib2 import urlopen, HTTPError, URLError, unquote, splituser from urlparse import urlparse, urlunparse, urljoin @@ -72,7 +72,8 @@ else: from urllib.error import HTTPError, URLError import urllib.request as urllib2 from urllib.request import urlopen, url2pathname - from urllib.parse import urlparse, urlunparse, unquote, splituser, urljoin + from urllib.parse import (urlparse, urlunparse, unquote, splituser, + urljoin, splittag) xrange = range filterfalse = itertools.filterfalse diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 4c4a647d..a09048b4 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -657,7 +657,7 @@ class PackageIndex(Environment): fp, tfp, info = None, None, None try: checker = HashChecker.from_url(url) - fp = self.open_url(url) + fp = self.open_url(strip_fragment(url)) if isinstance(fp, HTTPError): raise DistutilsError( "Can't download %s: %s %s" % (url, fp.code,fp.msg) diff --git a/setuptools/py26compat.py b/setuptools/py26compat.py new file mode 100644 index 00000000..6fc00883 --- /dev/null +++ b/setuptools/py26compat.py @@ -0,0 +1,19 @@ +""" +Compatibility Support for Python 2.6 and earlier +""" + +import sys + +from setuptools.compat import splittag + +def strip_fragment(url): + """ + In `Python 8280 `_, Python 2.7 and + later was patched to disregard the fragment when making URL requests. + Do the same for Python 2.6 and earlier. + """ + url, fragment = splittag(url) + return url + +if sys.version_info < (2,7): + strip_fragment = lambda x: x -- cgit v1.2.1 From ca2798727269cd4433ae355ef64a7cffd3807aaf Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:36:06 -0400 Subject: Update changelog --- CHANGES.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index b0d0da3e..cb300d47 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,13 @@ CHANGES ======= +----- +1.1.2 +----- + +* Issue #69: Correct issue where 404 errors are returned for URLs with + fragments in them (such as #egg=). + ----- 1.1.1 ----- -- cgit v1.2.1 From eb61edf878f2c22cf88209bc241f46c37c684d69 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:37:04 -0400 Subject: Added tag 1.1.2 for changeset 462fe5ccd8be --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 040273df..5f99eb58 100644 --- a/.hgtags +++ b/.hgtags @@ -95,3 +95,4 @@ aba16323ec9382da7bc77c633990ccb3bd58d050 1.0b2 c385fdf1f976fb1d2a6accc9292d8eca419180fa 1.0 d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 2e42e86546100c9f6845b04eb31b75c5add05f78 1.1.1 +462fe5ccd8befeb2a235e8295d6d73eb3a49cc78 1.1.2 -- cgit v1.2.1 From 4c466d70b1625083222056be277b575e0446f185 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:37:25 -0400 Subject: Bumped to 1.1.3 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 84 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 10 ++--- setuptools/version.py | 2 +- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 62bcd0a7..01fcb9d2 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1.2" +DEFAULT_VERSION = "1.1.3" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index 73898c72..6edb7741 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ [distutils.setup_keywords] -test_loader = setuptools.dist:check_importable -convert_2to3_doctests = setuptools.dist:assert_string_list -namespace_packages = setuptools.dist:check_nsp -packages = setuptools.dist:check_packages -test_suite = setuptools.dist:check_test_suite -eager_resources = setuptools.dist:assert_string_list -include_package_data = setuptools.dist:assert_bool -zip_safe = setuptools.dist:assert_bool use_2to3_exclude_fixers = setuptools.dist:assert_string_list extras_require = setuptools.dist:check_extras -entry_points = setuptools.dist:check_entry_points +install_requires = setuptools.dist:check_requirements +dependency_links = setuptools.dist:assert_string_list use_2to3 = setuptools.dist:assert_bool +eager_resources = setuptools.dist:assert_string_list +zip_safe = setuptools.dist:assert_bool +include_package_data = setuptools.dist:assert_bool +test_suite = setuptools.dist:check_test_suite +namespace_packages = setuptools.dist:check_nsp tests_require = setuptools.dist:check_requirements +test_loader = setuptools.dist:check_importable +convert_2to3_doctests = setuptools.dist:assert_string_list +entry_points = setuptools.dist:check_entry_points package_data = setuptools.dist:check_package_data -install_requires = setuptools.dist:check_requirements +packages = setuptools.dist:check_packages exclude_package_data = setuptools.dist:check_package_data -dependency_links = setuptools.dist:assert_string_list use_2to3_fixers = setuptools.dist:assert_string_list +[egg_info.writers] +requires.txt = setuptools.command.egg_info:write_requirements +eager_resources.txt = setuptools.command.egg_info:overwrite_arg +top_level.txt = setuptools.command.egg_info:write_toplevel_names +entry_points.txt = setuptools.command.egg_info:write_entries +namespace_packages.txt = setuptools.command.egg_info:overwrite_arg +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +depends.txt = setuptools.command.egg_info:warn_depends_obsolete +PKG-INFO = setuptools.command.egg_info:write_pkg_info + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + [distutils.commands] -upload_docs = setuptools.command.upload_docs:upload_docs -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +sdist = setuptools.command.sdist:sdist +rotate = setuptools.command.rotate:rotate +test = setuptools.command.test:test +alias = setuptools.command.alias:alias build_py = setuptools.command.build_py:build_py -develop = setuptools.command.develop:develop -install_lib = setuptools.command.install_lib:install_lib build_ext = setuptools.command.build_ext:build_ext +install_lib = setuptools.command.install_lib:install_lib +saveopts = setuptools.command.saveopts:saveopts +easy_install = setuptools.command.easy_install:easy_install +register = setuptools.command.register:register bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -rotate = setuptools.command.rotate:rotate +install = setuptools.command.install:install +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +develop = setuptools.command.develop:develop +install_scripts = setuptools.command.install_scripts:install_scripts +egg_info = setuptools.command.egg_info:egg_info install_egg_info = setuptools.command.install_egg_info:install_egg_info setopt = setuptools.command.setopt:setopt -saveopts = setuptools.command.saveopts:saveopts -install_scripts = setuptools.command.install_scripts:install_scripts -install = setuptools.command.install:install -test = setuptools.command.test:test -register = setuptools.command.register:register -easy_install = setuptools.command.easy_install:easy_install -alias = setuptools.command.alias:alias -sdist = setuptools.command.sdist:sdist +upload_docs = setuptools.command.upload_docs:upload_docs bdist_egg = setuptools.command.bdist_egg:bdist_egg -egg_info = setuptools.command.egg_info:egg_info - -[console_scripts] -easy_install-3.3 = setuptools.command.easy_install:main -easy_install = setuptools.command.easy_install:main - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - -[egg_info.writers] -entry_points.txt = setuptools.command.egg_info:write_entries -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -PKG-INFO = setuptools.command.egg_info:write_pkg_info -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -requires.txt = setuptools.command.egg_info:write_requirements -top_level.txt = setuptools.command.egg_info:write_toplevel_names -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -eager_resources.txt = setuptools.command.egg_info:overwrite_arg [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main + diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index e7f0f3b8..e4fb4954 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ +[ssl:sys_platform=='win32' and python_version=='2.4'] +ctypes==1.0.2 + [ssl:sys_platform=='win32'] wincertstore==0.1 -[ssl:python_version in '2.4, 2.5'] -ssl==1.16 - [certs] certifi==0.0.8 -[ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 \ No newline at end of file +[ssl:python_version in '2.4, 2.5'] +ssl==1.16 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index 7b344eca..7bb021e2 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1.2' +__version__ = '1.1.3' -- cgit v1.2.1 From 559c85e2d4093e5a3163b7fe01cbb2f0180c9141 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:39:47 -0400 Subject: Add the import, omitted from the previous commit. --- CHANGES.txt | 6 ++++++ setuptools/package_index.py | 1 + 2 files changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index cb300d47..633e8d5f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,12 @@ CHANGES ======= +----- +1.1.3 +----- + +* Fix NameError in previous patch. + ----- 1.1.2 ----- diff --git a/setuptools/package_index.py b/setuptools/package_index.py index a6672c70..4c9e40a7 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -22,6 +22,7 @@ from setuptools.compat import filterfalse from fnmatch import translate from setuptools.py24compat import hashlib from setuptools.py24compat import wraps +from setuptools.py26compat import strip_fragment from setuptools.py27compat import get_all_headers EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.]+)$') -- cgit v1.2.1 From ad24b4aa2be03dd3dcd509c13171aefafb5e3008 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:40:03 -0400 Subject: Added tag 1.1.3 for changeset ddf3561d6a54 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5f99eb58..800a5e40 100644 --- a/.hgtags +++ b/.hgtags @@ -96,3 +96,4 @@ c385fdf1f976fb1d2a6accc9292d8eca419180fa 1.0 d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 2e42e86546100c9f6845b04eb31b75c5add05f78 1.1.1 462fe5ccd8befeb2a235e8295d6d73eb3a49cc78 1.1.2 +ddf3561d6a54087745f4bf6ea2048b86195d6fe2 1.1.3 -- cgit v1.2.1 From 6e15af98b61f4e12c25719ee2535fac722616c68 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Sep 2013 09:40:24 -0400 Subject: Bumped to 1.1.4 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 96 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 8 +-- setuptools/version.py | 2 +- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 01fcb9d2..79713bd8 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1.3" +DEFAULT_VERSION = "1.1.4" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index 6edb7741..d6b54060 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[distutils.setup_keywords] -use_2to3_exclude_fixers = setuptools.dist:assert_string_list -extras_require = setuptools.dist:check_extras -install_requires = setuptools.dist:check_requirements -dependency_links = setuptools.dist:assert_string_list -use_2to3 = setuptools.dist:assert_bool -eager_resources = setuptools.dist:assert_string_list -zip_safe = setuptools.dist:assert_bool -include_package_data = setuptools.dist:assert_bool -test_suite = setuptools.dist:check_test_suite -namespace_packages = setuptools.dist:check_nsp -tests_require = setuptools.dist:check_requirements -test_loader = setuptools.dist:check_importable -convert_2to3_doctests = setuptools.dist:assert_string_list -entry_points = setuptools.dist:check_entry_points -package_data = setuptools.dist:check_package_data -packages = setuptools.dist:check_packages -exclude_package_data = setuptools.dist:check_package_data -use_2to3_fixers = setuptools.dist:assert_string_list - -[egg_info.writers] -requires.txt = setuptools.command.egg_info:write_requirements -eager_resources.txt = setuptools.command.egg_info:overwrite_arg -top_level.txt = setuptools.command.egg_info:write_toplevel_names -entry_points.txt = setuptools.command.egg_info:write_entries -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -PKG-INFO = setuptools.command.egg_info:write_pkg_info - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap +[console_scripts] +easy_install-3.3 = setuptools.command.easy_install:main +easy_install = setuptools.command.easy_install:main [distutils.commands] -sdist = setuptools.command.sdist:sdist -rotate = setuptools.command.rotate:rotate -test = setuptools.command.test:test -alias = setuptools.command.alias:alias -build_py = setuptools.command.build_py:build_py -build_ext = setuptools.command.build_ext:build_ext -install_lib = setuptools.command.install_lib:install_lib -saveopts = setuptools.command.saveopts:saveopts -easy_install = setuptools.command.easy_install:easy_install register = setuptools.command.register:register -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -install = setuptools.command.install:install -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +install_lib = setuptools.command.install_lib:install_lib +build_ext = setuptools.command.build_ext:build_ext develop = setuptools.command.develop:develop install_scripts = setuptools.command.install_scripts:install_scripts -egg_info = setuptools.command.egg_info:egg_info +build_py = setuptools.command.build_py:build_py install_egg_info = setuptools.command.install_egg_info:install_egg_info +egg_info = setuptools.command.egg_info:egg_info +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +alias = setuptools.command.alias:alias +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +easy_install = setuptools.command.easy_install:easy_install +test = setuptools.command.test:test +install = setuptools.command.install:install setopt = setuptools.command.setopt:setopt upload_docs = setuptools.command.upload_docs:upload_docs bdist_egg = setuptools.command.bdist_egg:bdist_egg +rotate = setuptools.command.rotate:rotate +sdist = setuptools.command.sdist:sdist +saveopts = setuptools.command.saveopts:saveopts + +[distutils.setup_keywords] +test_suite = setuptools.dist:check_test_suite +packages = setuptools.dist:check_packages +use_2to3_fixers = setuptools.dist:assert_string_list +convert_2to3_doctests = setuptools.dist:assert_string_list +tests_require = setuptools.dist:check_requirements +test_loader = setuptools.dist:check_importable +extras_require = setuptools.dist:check_extras +zip_safe = setuptools.dist:assert_bool +exclude_package_data = setuptools.dist:check_package_data +eager_resources = setuptools.dist:assert_string_list +include_package_data = setuptools.dist:assert_bool +package_data = setuptools.dist:check_package_data +use_2to3_exclude_fixers = setuptools.dist:assert_string_list +namespace_packages = setuptools.dist:check_nsp +use_2to3 = setuptools.dist:assert_bool +entry_points = setuptools.dist:check_entry_points +dependency_links = setuptools.dist:assert_string_list +install_requires = setuptools.dist:check_requirements [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + +[egg_info.writers] +PKG-INFO = setuptools.command.egg_info:write_pkg_info +requires.txt = setuptools.command.egg_info:write_requirements +depends.txt = setuptools.command.egg_info:warn_depends_obsolete +namespace_packages.txt = setuptools.command.egg_info:overwrite_arg +eager_resources.txt = setuptools.command.egg_info:overwrite_arg +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +top_level.txt = setuptools.command.egg_info:write_toplevel_names +entry_points.txt = setuptools.command.egg_info:write_entries diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index e4fb4954..0b577c97 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -3,11 +3,11 @@ [ssl:sys_platform=='win32' and python_version=='2.4'] ctypes==1.0.2 -[ssl:sys_platform=='win32'] -wincertstore==0.1 +[ssl:python_version in '2.4, 2.5'] +ssl==1.16 [certs] certifi==0.0.8 -[ssl:python_version in '2.4, 2.5'] -ssl==1.16 \ No newline at end of file +[ssl:sys_platform=='win32'] +wincertstore==0.1 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index 7bb021e2..bc50bee6 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1.3' +__version__ = '1.1.4' -- cgit v1.2.1 From 3117a6c743787dc2d409d4c34934d3bcc8f27206 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Sep 2013 17:10:09 -0400 Subject: Fix boolean test, incorrectly changed. Off-by-one errors are particularly ugly with booleans ;) Fixes #77 --- setuptools/command/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py index 93da7a39..575e121e 100755 --- a/setuptools/command/upload.py +++ b/setuptools/command/upload.py @@ -122,7 +122,7 @@ class upload(Command): body = StringIO.StringIO() for key, value in data.items(): # handle multiple entries for the same name - if isinstance(value, list): + if not isinstance(value, list): value = [value] for value in value: if type(value) is tuple: -- cgit v1.2.1 From 8aa2f12d9167bb0dadde5049420d980d18d07d7e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Sep 2013 17:18:08 -0400 Subject: Added tag 1.1.4 for changeset f94c7e4fa030 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 800a5e40..be682de6 100644 --- a/.hgtags +++ b/.hgtags @@ -97,3 +97,4 @@ d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 2e42e86546100c9f6845b04eb31b75c5add05f78 1.1.1 462fe5ccd8befeb2a235e8295d6d73eb3a49cc78 1.1.2 ddf3561d6a54087745f4bf6ea2048b86195d6fe2 1.1.3 +f94c7e4fa03077e069c1c3cef93ead735559e706 1.1.4 -- cgit v1.2.1 From a0645ece948f89821606db290c511cc391804472 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Sep 2013 17:18:31 -0400 Subject: Bumped to 1.1.5 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 68 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 14 ++++---- setuptools/version.py | 2 +- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 79713bd8..4118de3b 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1.4" +DEFAULT_VERSION = "1.1.5" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index d6b54060..139acb1d 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,48 +1,48 @@ -[console_scripts] -easy_install-3.3 = setuptools.command.easy_install:main -easy_install = setuptools.command.easy_install:main - [distutils.commands] +rotate = setuptools.command.rotate:rotate +build_py = setuptools.command.build_py:build_py +sdist = setuptools.command.sdist:sdist +bdist_egg = setuptools.command.bdist_egg:bdist_egg +install = setuptools.command.install:install register = setuptools.command.register:register -install_lib = setuptools.command.install_lib:install_lib -build_ext = setuptools.command.build_ext:build_ext -develop = setuptools.command.develop:develop +saveopts = setuptools.command.saveopts:saveopts install_scripts = setuptools.command.install_scripts:install_scripts -build_py = setuptools.command.build_py:build_py -install_egg_info = setuptools.command.install_egg_info:install_egg_info -egg_info = setuptools.command.egg_info:egg_info -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm alias = setuptools.command.alias:alias bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst easy_install = setuptools.command.easy_install:easy_install -test = setuptools.command.test:test -install = setuptools.command.install:install +egg_info = setuptools.command.egg_info:egg_info setopt = setuptools.command.setopt:setopt upload_docs = setuptools.command.upload_docs:upload_docs -bdist_egg = setuptools.command.bdist_egg:bdist_egg -rotate = setuptools.command.rotate:rotate -sdist = setuptools.command.sdist:sdist -saveopts = setuptools.command.saveopts:saveopts +install_lib = setuptools.command.install_lib:install_lib +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm +install_egg_info = setuptools.command.install_egg_info:install_egg_info +test = setuptools.command.test:test +build_ext = setuptools.command.build_ext:build_ext +develop = setuptools.command.develop:develop + +[console_scripts] +easy_install-3.3 = setuptools.command.easy_install:main +easy_install = setuptools.command.easy_install:main [distutils.setup_keywords] -test_suite = setuptools.dist:check_test_suite -packages = setuptools.dist:check_packages +entry_points = setuptools.dist:check_entry_points +use_2to3_exclude_fixers = setuptools.dist:assert_string_list +package_data = setuptools.dist:check_package_data use_2to3_fixers = setuptools.dist:assert_string_list -convert_2to3_doctests = setuptools.dist:assert_string_list -tests_require = setuptools.dist:check_requirements +install_requires = setuptools.dist:check_requirements +test_suite = setuptools.dist:check_test_suite test_loader = setuptools.dist:check_importable -extras_require = setuptools.dist:check_extras +use_2to3 = setuptools.dist:assert_bool +convert_2to3_doctests = setuptools.dist:assert_string_list zip_safe = setuptools.dist:assert_bool -exclude_package_data = setuptools.dist:check_package_data +tests_require = setuptools.dist:check_requirements eager_resources = setuptools.dist:assert_string_list -include_package_data = setuptools.dist:assert_bool -package_data = setuptools.dist:check_package_data -use_2to3_exclude_fixers = setuptools.dist:assert_string_list +exclude_package_data = setuptools.dist:check_package_data namespace_packages = setuptools.dist:check_nsp -use_2to3 = setuptools.dist:assert_bool -entry_points = setuptools.dist:check_entry_points +include_package_data = setuptools.dist:assert_bool +extras_require = setuptools.dist:check_extras dependency_links = setuptools.dist:assert_string_list -install_requires = setuptools.dist:check_requirements +packages = setuptools.dist:check_packages [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl @@ -51,12 +51,12 @@ svn_cvs = setuptools.command.sdist:_default_revctrl eggsecutable = setuptools.command.easy_install:bootstrap [egg_info.writers] -PKG-INFO = setuptools.command.egg_info:write_pkg_info -requires.txt = setuptools.command.egg_info:write_requirements -depends.txt = setuptools.command.egg_info:warn_depends_obsolete namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -eager_resources.txt = setuptools.command.egg_info:overwrite_arg -dependency_links.txt = setuptools.command.egg_info:overwrite_arg +requires.txt = setuptools.command.egg_info:write_requirements top_level.txt = setuptools.command.egg_info:write_toplevel_names +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +depends.txt = setuptools.command.egg_info:warn_depends_obsolete +PKG-INFO = setuptools.command.egg_info:write_pkg_info entry_points.txt = setuptools.command.egg_info:write_entries +eager_resources.txt = setuptools.command.egg_info:overwrite_arg diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 0b577c97..256342f0 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ -[ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 - -[ssl:python_version in '2.4, 2.5'] -ssl==1.16 +[ssl:sys_platform=='win32'] +wincertstore==0.1 [certs] certifi==0.0.8 -[ssl:sys_platform=='win32'] -wincertstore==0.1 \ No newline at end of file +[ssl:sys_platform=='win32' and python_version=='2.4'] +ctypes==1.0.2 + +[ssl:python_version in '2.4, 2.5'] +ssl==1.16 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index bc50bee6..99d2a6fa 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1.4' +__version__ = '1.1.5' -- cgit v1.2.1 From 61aacdd173df9aaf20698769b1715bfcc6b5e416 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 9 Sep 2013 15:19:34 -0400 Subject: Reorganize imports --- setuptools/command/sdist.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index 39cd6043..a7ce7ac0 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -1,9 +1,12 @@ +import os +import re +import sys +from glob import glob + +import pkg_resources from distutils.command.sdist import sdist as _sdist from distutils.util import convert_path from distutils import log -from glob import glob -import os, re, sys, pkg_resources -from glob import glob READMES = ('README', 'README.rst', 'README.txt') @@ -98,13 +101,13 @@ def entries_finder(dirname, filename): except: pass if svnver<8: log.warn("unrecognized .svn/entries format in %s", os.path.abspath(dirname)) - return + return for record in map(str.splitlines, data.split('\n\x0c\n')[1:]): # subversion 1.6/1.5/1.4 if not record or len(record)>=6 and record[5]=="delete": continue # skip deleted yield joinpath(dirname, record[0]) - + finders = [ (convert_path('CVS/Entries'), -- cgit v1.2.1 From 2b6a00de2632bd044a260c86aec9e29083b2adf1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 9 Sep 2013 15:21:41 -0400 Subject: Remove excess whitespace. Delint one if statement. --- setuptools/command/sdist.py | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index a7ce7ac0..6d63e819 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -37,14 +37,6 @@ def joinpath(prefix,suffix): return suffix return os.path.join(prefix,suffix) - - - - - - - - def walk_revctrl(dirname=''): """Find all files under revision control""" for ep in pkg_resources.iter_entry_points('setuptools.file_finders'): @@ -118,16 +110,6 @@ finders = [ ] - - - - - - - - - - class sdist(_sdist): """Smart sdist that finds anything supported by revision control""" @@ -182,11 +164,12 @@ class sdist(_sdist): # Beginning with Python 2.7.2, 3.1.4, and 3.2.1, this leaky file handle # has been fixed, so only override the method if we're using an earlier # Python. - if ( - sys.version_info < (2,7,2) - or (3,0) <= sys.version_info < (3,1,4) - or (3,2) <= sys.version_info < (3,2,1) - ): + has_leaky_handle = ( + sys.version_info < (2,7,2) + or (3,0) <= sys.version_info < (3,1,4) + or (3,2) <= sys.version_info < (3,2,1) + ) + if has_leaky_handle: read_template = __read_template_hack def add_defaults(self): @@ -251,7 +234,6 @@ class sdist(_sdist): "standard file not found: should have one of " +', '.join(READMES) ) - def make_release_tree(self, base_dir, files): _sdist.make_release_tree(self, base_dir, files) @@ -298,10 +280,3 @@ class sdist(_sdist): continue self.filelist.append(line) manifest.close() - - - - - - -# -- cgit v1.2.1 From 60f74823070a2c4154d20ac8a87fd15cca6bb9a3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 12 Sep 2013 09:44:06 -0400 Subject: Correct boolean logic in fix for #69 --- setuptools/py26compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/py26compat.py b/setuptools/py26compat.py index 6fc00883..738b0cc4 100644 --- a/setuptools/py26compat.py +++ b/setuptools/py26compat.py @@ -15,5 +15,5 @@ def strip_fragment(url): url, fragment = splittag(url) return url -if sys.version_info < (2,7): +if sys.version_info >= (2,7): strip_fragment = lambda x: x -- cgit v1.2.1 From a0c75a6cbda55a2b1ae1ab650491eacb3eb4a385 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 12 Sep 2013 09:45:03 -0400 Subject: Update changelog --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 634edd4e..de8285a2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,12 @@ CHANGES ======= +----- +1.1.5 +----- + +* Issue #69: Second attempt at fix (logic was reversed). + ----- 1.1.4 ----- -- cgit v1.2.1 From f9dc7c3a2b1360c0c0d85c3a2fc88701175e8d04 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 12 Sep 2013 09:59:38 -0400 Subject: Added tag 1.1.5 for changeset d9bb58331007 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index be682de6..50bb2d50 100644 --- a/.hgtags +++ b/.hgtags @@ -98,3 +98,4 @@ d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 462fe5ccd8befeb2a235e8295d6d73eb3a49cc78 1.1.2 ddf3561d6a54087745f4bf6ea2048b86195d6fe2 1.1.3 f94c7e4fa03077e069c1c3cef93ead735559e706 1.1.4 +d9bb58331007ee3f69d31983a180f56b15c731c3 1.1.5 -- cgit v1.2.1 From 2b3d8ead29f777fe3e1c6d26c7d110cbc554c721 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 12 Sep 2013 09:59:59 -0400 Subject: Bumped to 1.1.6 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 76 ++++++++++++++++++------------------ setuptools.egg-info/requires.txt | 8 ++-- setuptools/version.py | 2 +- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 4118de3b..b02f3f17 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1.5" +DEFAULT_VERSION = "1.1.6" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index 139acb1d..4acc9af4 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + [distutils.commands] +alias = setuptools.command.alias:alias +build_ext = setuptools.command.build_ext:build_ext +test = setuptools.command.test:test rotate = setuptools.command.rotate:rotate -build_py = setuptools.command.build_py:build_py -sdist = setuptools.command.sdist:sdist -bdist_egg = setuptools.command.bdist_egg:bdist_egg -install = setuptools.command.install:install -register = setuptools.command.register:register -saveopts = setuptools.command.saveopts:saveopts install_scripts = setuptools.command.install_scripts:install_scripts -alias = setuptools.command.alias:alias +saveopts = setuptools.command.saveopts:saveopts bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -easy_install = setuptools.command.easy_install:easy_install +bdist_egg = setuptools.command.bdist_egg:bdist_egg +install_egg_info = setuptools.command.install_egg_info:install_egg_info egg_info = setuptools.command.egg_info:egg_info -setopt = setuptools.command.setopt:setopt -upload_docs = setuptools.command.upload_docs:upload_docs -install_lib = setuptools.command.install_lib:install_lib bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -install_egg_info = setuptools.command.install_egg_info:install_egg_info -test = setuptools.command.test:test -build_ext = setuptools.command.build_ext:build_ext +upload_docs = setuptools.command.upload_docs:upload_docs +easy_install = setuptools.command.easy_install:easy_install +install = setuptools.command.install:install +register = setuptools.command.register:register develop = setuptools.command.develop:develop +install_lib = setuptools.command.install_lib:install_lib +build_py = setuptools.command.build_py:build_py +setopt = setuptools.command.setopt:setopt +sdist = setuptools.command.sdist:sdist -[console_scripts] -easy_install-3.3 = setuptools.command.easy_install:main -easy_install = setuptools.command.easy_install:main +[setuptools.file_finders] +svn_cvs = setuptools.command.sdist:_default_revctrl [distutils.setup_keywords] +eager_resources = setuptools.dist:assert_string_list +include_package_data = setuptools.dist:assert_bool +use_2to3_fixers = setuptools.dist:assert_string_list +extras_require = setuptools.dist:check_extras +namespace_packages = setuptools.dist:check_nsp +use_2to3 = setuptools.dist:assert_bool +zip_safe = setuptools.dist:assert_bool entry_points = setuptools.dist:check_entry_points use_2to3_exclude_fixers = setuptools.dist:assert_string_list package_data = setuptools.dist:check_package_data -use_2to3_fixers = setuptools.dist:assert_string_list +exclude_package_data = setuptools.dist:check_package_data install_requires = setuptools.dist:check_requirements -test_suite = setuptools.dist:check_test_suite test_loader = setuptools.dist:check_importable -use_2to3 = setuptools.dist:assert_bool -convert_2to3_doctests = setuptools.dist:assert_string_list -zip_safe = setuptools.dist:assert_bool -tests_require = setuptools.dist:check_requirements -eager_resources = setuptools.dist:assert_string_list -exclude_package_data = setuptools.dist:check_package_data -namespace_packages = setuptools.dist:check_nsp -include_package_data = setuptools.dist:assert_bool -extras_require = setuptools.dist:check_extras dependency_links = setuptools.dist:assert_string_list +tests_require = setuptools.dist:check_requirements packages = setuptools.dist:check_packages - -[setuptools.file_finders] -svn_cvs = setuptools.command.sdist:_default_revctrl - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap +convert_2to3_doctests = setuptools.dist:assert_string_list +test_suite = setuptools.dist:check_test_suite [egg_info.writers] +dependency_links.txt = setuptools.command.egg_info:overwrite_arg namespace_packages.txt = setuptools.command.egg_info:overwrite_arg requires.txt = setuptools.command.egg_info:write_requirements -top_level.txt = setuptools.command.egg_info:write_toplevel_names -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -depends.txt = setuptools.command.egg_info:warn_depends_obsolete -PKG-INFO = setuptools.command.egg_info:write_pkg_info entry_points.txt = setuptools.command.egg_info:write_entries +top_level.txt = setuptools.command.egg_info:write_toplevel_names eager_resources.txt = setuptools.command.egg_info:overwrite_arg +PKG-INFO = setuptools.command.egg_info:write_pkg_info +depends.txt = setuptools.command.egg_info:warn_depends_obsolete diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index 256342f0..e8e2105d 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,5 +1,8 @@ +[ssl:python_version in '2.4, 2.5'] +ssl==1.16 + [ssl:sys_platform=='win32'] wincertstore==0.1 @@ -7,7 +10,4 @@ wincertstore==0.1 certifi==0.0.8 [ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 - -[ssl:python_version in '2.4, 2.5'] -ssl==1.16 \ No newline at end of file +ctypes==1.0.2 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index 99d2a6fa..6ebd335c 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1.5' +__version__ = '1.1.6' -- cgit v1.2.1 From 115bb41b011e5dd064fdc5a74aa7d5f71cdbe37d Mon Sep 17 00:00:00 2001 From: "Suresh V." Date: Tue, 17 Sep 2013 12:32:02 +0530 Subject: Don't leave junk file behind --- ez_setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ez_setup.py b/ez_setup.py index b02f3f17..03458b70 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -200,7 +200,11 @@ download_file_curl.viable = has_curl def download_file_wget(url, target): cmd = ['wget', url, '--quiet', '--output-document', target] - subprocess.check_call(cmd) + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError: + os.unlink(target) + raise def has_wget(): cmd = ['wget', '--version'] -- cgit v1.2.1 From 9e4208becb775a69014c2e02b6a10f899efde1e7 Mon Sep 17 00:00:00 2001 From: Suresh V Date: Tue, 17 Sep 2013 23:14:42 +0530 Subject: implement for all downloaders and check file existence before removing --- ez_setup.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 03458b70..945f55d9 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -162,7 +162,12 @@ def download_file_powershell(url, target): '-Command', "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" % vars(), ] - subprocess.check_call(cmd) + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError: + if os.access(target, os.F_OK): + os.unlink(target) + raise def has_powershell(): if platform.system() != 'Windows': @@ -182,7 +187,12 @@ download_file_powershell.viable = has_powershell def download_file_curl(url, target): cmd = ['curl', url, '--silent', '--output', target] - subprocess.check_call(cmd) + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError: + if os.access(target, os.F_OK): + os.unlink(target) + raise def has_curl(): cmd = ['curl', '--version'] @@ -203,7 +213,8 @@ def download_file_wget(url, target): try: subprocess.check_call(cmd) except subprocess.CalledProcessError: - os.unlink(target) + if os.access(target, os.F_OK): + os.unlink(target) raise def has_wget(): -- cgit v1.2.1 From a7cac0e348ab9be0d56a390e87ea2ab74c69a12a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 18 Sep 2013 10:01:46 -0400 Subject: Adding test capturing Distribute #349 --HG-- extra : amend_source : 2f401317ae94e6291ae91f8da75173781bc4c48c --- setuptools/tests/script-with-bom.py | 3 +++ setuptools/tests/test_sandbox.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 setuptools/tests/script-with-bom.py diff --git a/setuptools/tests/script-with-bom.py b/setuptools/tests/script-with-bom.py new file mode 100644 index 00000000..22dee0d2 --- /dev/null +++ b/setuptools/tests/script-with-bom.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +result = 'passed' diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index 1609ee86..3dad1376 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -5,7 +5,10 @@ import os import shutil import unittest import tempfile +import types +import pkg_resources +import setuptools.sandbox from setuptools.sandbox import DirectorySandbox, SandboxViolation def has_win32com(): @@ -62,5 +65,15 @@ class TestSandbox(unittest.TestCase): finally: if os.path.exists(target): os.remove(target) + def test_setup_py_with_BOM(self): + """ + It should be possible to execute a setup.py with a Byte Order Mark + """ + target = pkg_resources.resource_filename(__name__, + 'script-with-bom.py') + namespace = types.ModuleType('namespace') + setuptools.sandbox.execfile(target, vars(namespace)) + assert namespace.result == 'passed' + if __name__ == '__main__': unittest.main() -- cgit v1.2.1 From 052e7b4453d950d11025107e9c98fa0be744d72f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 18 Sep 2013 10:10:08 -0400 Subject: execfile now opens target in binary mode for better compatibility. Fixes Distribute #349. --- CHANGES.txt | 7 +++++++ setuptools/compat.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index de8285a2..1b91a2c2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,13 @@ CHANGES ======= +----- +1.1.6 +----- + +* Distribute #349: ``sandbox.execfile`` now opens the target file in binary + mode, thus honoring a BOM in the file when compiled. + ----- 1.1.5 ----- diff --git a/setuptools/compat.py b/setuptools/compat.py index 860c39f3..529a5fbc 100644 --- a/setuptools/compat.py +++ b/setuptools/compat.py @@ -84,7 +84,7 @@ else: globs = globals() if locs is None: locs = globs - f = open(fn) + f = open(fn, 'rb') try: source = f.read() finally: -- cgit v1.2.1 From 376c4fad8ed418c0371ffdcdcc2bc5066a525421 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 18 Sep 2013 10:20:12 -0400 Subject: Added tag 1.1.6 for changeset 5e426bdeb46b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 50bb2d50..bd3b7d36 100644 --- a/.hgtags +++ b/.hgtags @@ -99,3 +99,4 @@ d943b67fe80dbd61326014e4acedfc488adfa1c9 1.1 ddf3561d6a54087745f4bf6ea2048b86195d6fe2 1.1.3 f94c7e4fa03077e069c1c3cef93ead735559e706 1.1.4 d9bb58331007ee3f69d31983a180f56b15c731c3 1.1.5 +5e426bdeb46b87e299422adc419f4163b6c78d13 1.1.6 -- cgit v1.2.1 From 0d7e10fd181ad260256be32cb86125211cf46be9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 18 Sep 2013 10:20:36 -0400 Subject: Bumped to 1.1.7 in preparation for next release. --- ez_setup.py | 2 +- setuptools.egg-info/entry_points.txt | 100 +++++++++++++++++------------------ setuptools.egg-info/requires.txt | 10 ++-- setuptools/version.py | 2 +- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index b02f3f17..9f2bd461 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.1.6" +DEFAULT_VERSION = "1.1.7" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools.egg-info/entry_points.txt b/setuptools.egg-info/entry_points.txt index 4acc9af4..4a09dd1c 100644 --- a/setuptools.egg-info/entry_points.txt +++ b/setuptools.egg-info/entry_points.txt @@ -1,62 +1,62 @@ -[console_scripts] -easy_install = setuptools.command.easy_install:main -easy_install-3.3 = setuptools.command.easy_install:main - -[setuptools.installation] -eggsecutable = setuptools.command.easy_install:bootstrap - -[distutils.commands] -alias = setuptools.command.alias:alias -build_ext = setuptools.command.build_ext:build_ext -test = setuptools.command.test:test -rotate = setuptools.command.rotate:rotate -install_scripts = setuptools.command.install_scripts:install_scripts -saveopts = setuptools.command.saveopts:saveopts -bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst -bdist_egg = setuptools.command.bdist_egg:bdist_egg -install_egg_info = setuptools.command.install_egg_info:install_egg_info -egg_info = setuptools.command.egg_info:egg_info -bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm -upload_docs = setuptools.command.upload_docs:upload_docs -easy_install = setuptools.command.easy_install:easy_install -install = setuptools.command.install:install -register = setuptools.command.register:register -develop = setuptools.command.develop:develop -install_lib = setuptools.command.install_lib:install_lib -build_py = setuptools.command.build_py:build_py -setopt = setuptools.command.setopt:setopt -sdist = setuptools.command.sdist:sdist - -[setuptools.file_finders] -svn_cvs = setuptools.command.sdist:_default_revctrl - [distutils.setup_keywords] +packages = setuptools.dist:check_packages +install_requires = setuptools.dist:check_requirements eager_resources = setuptools.dist:assert_string_list include_package_data = setuptools.dist:assert_bool -use_2to3_fixers = setuptools.dist:assert_string_list -extras_require = setuptools.dist:check_extras -namespace_packages = setuptools.dist:check_nsp -use_2to3 = setuptools.dist:assert_bool -zip_safe = setuptools.dist:assert_bool -entry_points = setuptools.dist:check_entry_points -use_2to3_exclude_fixers = setuptools.dist:assert_string_list +convert_2to3_doctests = setuptools.dist:assert_string_list package_data = setuptools.dist:check_package_data +use_2to3_exclude_fixers = setuptools.dist:assert_string_list +test_suite = setuptools.dist:check_test_suite +tests_require = setuptools.dist:check_requirements +use_2to3 = setuptools.dist:assert_bool exclude_package_data = setuptools.dist:check_package_data -install_requires = setuptools.dist:check_requirements test_loader = setuptools.dist:check_importable +extras_require = setuptools.dist:check_extras +use_2to3_fixers = setuptools.dist:assert_string_list +namespace_packages = setuptools.dist:check_nsp +zip_safe = setuptools.dist:assert_bool dependency_links = setuptools.dist:assert_string_list -tests_require = setuptools.dist:check_requirements -packages = setuptools.dist:check_packages -convert_2to3_doctests = setuptools.dist:assert_string_list -test_suite = setuptools.dist:check_test_suite +entry_points = setuptools.dist:check_entry_points + +[setuptools.file_finders] +svn_cvs = setuptools.command.sdist:_default_revctrl [egg_info.writers] -dependency_links.txt = setuptools.command.egg_info:overwrite_arg -namespace_packages.txt = setuptools.command.egg_info:overwrite_arg -requires.txt = setuptools.command.egg_info:write_requirements -entry_points.txt = setuptools.command.egg_info:write_entries +depends.txt = setuptools.command.egg_info:warn_depends_obsolete top_level.txt = setuptools.command.egg_info:write_toplevel_names -eager_resources.txt = setuptools.command.egg_info:overwrite_arg +entry_points.txt = setuptools.command.egg_info:write_entries +requires.txt = setuptools.command.egg_info:write_requirements PKG-INFO = setuptools.command.egg_info:write_pkg_info -depends.txt = setuptools.command.egg_info:warn_depends_obsolete +eager_resources.txt = setuptools.command.egg_info:overwrite_arg +dependency_links.txt = setuptools.command.egg_info:overwrite_arg +namespace_packages.txt = setuptools.command.egg_info:overwrite_arg + +[distutils.commands] +rotate = setuptools.command.rotate:rotate +bdist_egg = setuptools.command.bdist_egg:bdist_egg +install_scripts = setuptools.command.install_scripts:install_scripts +install_egg_info = setuptools.command.install_egg_info:install_egg_info +build_py = setuptools.command.build_py:build_py +build_ext = setuptools.command.build_ext:build_ext +install = setuptools.command.install:install +sdist = setuptools.command.sdist:sdist +upload_docs = setuptools.command.upload_docs:upload_docs +saveopts = setuptools.command.saveopts:saveopts +develop = setuptools.command.develop:develop +alias = setuptools.command.alias:alias +register = setuptools.command.register:register +setopt = setuptools.command.setopt:setopt +egg_info = setuptools.command.egg_info:egg_info +test = setuptools.command.test:test +easy_install = setuptools.command.easy_install:easy_install +install_lib = setuptools.command.install_lib:install_lib +bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst +bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm + +[setuptools.installation] +eggsecutable = setuptools.command.easy_install:bootstrap + +[console_scripts] +easy_install = setuptools.command.easy_install:main +easy_install-3.3 = setuptools.command.easy_install:main diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index e8e2105d..0b577c97 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,13 +1,13 @@ +[ssl:sys_platform=='win32' and python_version=='2.4'] +ctypes==1.0.2 + [ssl:python_version in '2.4, 2.5'] ssl==1.16 -[ssl:sys_platform=='win32'] -wincertstore==0.1 - [certs] certifi==0.0.8 -[ssl:sys_platform=='win32' and python_version=='2.4'] -ctypes==1.0.2 \ No newline at end of file +[ssl:sys_platform=='win32'] +wincertstore==0.1 \ No newline at end of file diff --git a/setuptools/version.py b/setuptools/version.py index 6ebd335c..9910ac22 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.1.6' +__version__ = '1.1.7' -- cgit v1.2.1 From 621f405d07fc9f3509a186c7650c6752b0436e01 Mon Sep 17 00:00:00 2001 From: Niklas Rigemo Date: Thu, 19 Sep 2013 12:48:10 +0200 Subject: PEP8: Corrected multiple statements on one line (semicolon) --HG-- branch : patch1 --- setuptools/script template (dev).py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/script template (dev).py b/setuptools/script template (dev).py index 901790e7..1069cb0e 100644 --- a/setuptools/script template (dev).py +++ b/setuptools/script template (dev).py @@ -1,6 +1,7 @@ # EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r __requires__ = """%(spec)r""" -from pkg_resources import require; require("""%(spec)r""") +from pkg_resources import require +require("""%(spec)r""") del require __file__ = """%(dev_path)r""" try: -- cgit v1.2.1 From 1ed46282652e83edc8b88f64a279aacee182553d Mon Sep 17 00:00:00 2001 From: Niklas Rigemo Date: Thu, 19 Sep 2013 12:55:55 +0200 Subject: Bug Correction: Avoid double execution when the application throws NameError exception. --HG-- branch : patch1 --- setuptools/script template (dev).py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setuptools/script template (dev).py b/setuptools/script template (dev).py index 1069cb0e..b3fe209e 100644 --- a/setuptools/script template (dev).py +++ b/setuptools/script template (dev).py @@ -1,10 +1,11 @@ # EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r __requires__ = """%(spec)r""" +import sys from pkg_resources import require require("""%(spec)r""") del require __file__ = """%(dev_path)r""" -try: +if sys.version_info < (3, 0): execfile(__file__) -except NameError: +else: exec(compile(open(__file__).read(), __file__, 'exec')) -- cgit v1.2.1 From ce3c43cbd5e2c08ec63e6765fca8c590dd4df2b4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 23 Sep 2013 21:29:03 -0400 Subject: extract _clean_check call --- ez_setup.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index 16b8016d..c3069e7a 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -151,6 +151,18 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, return _do_download(version, download_base, to_dir, download_delay) +def _clean_check(cmd, target): + """ + Run the command to download target. If the command fails, clean up before + re-raising the error. + """ + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError: + if os.access(target, os.F_OK): + os.unlink(target) + raise + def download_file_powershell(url, target): """ Download the file at url to target using Powershell (which will validate @@ -162,12 +174,7 @@ def download_file_powershell(url, target): '-Command', "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" % vars(), ] - try: - subprocess.check_call(cmd) - except subprocess.CalledProcessError: - if os.access(target, os.F_OK): - os.unlink(target) - raise + _clean_check(cmd, target) def has_powershell(): if platform.system() != 'Windows': @@ -187,12 +194,7 @@ download_file_powershell.viable = has_powershell def download_file_curl(url, target): cmd = ['curl', url, '--silent', '--output', target] - try: - subprocess.check_call(cmd) - except subprocess.CalledProcessError: - if os.access(target, os.F_OK): - os.unlink(target) - raise + _clean_check(cmd, target) def has_curl(): cmd = ['curl', '--version'] @@ -210,12 +212,7 @@ download_file_curl.viable = has_curl def download_file_wget(url, target): cmd = ['wget', url, '--quiet', '--output-document', target] - try: - subprocess.check_call(cmd) - except subprocess.CalledProcessError: - if os.access(target, os.F_OK): - os.unlink(target) - raise + _clean_check(cmd, target) def has_wget(): cmd = ['wget', '--version'] -- cgit v1.2.1 From 49ce80613b7fcffd1882f7fb082e5bcc30e976f0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 23 Sep 2013 21:51:13 -0400 Subject: Update changelog --- CHANGES.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 1b91a2c2..f97dca3c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,15 @@ CHANGES ======= +----- +1.1.7 +----- + +* Fixed behavior of NameError handling in 'script template (dev).py' (script + launcher for 'develop' installs). +* ``ez_setup.py`` now ensures partial downloads are cleaned up following + a failed download. + ----- 1.1.6 ----- -- cgit v1.2.1