[cig-commits] r13241 - in vendor/setuptools/current: . setuptools setuptools/command setuptools/tests setuptools.egg-info
leif at geodynamics.org
leif at geodynamics.org
Mon Nov 3 18:34:46 PST 2008
Author: leif
Date: 2008-11-03 18:34:46 -0800 (Mon, 03 Nov 2008)
New Revision: 13241
Added:
vendor/setuptools/current/wikiup.cfg
Modified:
vendor/setuptools/current/EasyInstall.txt
vendor/setuptools/current/PKG-INFO
vendor/setuptools/current/README.txt
vendor/setuptools/current/ez_setup.py
vendor/setuptools/current/pkg_resources.py
vendor/setuptools/current/pkg_resources.txt
vendor/setuptools/current/release.sh
vendor/setuptools/current/setup.py
vendor/setuptools/current/setuptools.egg-info/PKG-INFO
vendor/setuptools/current/setuptools.egg-info/SOURCES.txt
vendor/setuptools/current/setuptools.txt
vendor/setuptools/current/setuptools/__init__.py
vendor/setuptools/current/setuptools/command/bdist_egg.py
vendor/setuptools/current/setuptools/command/bdist_wininst.py
vendor/setuptools/current/setuptools/command/build_ext.py
vendor/setuptools/current/setuptools/command/easy_install.py
vendor/setuptools/current/setuptools/command/egg_info.py
vendor/setuptools/current/setuptools/command/sdist.py
vendor/setuptools/current/setuptools/command/upload.py
vendor/setuptools/current/setuptools/depends.py
vendor/setuptools/current/setuptools/package_index.py
vendor/setuptools/current/setuptools/tests/__init__.py
vendor/setuptools/current/setuptools/tests/test_packageindex.py
vendor/setuptools/current/setuptools/tests/test_resources.py
vendor/setuptools/current/version.dat
Log:
Imported setuptools v0.6c9.
Modified: vendor/setuptools/current/EasyInstall.txt
===================================================================
--- vendor/setuptools/current/EasyInstall.txt 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/EasyInstall.txt 2008-11-04 02:34:46 UTC (rev 13241)
@@ -6,12 +6,13 @@
that lets you automatically download, build, install, and manage Python
packages.
-(Please share your experiences with us! Whether you encountered success or
-difficulty installing a particular package, please add your notes to the
-`Experience Reports <http://peak.telecommunity.com/DevCenter/PackageNotes>`_
-page. You'll need to register for a Wiki ID if you don't already have one; you
-can do that from the `User Preferences
-<http://peak.telecommunity.com/DevCenter/UserPreferences>`_ page. Thanks!)
+Please share your experiences with us! If you encounter difficulty installing
+a package, please contact us via the `distutils mailing list
+<http://mail.python.org/pipermail/distutils-sig/>`_. (Note: please DO NOT send
+private email directly to the author of setuptools; it will be discarded. The
+mailing list is a searchable archive of previously-asked and answered
+questions; you should begin your research there before reporting something as a
+bug -- and then do so via list discussion first.)
(Also, if you'd like to learn about how you can use ``setuptools`` to make your
own packages work better with EasyInstall, or provide EasyInstall-like features
@@ -30,49 +31,32 @@
Installing "Easy Install"
-------------------------
-Download `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_, and
-run it; this will download and install the appropriate ``setuptools`` egg for
-your Python version. (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. (Windows users, don't
-put ``ez_setup.py`` inside your Python installation; please put it in some
-other directory before running it.)
+Please see the `setuptools PyPI page <http://pypi.python.org/pypi/setuptools>`_
+for download links and basic installation instructions for each of the
+supported platforms.
-You may receive a message telling you about an obsolete version of setuptools
-being present; if so, you must be sure to delete it entirely, along with the
-old ``pkg_resources`` module if it's present on ``sys.path``.
+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.
-The ``ez_setup.py`` script accepts the same `Command-Line Options`_ and
-`Configuration Files`_ as ``easy_install`` itself, so you can use them to
-control its behavior. In particular, you can use the --script-dir option to
-direct script installation to a custom location. You should not, however,
-use custom installation locations without first reading the section below on
-`Custom Installation Locations`_.
+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
+not the case, you should consult the section below on `Custom Installation
+Locations`_ before installing. (And, on Windows, you should not use the
+``.exe`` installer when installing to an alternate location.)
-The instructions you've just read assume that:
+Note that ``easy_install`` normally works by downloading files from the
+internet. If you are behind an NTLM-based firewall that prevents Python
+programs from accessing the net directly, you may wish to first install and use
+the `APS proxy server <http://ntlmaps.sf.net/>`_, which lets you get past such
+firewalls in the same way that your web browser(s) do.
-* You are installling to Python's primary ``site-packages`` directory
+(Alternately, if you do not wish easy_install to actually download anything, you
+can restrict it from doing so with the ``--allow-hosts`` option; see the
+sections on `restricting downloads with --allow-hosts`_ and `command-line
+options`_ for more details.)
-* You have unrestricted internet access on the computer where you are
- installing.
-If you are behind an NTLM-based firewall that prevents Python programs from
-accessing the net directly, you may wish to first install and use the `APS
-proxy server <http://ntlmaps.sf.net/>`_, which lets you get past such firewalls
-in the same way that your web browser(s) do. This will let ``ez_setup.py``
-download the setuptools egg.
-
-If you can't use APS, or don't have internet access at all, you will need to
-first download the appropriate ``.egg`` file from the `setuptools PyPI page
-<http://pypi.python.org/pypi/setuptools>`_ using a computer with internet
-access. Place the egg in the same directory as ``ez_setup.py`` on the target
-computer before running it.
-
-If you are installing to a custom location or do not have write access to
-Python's primary ``site-packages`` directory, please also see the section below
-on `Custom Installation Locations`_ for more detailed instructions.
-
-
Troubleshooting
~~~~~~~~~~~~~~~
@@ -1234,6 +1218,10 @@
============================
0.6final
+ * Fixed ``win32.exe`` support for .pth files, so unnecessary directory nesting
+ is flattened out in the resulting egg. (There was a case-sensitivity
+ problem that affected some distributions, notably ``pywin32``.)
+
* Prevent ``--help-commands`` and other junk from showing under Python 2.5
when running ``easy_install --help``.
@@ -1245,6 +1233,22 @@
* Changes for Jython compatibility
+ * Improved error message when a requirement is also a directory name, but the
+ specified directory is not a source package.
+
+ * Fixed ``--allow-hosts`` option blocking ``file:`` URLs
+
+ * Fixed HTTP SVN detection failing when the page title included a project
+ name (e.g. on SourceForge-hosted SVN)
+
+ * Fix Jython script installation to handle ``#!`` lines better when
+ ``sys.executable`` is a script.
+
+ * Removed use of deprecated ``md5`` module if ``hashlib`` is available
+
+ * Keep site directories (e.g. ``site-packages``) from being included in
+ ``.pth`` files.
+
0.6c7
* ``ftp:`` download URLs now work correctly.
Modified: vendor/setuptools/current/PKG-INFO
===================================================================
--- vendor/setuptools/current/PKG-INFO 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/PKG-INFO 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: setuptools
-Version: 0.6c8
+Version: 0.6c9
Summary: Download, build, install, upgrade, and uninstall Python packages -- easily!
Home-page: http://pypi.python.org/pypi/setuptools
Author: Phillip J. Eby
@@ -53,9 +53,9 @@
==============================
1. Download the appropriate egg for your version of Python (e.g.
- ``setuptools-0.6c8-py2.4.egg``). Do NOT rename it.
+ ``setuptools-0.6c9-py2.4.egg``). Do NOT rename it.
- 2. Run it as if it were a shell script, e.g. ``sh setuptools-0.6c8-py2.4.egg``.
+ 2. Run it as if it were a shell script, e.g. ``sh setuptools-0.6c9-py2.4.egg``.
Setuptools will install itself using the matching version of Python (e.g.
``python2.4``), and will place the ``easy_install`` executable in the
default location for installing Python scripts (as determined by the
@@ -67,7 +67,7 @@
``--install-dir``, and so on, following the ``.egg`` filename on the same
command line. For example::
- sh setuptools-0.6c8-py2.4.egg --prefix=~
+ sh setuptools-0.6c9-py2.4.egg --prefix=~
You can use ``--help`` to get a full options list, but we recommend consulting
the `EasyInstall manual`_ for detailed instructions, especially `the section
@@ -88,7 +88,7 @@
for the **Windows** Python found at ``C:\\Python24``::
ln -s /cygdrive/c/Python24/python.exe python2.4
- PATH=.:$PATH sh setuptools-0.6c8-py2.4.egg
+ PATH=.:$PATH sh setuptools-0.6c9-py2.4.egg
rm python2.4
@@ -124,8 +124,11 @@
Questions, comments, and bug reports should be directed to the `distutils-sig
mailing list`_. If you have written (or know of) any tutorials, documentation,
plug-ins, or other resources for setuptools users, please let us know about
- them there, so this reference list can be updated.
+ them there, so this reference list can be updated. If you have working,
+ *tested* patches to correct problems or add features, you may submit them to
+ the `setuptools bug tracker`_.
+ .. _setuptools bug tracker: http://bugs.python.org/setuptools/
.. _Package Compatibility Notes: http://peak.telecommunity.com/DevCenter/PackageNotes
.. _The Internal Structure of Python Eggs: http://peak.telecommunity.com/DevCenter/EggFormats
.. _The setuptools Developer's Guide: http://peak.telecommunity.com/DevCenter/setuptools
Modified: vendor/setuptools/current/README.txt
===================================================================
--- vendor/setuptools/current/README.txt 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/README.txt 2008-11-04 02:34:46 UTC (rev 13241)
@@ -45,9 +45,9 @@
==============================
1. Download the appropriate egg for your version of Python (e.g.
- ``setuptools-0.6c8-py2.4.egg``). Do NOT rename it.
+ ``setuptools-0.6c9-py2.4.egg``). Do NOT rename it.
-2. Run it as if it were a shell script, e.g. ``sh setuptools-0.6c8-py2.4.egg``.
+2. Run it as if it were a shell script, e.g. ``sh setuptools-0.6c9-py2.4.egg``.
Setuptools will install itself using the matching version of Python (e.g.
``python2.4``), and will place the ``easy_install`` executable in the
default location for installing Python scripts (as determined by the
@@ -59,7 +59,7 @@
``--install-dir``, and so on, following the ``.egg`` filename on the same
command line. For example::
- sh setuptools-0.6c8-py2.4.egg --prefix=~
+ sh setuptools-0.6c9-py2.4.egg --prefix=~
You can use ``--help`` to get a full options list, but we recommend consulting
the `EasyInstall manual`_ for detailed instructions, especially `the section
@@ -80,7 +80,7 @@
for the **Windows** Python found at ``C:\\Python24``::
ln -s /cygdrive/c/Python24/python.exe python2.4
- PATH=.:$PATH sh setuptools-0.6c8-py2.4.egg
+ PATH=.:$PATH sh setuptools-0.6c9-py2.4.egg
rm python2.4
@@ -116,8 +116,11 @@
Questions, comments, and bug reports should be directed to the `distutils-sig
mailing list`_. If you have written (or know of) any tutorials, documentation,
plug-ins, or other resources for setuptools users, please let us know about
-them there, so this reference list can be updated.
+them there, so this reference list can be updated. If you have working,
+*tested* patches to correct problems or add features, you may submit them to
+the `setuptools bug tracker`_.
+.. _setuptools bug tracker: http://bugs.python.org/setuptools/
.. _Package Compatibility Notes: http://peak.telecommunity.com/DevCenter/PackageNotes
.. _The Internal Structure of Python Eggs: http://peak.telecommunity.com/DevCenter/EggFormats
.. _The setuptools Developer's Guide: http://peak.telecommunity.com/DevCenter/setuptools
Modified: vendor/setuptools/current/ez_setup.py
===================================================================
--- vendor/setuptools/current/ez_setup.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/ez_setup.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -14,7 +14,7 @@
This file can also be run as a script to install or upgrade setuptools.
"""
import sys
-DEFAULT_VERSION = "0.6c8"
+DEFAULT_VERSION = "0.6c9"
DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
md5_data = {
@@ -45,13 +45,17 @@
'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
+ 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
+ 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
+ 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
}
import sys, os
+try: from hashlib import md5
+except ImportError: from md5 import md5
def _validate_md5(egg_name, data):
if egg_name in md5_data:
- from md5 import md5
digest = md5(data).hexdigest()
if digest != md5_data[egg_name]:
print >>sys.stderr, (
@@ -61,7 +65,6 @@
sys.exit(2)
return data
-
def use_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
download_delay=15
@@ -230,7 +233,6 @@
"""Update our built-in md5 registry"""
import re
- from md5 import md5
for name in filenames:
base = os.path.basename(name)
@@ -267,3 +269,4 @@
+
Modified: vendor/setuptools/current/pkg_resources.py
===================================================================
--- vendor/setuptools/current/pkg_resources.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/pkg_resources.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1188,7 +1188,9 @@
)
def _fn(self, base, resource_name):
- return os.path.join(base, *resource_name.split('/'))
+ if resource_name:
+ return os.path.join(base, *resource_name.split('/'))
+ return base
def _get(self, path):
if hasattr(self.loader, 'get_data'):
@@ -1226,8 +1228,6 @@
-
-
class DefaultProvider(EggProvider):
"""Provides access to package resources in the filesystem"""
@@ -1862,7 +1862,7 @@
The algorithm assumes that strings like "-" and any alpha string that
alphabetically follows "final" represents a "patch level". So, "2.4-1"
is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is
- considered newer than "2.4-1", whic in turn is newer than "2.4".
+ considered newer than "2.4-1", which in turn is newer than "2.4".
Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that
come before "final" alphabetically) are assumed to be pre-release versions,
@@ -1871,7 +1871,8 @@
Finally, to handle miscellaneous cases, the strings "pre", "preview", and
"rc" are treated as if they were "c", i.e. as though they were release
candidates, and therefore are not as new as a version string that does not
- contain them.
+ contain them, and "dev" is replaced with an '@' so that it sorts lower than
+ than any other pre-release tag.
"""
parts = []
for part in _parse_version_parts(s.lower()):
Modified: vendor/setuptools/current/pkg_resources.txt
===================================================================
--- vendor/setuptools/current/pkg_resources.txt 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/pkg_resources.txt 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1692,6 +1692,9 @@
Release Notes/Change History
----------------------------
+0.6final
+ * Fix ``resource_listdir('')`` always returning an empty list for zipped eggs.
+
0.6c7
* Fix package precedence problem where single-version eggs installed in
``site-packages`` would take precedence over ``.egg`` files (or directories)
Modified: vendor/setuptools/current/release.sh
===================================================================
--- vendor/setuptools/current/release.sh 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/release.sh 2008-11-04 02:34:46 UTC (rev 13241)
@@ -7,7 +7,7 @@
# If your initials aren't PJE, don't run it. :)
#
-export VERSION="0.6c8"
+export VERSION="0.6c9"
python2.3 setup.py -q release source --target-version=2.3 upload && \
python2.4 setup.py -q release binary --target-version=2.4 upload && \
@@ -19,8 +19,6 @@
~/projects/ez_setup/__init__.py #&& \
#svn up ~/projects/*/ez_setup
-# XXX update wiki pages
-#
-#./wikiup setuptools setuptools.txt
-#./wikiup PkgResources pkg_resources.txt
-#./wikiup EasyInstall EasyInstall.txt
+# update wiki pages from EasyInstall.txt, setuptools.txt, &
+# pkg_resources.txt
+python2.5 setup.py wikiup -c "Released version: $VERSION"
Modified: vendor/setuptools/current/setup.py
===================================================================
--- vendor/setuptools/current/setup.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setup.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -7,7 +7,7 @@
execfile(convert_path('setuptools/command/__init__.py'), d)
SETUP_COMMANDS = d['__all__']
-VERSION = "0.6c8"
+VERSION = "0.6c9"
from setuptools import setup, find_packages
import sys
Modified: vendor/setuptools/current/setuptools/__init__.py
===================================================================
--- vendor/setuptools/current/setuptools/__init__.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/__init__.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -7,7 +7,7 @@
from distutils.util import convert_path
import os.path
-__version__ = '0.6c8'
+__version__ = '0.6c9'
__all__ = [
'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require',
'find_packages'
Modified: vendor/setuptools/current/setuptools/command/bdist_egg.py
===================================================================
--- vendor/setuptools/current/setuptools/command/bdist_egg.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/bdist_egg.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -29,7 +29,7 @@
" import sys, pkg_resources, imp",
" __file__ = pkg_resources.resource_filename(__name__,%r)"
% resource,
- " del __bootstrap__, __loader__",
+ " __loader__ = None; del __bootstrap__, __loader__",
" imp.load_dynamic(__name__,__file__)",
"__bootstrap__()",
"" # terminal \n
@@ -203,10 +203,12 @@
log.info("installing scripts to %s" % script_dir)
self.call_command('install_scripts',install_dir=script_dir,no_ep=1)
- native_libs = os.path.join(self.egg_info,"native_libs.txt")
+ self.copy_metadata_to(egg_info)
+ native_libs = os.path.join(egg_info, "native_libs.txt")
if all_outputs:
log.info("writing %s" % native_libs)
if not self.dry_run:
+ ensure_directory(native_libs)
libs_file = open(native_libs, 'wt')
libs_file.write('\n'.join(all_outputs))
libs_file.write('\n')
@@ -216,8 +218,6 @@
if not self.dry_run:
os.unlink(native_libs)
- self.copy_metadata_to(egg_info)
-
write_safety_flag(
os.path.join(archive_root,'EGG-INFO'), self.zip_safe()
)
Modified: vendor/setuptools/current/setuptools/command/bdist_wininst.py
===================================================================
--- vendor/setuptools/current/setuptools/command/bdist_wininst.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/bdist_wininst.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -21,9 +21,10 @@
installer_name = os.path.join(self.dist_dir,
"%s.win32.exe" % fullname)
pyversion = 'any'
+ good = ('bdist_wininst', pyversion, installer_name)
+ if good not in dist_files:
+ dist_files.append(good)
- dist_files.append(('bdist_wininst', pyversion, installer_name))
-
def reinitialize_command (self, command, reinit_subcommands=0):
cmd = self.distribution.reinitialize_command(
command, reinit_subcommands)
Modified: vendor/setuptools/current/setuptools/command/build_ext.py
===================================================================
--- vendor/setuptools/current/setuptools/command/build_ext.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/build_ext.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -107,7 +107,9 @@
if self.shlibs:
self.setup_shlib_compiler()
for ext in self.extensions:
- fullname = ext._full_name = self.get_ext_fullname(ext.name)
+ ext._full_name = self.get_ext_fullname(ext.name)
+ for ext in self.extensions:
+ fullname = ext._full_name
self.ext_map[fullname] = ext
ltd = ext._links_to_dynamic = \
self.shlibs and self.links_to_dynamic(ext) or False
@@ -119,8 +121,6 @@
if ltd and use_stubs and os.curdir not in ext.runtime_library_dirs:
ext.runtime_library_dirs.append(os.curdir)
-
-
def setup_shlib_compiler(self):
compiler = self.shlib_compiler = new_compiler(
compiler=self.compiler, dry_run=self.dry_run, force=self.force
Modified: vendor/setuptools/current/setuptools/command/easy_install.py
===================================================================
--- vendor/setuptools/current/setuptools/command/easy_install.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/easy_install.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -272,7 +272,7 @@
if is_site_dir:
if self.pth_file is None:
- self.pth_file = PthDistributions(pth_file)
+ self.pth_file = PthDistributions(pth_file, self.all_site_dirs)
else:
self.pth_file = None
@@ -639,11 +639,11 @@
setups = glob(os.path.join(setup_base, '*', 'setup.py'))
if not setups:
raise DistutilsError(
- "Couldn't find a setup script in %s" % dist_filename
+ "Couldn't find a setup script in %s" % os.path.abspath(dist_filename)
)
if len(setups)>1:
raise DistutilsError(
- "Multiple setup scripts in %s" % dist_filename
+ "Multiple setup scripts in %s" % os.path.abspath(dist_filename)
)
setup_script = setups[0]
@@ -744,8 +744,9 @@
native_libs = []
top_level = {}
def process(src,dst):
+ s = src.lower()
for old,new in prefixes:
- if src.startswith(old):
+ if s.startswith(old):
src = new+src[len(old):]
parts = src.split('/')
dst = os.path.join(egg_tmp, *parts)
@@ -761,7 +762,6 @@
if not src.endswith('.pth'):
log.warn("WARNING: can't process %s", src)
return None
-
# extract, tracking .pyd/.dll->native_libs and .py -> to_compile
unpack_archive(dist_filename, egg_tmp, process)
stubs = []
@@ -1273,7 +1273,7 @@
"""Get exe->egg path translations for a given .exe file"""
prefixes = [
- ('PURELIB/', ''),
+ ('PURELIB/', ''), ('PLATLIB/pywin32_system32', ''),
('PLATLIB/', ''),
('SCRIPTS/', 'EGG-INFO/scripts/')
]
@@ -1290,14 +1290,14 @@
continue
if name.endswith('-nspkg.pth'):
continue
- if parts[0] in ('PURELIB','PLATLIB'):
+ if parts[0].upper() in ('PURELIB','PLATLIB'):
for pth in yield_lines(z.read(name)):
pth = pth.strip().replace('\\','/')
if not pth.startswith('import'):
prefixes.append((('%s/%s/' % (parts[0],pth)), ''))
finally:
z.close()
-
+ prefixes = [(x.lower(),y) for x, y in prefixes]
prefixes.sort(); prefixes.reverse()
return prefixes
@@ -1315,8 +1315,8 @@
dirty = False
- def __init__(self, filename):
- self.filename = filename
+ def __init__(self, filename, sitedirs=()):
+ self.filename = filename; self.sitedirs=map(normalize_path, sitedirs)
self.basedir = normalize_path(os.path.dirname(self.filename))
self._load(); Environment.__init__(self, [], None, None)
for path in yield_lines(self.paths):
@@ -1325,7 +1325,7 @@
def _load(self):
self.paths = []
saw_import = False
- seen = {}
+ seen = dict.fromkeys(self.sitedirs)
if os.path.isfile(self.filename):
for line in open(self.filename,'rt'):
if line.startswith('import'):
@@ -1381,7 +1381,7 @@
def add(self,dist):
"""Add `dist` to the distribution map"""
- if dist.location not in self.paths:
+ if dist.location not in self.paths and dist.location not in self.sitedirs:
self.paths.append(dist.location); self.dirty = True
Environment.add(self,dist)
@@ -1415,8 +1415,7 @@
options = ''
if match:
options = match.group(1) or ''
- if options:
- options = ' '+options
+ if options: options = ' '+options
if wininst:
executable = "python.exe"
else:
@@ -1430,7 +1429,8 @@
# else: punt, we can't do it, let the warning happen anyway
else:
options = ' -x'
- hdr = "#!%(executable)s%(options)s\n" % locals()
+ executable = fix_jython_executable(executable, options)
+ hdr = "#!%(executable)s%(options)s\n" % locals()
return hdr
def auto_chmod(func, arg, exc):
@@ -1465,15 +1465,15 @@
else:
return True
+def is_sh(executable):
+ """Determine if the specified executable is a .sh (contains a #! line)"""
+ try:
+ fp = open(executable)
+ magic = fp.read(2)
+ fp.close()
+ except (OSError,IOError): return executable
+ return magic == '#!'
-
-
-
-
-
-
-
-
def nt_quote_arg(arg):
"""Quote a command line argument according to Windows parsing rules"""
@@ -1520,10 +1520,8 @@
"""
if filename.endswith('.py') or filename.endswith('.pyw'):
return True # extension says it's Python
-
if is_python(script_text, filename):
return True # it's syntactically valid Python
-
if script_text.startswith('#!'):
# It begins with a '#!' line, so check if 'python' is in it somewhere
return 'python' in script_text.splitlines()[0].lower()
@@ -1543,19 +1541,21 @@
except os.error, e:
log.debug("chmod failed: %s", e)
+def fix_jython_executable(executable, options):
+ if sys.platform.startswith('java') and is_sh(executable):
+ # Workaround Jython's sys.executable being a .sh (an invalid
+ # 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.")
+ else:
+ return '/usr/bin/env %s' % executable
+ return executable
-
-
-
-
-
-
-
-
-
-
-
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())
Modified: vendor/setuptools/current/setuptools/command/egg_info.py
===================================================================
--- vendor/setuptools/current/setuptools/command/egg_info.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/egg_info.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -168,6 +168,12 @@
for ep in iter_entry_points('egg_info.writers'):
writer = ep.load(installer=installer)
writer(self, ep.name, os.path.join(self.egg_info,ep.name))
+
+ # Get rid of native_libs.txt if it was put there by older bdist_egg
+ nl = os.path.join(self.egg_info, "native_libs.txt")
+ if os.path.exists(nl):
+ self.delete_file(nl)
+
self.find_sources()
def tags(self):
@@ -197,12 +203,6 @@
-
-
-
-
-
-
def get_svn_revision(self):
revision = 0
urlre = re.compile('url="([^"]+)"')
@@ -217,9 +217,9 @@
data = f.read()
f.close()
- if data.startswith('8'):
+ if data.startswith('9') or data.startswith('8'):
data = map(str.splitlines,data.split('\n\x0c\n'))
- del data[0][0] # get rid of the '8'
+ del data[0][0] # get rid of the '8' or '9'
dirurl = data[0][3]
localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
elif data.startswith('<?xml'):
Modified: vendor/setuptools/current/setuptools/command/sdist.py
===================================================================
--- vendor/setuptools/current/setuptools/command/sdist.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/sdist.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,5 +1,6 @@
from distutils.command.sdist import sdist as _sdist
from distutils.util import convert_path
+from distutils import log
import os, re, sys, pkg_resources
entities = [
@@ -38,7 +39,6 @@
-
def walk_revctrl(dirname=''):
"""Find all files under revision control"""
for ep in pkg_resources.iter_entry_points('setuptools.file_finders'):
@@ -86,7 +86,7 @@
f = open(filename,'rU')
data = f.read()
f.close()
- if data.startswith('8'): # subversion 1.4
+ if data.startswith('9') or data.startswith('8'): # subversion 1.5/1.4
for record in map(str.splitlines, data.split('\n\x0c\n')[1:]):
if not record or len(record)>=6 and record[5]=="delete":
continue # skip deleted
Modified: vendor/setuptools/current/setuptools/command/upload.py
===================================================================
--- vendor/setuptools/current/setuptools/command/upload.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/command/upload.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -6,7 +6,10 @@
from distutils.core import Command
from distutils.spawn import spawn
from distutils import log
-from md5 import md5
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
import os
import socket
import platform
Modified: vendor/setuptools/current/setuptools/depends.py
===================================================================
--- vendor/setuptools/current/setuptools/depends.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/depends.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -204,7 +204,6 @@
def extract_constant(code,symbol,default=-1):
-
"""Extract the constant value of 'symbol' from 'code'
If the name 'symbol' is bound to a constant value by the Python code
@@ -237,10 +236,11 @@
return const
else:
const = default
+
+if sys.platform.startswith('java') or sys.platform == 'cli':
+ # XXX it'd be better to test assertions about bytecode instead...
+ del extract_constant, get_module_constant
+ __all__.remove('extract_constant')
+ __all__.remove('get_module_constant')
-
-
-
-
-
Modified: vendor/setuptools/current/setuptools/package_index.py
===================================================================
--- vendor/setuptools/current/setuptools/package_index.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/package_index.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,10 +1,12 @@
"""PyPI and direct package downloading"""
-
import sys, os.path, re, urlparse, urllib2, shutil, random, socket, cStringIO
from pkg_resources import *
from distutils import log
from distutils.errors import DistutilsError
-from md5 import md5
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
from fnmatch import translate
EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.]+)$')
@@ -14,7 +16,6 @@
'<a href="([^"#]+)">([^<]+)</a>\n\s+\\(<a (?:title="MD5 hash"\n\s+)'
'href="[^?]+\?:action=show_md5&digest=([0-9a-f]{32})">md5</a>\\)'
)
-
URL_SCHEME = re.compile('([-+.a-z0-9]{2,}):',re.I).match
EXTENSIONS = ".tar.gz .tar.bz2 .tar .zip .tgz".split()
@@ -23,7 +24,6 @@
'interpret_distro_name',
]
-
def parse_bdist_wininst(name):
"""Return (base,pyversion) or (None,None) for possible .exe name"""
@@ -220,7 +220,8 @@
map(self.add, dists)
def url_ok(self, url, fatal=False):
- if self.allows(urlparse.urlparse(url)[1]):
+ s = URL_SCHEME(url)
+ if (s and s.group(1).lower()=='file') or self.allows(urlparse.urlparse(url)[1]):
return True
msg = "\nLink to % s ***BLOCKED*** by --allow-hosts\n"
if fatal:
@@ -243,7 +244,6 @@
dist.precedence = SOURCE_DIST
self.add(dist)
-
def process_index(self,url,page):
"""Process the contents of a PyPI page"""
def scan(link):
@@ -629,7 +629,7 @@
for line in file:
if line.strip():
# Check for a subversion index page
- if re.search(r'<title>Revision \d+:', line):
+ if re.search(r'<title>([^- ]+ - )?Revision \d+:', line):
# it's a subversion index page:
file.close()
os.unlink(filename)
Modified: vendor/setuptools/current/setuptools/tests/__init__.py
===================================================================
--- vendor/setuptools/current/setuptools/tests/__init__.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/tests/__init__.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,5 +1,4 @@
"""Tests for the 'setuptools' package"""
-
from unittest import TestSuite, TestCase, makeSuite, defaultTestLoader
import distutils.core, distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
@@ -7,8 +6,8 @@
import setuptools, setuptools.dist
from setuptools import Feature
from distutils.core import Extension
-from setuptools.depends import extract_constant, get_module_constant
-from setuptools.depends import find_module, Require
+extract_constant, get_module_constant = None, None
+from setuptools.depends import *
from distutils.version import StrictVersion, LooseVersion
from distutils.util import convert_path
import sys, os.path
@@ -41,15 +40,11 @@
-
-
-
class DependsTests(TestCase):
def testExtractConst(self):
+ if not extract_constant: return # skip on non-bytecode platforms
- from setuptools.depends import extract_constant
-
def f1():
global x,y,z
x = "test"
@@ -74,6 +69,7 @@
f,p,i = find_module('setuptools.tests'); f.close()
def testModuleExtract(self):
+ if not get_module_constant: return # skip on non-bytecode platforms
from distutils import __version__
self.assertEqual(
get_module_constant('distutils','__version__'), __version__
@@ -86,6 +82,7 @@
)
def testRequire(self):
+ if not extract_constant: return # skip on non-bytecode platforms
req = Require('Distutils','1.0.3','distutils')
@@ -125,7 +122,6 @@
self.failUnless(req.is_current(paths))
-
class DistroTests(TestCase):
def setUp(self):
Modified: vendor/setuptools/current/setuptools/tests/test_packageindex.py
===================================================================
--- vendor/setuptools/current/setuptools/tests/test_packageindex.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/tests/test_packageindex.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -17,3 +17,11 @@
self.assert_(url in str(v))
else:
self.assert_(isinstance(v,urllib2.HTTPError))
+
+ def test_url_ok(self):
+ index = setuptools.package_index.PackageIndex(
+ hosts=('www.example.com',)
+ )
+ url = 'file:///tmp/test_package_index'
+ self.assert_(index.url_ok(url, True))
+
Modified: vendor/setuptools/current/setuptools/tests/test_resources.py
===================================================================
--- vendor/setuptools/current/setuptools/tests/test_resources.py 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools/tests/test_resources.py 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,8 +1,10 @@
-from unittest import TestCase, makeSuite
-from pkg_resources import *
-import pkg_resources, sys
-try:
- frozenset
+#!/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 *
+from setuptools.command.easy_install import get_script_header, is_sh
+import os, pkg_resources, sys, StringIO
+try: frozenset
except NameError:
from sets import ImmutableSet as frozenset
@@ -28,14 +30,12 @@
ad = 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"))
# Name is in there now
self.failUnless(ad['FooPkg'])
-
# But only 1 package
self.assertEqual(list(ad), ['foopkg'])
@@ -490,4 +490,44 @@
+class ScriptHeaderTests(TestCase):
+ non_ascii_exe = '/Users/José/bin/python'
+ 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
+ self.assertEqual(get_script_header('#!/usr/local/bin/python'),
+ '#!%s\n' % os.path.normpath(sys.executable))
+ self.assertEqual(get_script_header('#!/usr/bin/python -x'),
+ '#!%s -x\n' % os.path.normpath(sys.executable))
+ self.assertEqual(get_script_header('#!/usr/bin/python',
+ executable=self.non_ascii_exe),
+ '#!%s -x\n' % self.non_ascii_exe)
+
+ def test_get_script_header_jython_workaround(self):
+ platform = sys.platform
+ sys.platform = 'java1.5.0_13'
+ stdout = sys.stdout
+ try:
+ # A mock sys.executable that uses a shebang line (this file)
+ exe = os.path.normpath(os.path.splitext(__file__)[0] + '.py')
+ self.assertEqual(
+ get_script_header('#!/usr/local/bin/python', executable=exe),
+ '#!/usr/bin/env %s\n' % exe)
+
+ # Ensure we generate what is basically a broken shebang line
+ # when there's options, with a warning emitted
+ sys.stdout = StringIO.StringIO()
+ self.assertEqual(get_script_header('#!/usr/bin/python -x',
+ executable=exe),
+ '#!%s -x\n' % exe)
+ self.assert_('Unable to adapt shebang line' in sys.stdout.getvalue())
+ sys.stdout = StringIO.StringIO()
+ self.assertEqual(get_script_header('#!/usr/bin/python',
+ executable=self.non_ascii_exe),
+ '#!%s -x\n' % self.non_ascii_exe)
+ self.assert_('Unable to adapt shebang line' in sys.stdout.getvalue())
+ finally:
+ sys.platform = platform
+ sys.stdout = stdout
+
Modified: vendor/setuptools/current/setuptools.egg-info/PKG-INFO
===================================================================
--- vendor/setuptools/current/setuptools.egg-info/PKG-INFO 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools.egg-info/PKG-INFO 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: setuptools
-Version: 0.6c8
+Version: 0.6c9
Summary: Download, build, install, upgrade, and uninstall Python packages -- easily!
Home-page: http://pypi.python.org/pypi/setuptools
Author: Phillip J. Eby
@@ -53,9 +53,9 @@
==============================
1. Download the appropriate egg for your version of Python (e.g.
- ``setuptools-0.6c8-py2.4.egg``). Do NOT rename it.
+ ``setuptools-0.6c9-py2.4.egg``). Do NOT rename it.
- 2. Run it as if it were a shell script, e.g. ``sh setuptools-0.6c8-py2.4.egg``.
+ 2. Run it as if it were a shell script, e.g. ``sh setuptools-0.6c9-py2.4.egg``.
Setuptools will install itself using the matching version of Python (e.g.
``python2.4``), and will place the ``easy_install`` executable in the
default location for installing Python scripts (as determined by the
@@ -67,7 +67,7 @@
``--install-dir``, and so on, following the ``.egg`` filename on the same
command line. For example::
- sh setuptools-0.6c8-py2.4.egg --prefix=~
+ sh setuptools-0.6c9-py2.4.egg --prefix=~
You can use ``--help`` to get a full options list, but we recommend consulting
the `EasyInstall manual`_ for detailed instructions, especially `the section
@@ -88,7 +88,7 @@
for the **Windows** Python found at ``C:\\Python24``::
ln -s /cygdrive/c/Python24/python.exe python2.4
- PATH=.:$PATH sh setuptools-0.6c8-py2.4.egg
+ PATH=.:$PATH sh setuptools-0.6c9-py2.4.egg
rm python2.4
@@ -124,8 +124,11 @@
Questions, comments, and bug reports should be directed to the `distutils-sig
mailing list`_. If you have written (or know of) any tutorials, documentation,
plug-ins, or other resources for setuptools users, please let us know about
- them there, so this reference list can be updated.
+ them there, so this reference list can be updated. If you have working,
+ *tested* patches to correct problems or add features, you may submit them to
+ the `setuptools bug tracker`_.
+ .. _setuptools bug tracker: http://bugs.python.org/setuptools/
.. _Package Compatibility Notes: http://peak.telecommunity.com/DevCenter/PackageNotes
.. _The Internal Structure of Python Eggs: http://peak.telecommunity.com/DevCenter/EggFormats
.. _The setuptools Developer's Guide: http://peak.telecommunity.com/DevCenter/setuptools
Modified: vendor/setuptools/current/setuptools.egg-info/SOURCES.txt
===================================================================
--- vendor/setuptools/current/setuptools.egg-info/SOURCES.txt 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools.egg-info/SOURCES.txt 2008-11-04 02:34:46 UTC (rev 13241)
@@ -14,6 +14,7 @@
version
version.dat
virtual-python.py
+wikiup.cfg
setuptools/__init__.py
setuptools/archive_util.py
setuptools/cli.exe
Modified: vendor/setuptools/current/setuptools.txt
===================================================================
--- vendor/setuptools/current/setuptools.txt 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/setuptools.txt 2008-11-04 02:34:46 UTC (rev 13241)
@@ -2618,7 +2618,8 @@
* Updated Pyrex support to work with Pyrex 0.9.6 and higher.
- * Minor changes for Jython compatibility
+ * 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``.
@@ -2631,6 +2632,23 @@
* 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.
@@ -3086,11 +3104,14 @@
* Initial release.
-Mailing list
-============
+Mailing List and Bug Tracker
+============================
Please use the `distutils-sig mailing list`_ for questions and discussion about
-setuptools.
+setuptools, and the `setuptools bug tracker`_ ONLY for issues you have
+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/
Modified: vendor/setuptools/current/version.dat
===================================================================
--- vendor/setuptools/current/version.dat 2008-11-04 02:10:49 UTC (rev 13240)
+++ vendor/setuptools/current/version.dat 2008-11-04 02:34:46 UTC (rev 13241)
@@ -1,6 +1,6 @@
[setuptools]
status = 'release candidate'
major = 0
-build = 8
+build = 9
minor = 6
Added: vendor/setuptools/current/wikiup.cfg
===================================================================
--- vendor/setuptools/current/wikiup.cfg (rev 0)
+++ vendor/setuptools/current/wikiup.cfg 2008-11-04 02:34:46 UTC (rev 13241)
@@ -0,0 +1,5 @@
+[PEAK]
+EasyInstall = EasyInstall.txt
+setuptools = setuptools.txt
+PkgResources = pkg_resources.txt
+EggFormats = doc/formats.txt
Property changes on: vendor/setuptools/current/wikiup.cfg
___________________________________________________________________
Name: svn:executable
+ *
More information about the CIG-COMMITS
mailing list