Commit d189e4d4 authored by Jason R. Coombs's avatar Jason R. Coombs

Merge with distribute 0.6.42

parents 2faf1e9a 62e96b0e
......@@ -52,3 +52,4 @@ d737b2039c5f92af8000f78bbc80b6a5183caa97 0.6.39
9b2e2aa06e058c63e06c5e42a7f279ddae2dfb7d 0.7b1
0a783fa0dceb95b5fc743e47c2d89c1523d0afb7 0.6.40
ad107e9b4beea24516ac4e1e854696e586fe279d 0.6.41
f30167716b659f96c5e0b7ea3d5be2bcff8c0eac 0.6.42
......@@ -20,6 +20,14 @@ Added several features that were slated for setuptools 0.6c12:
* Added support for SSL certificate validation when installing packages from
an HTTPS service.
------
0.6.42
------
* External links finder no longer yields duplicate links.
* Issue #337: Moved site.py to setuptools/site-patch.py (graft of very old
patch from setuptools trunk which inspired PR #31).
------
0.6.41
------
......@@ -79,6 +87,7 @@ Added several features that were slated for setuptools 0.6c12:
0.6.35
------
Note this release is backward-incompatible with distribute 0.6.23-0.6.34 in
how it parses version numbers.
......
......@@ -8,6 +8,7 @@ Contributors
* Christophe Combelles
* Daniel Stutzbach
* Daniel Holth
* Dirley Rodrigues
* Grigory Petrov
* Hanno Schlichting
* Jannis Leidel
......
......@@ -132,20 +132,18 @@ dist = setup(
test_suite = 'setuptools.tests',
src_root = src_root,
packages = find_packages(),
package_data = {'setuptools':['*.exe'], 'setuptools.command':['*.xml']},
package_data = {'setuptools':['*.exe', 'site-patch.py'], 'setuptools.command':['*.xml']},
py_modules = ['pkg_resources', 'easy_install', 'site'],
py_modules = ['pkg_resources', 'easy_install'],
zip_safe = (sys.version>="2.5"), # <2.5 needs unzipped for -m to work
cmdclass = {'test': test},
entry_points = {
"distutils.commands" : [
"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals()
for cmd in SETUP_COMMANDS
],
"distutils.setup_keywords": [
"eager_resources = setuptools.dist:assert_string_list",
"namespace_packages = setuptools.dist:check_nsp",
......@@ -166,7 +164,6 @@ dist = setup(
"use_2to3_fixers = setuptools.dist:assert_string_list",
"use_2to3_exclude_fixers = setuptools.dist:assert_string_list",
],
"egg_info.writers": [
"PKG-INFO = setuptools.command.egg_info:write_pkg_info",
"requires.txt = setuptools.command.egg_info:write_requirements",
......@@ -177,7 +174,6 @@ dist = setup(
"depends.txt = setuptools.command.egg_info:warn_depends_obsolete",
"dependency_links.txt = setuptools.command.egg_info:overwrite_arg",
],
"console_scripts": console_scripts,
"setuptools.file_finders":
......
......@@ -1276,7 +1276,7 @@ Please make the appropriate changes for your system and try again.""" % (
return # already did it, or don't need to
sitepy = os.path.join(self.install_dir, "site.py")
source = resource_string(Requirement.parse("setuptools"), "site.py")
source = resource_string("setuptools", "site-patch.py")
current = ""
if os.path.exists(sitepy):
......
"""PyPI and direct package downloading"""
import sys, os.path, re, urlparse, urllib2, shutil, random, socket, cStringIO
import itertools
import base64
import httplib, urllib
from setuptools import ssl_support
......@@ -11,6 +12,8 @@ try:
except ImportError:
from md5 import md5
from fnmatch import translate
from .py24compat import wraps
EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.]+)$')
HREF = re.compile("""href\\s*=\\s*['"]?([^'"> ]+)""", re.I)
# this is here to fix emacs' cruddy broken syntax highlighting
......@@ -134,9 +137,38 @@ def interpret_distro_name(location, basename, metadata,
platform = platform
)
# From Python 2.7 docs
def unique_everseen(iterable, key=None):
"List unique elements, preserving order. Remember all elements ever seen."
# unique_everseen('AAAABBBCCDAABBB') --> A B C D
# unique_everseen('ABBCcAD', str.lower) --> A B C D
seen = set()
seen_add = seen.add
if key is None:
for element in itertools.ifilterfalse(seen.__contains__, iterable):
seen_add(element)
yield element
else:
for element in iterable:
k = key(element)
if k not in seen:
seen_add(k)
yield element
def unique_values(func):
"""
Wrap a function returning an iterable such that the resulting iterable
only ever yields unique items.
"""
@wraps(func)
def wrapper(*args, **kwargs):
return unique_everseen(func(*args, **kwargs))
return wrapper
REL = re.compile("""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I)
# this line is here to fix emacs' cruddy broken syntax highlighting
@unique_values
def find_external_links(url, page):
"""Find rel="homepage" and rel="download" links in `page`, yielding URLs"""
......
"""
Forward-compatibility support for Python 2.4 and earlier
"""
# from jaraco.compat 1.2
try:
from functools import wraps
except ImportError:
def wraps(func):
"Just return the function unwrapped"
return lambda x: x
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment