Merge lp:~barry/ubuntu/lucid/distribute/sync-to-sid into lp:ubuntu/lucid/distribute

Proposed by Barry Warsaw
Status: Merged
Merge reported by: Benjamin Drung
Merged at revision: not available
Proposed branch: lp:~barry/ubuntu/lucid/distribute/sync-to-sid
Merge into: lp:ubuntu/lucid/distribute
Diff against target: 2722 lines (+539/-1442)
37 files modified
CHANGES.txt (+35/-0)
CONTRIBUTORS.txt (+2/-0)
PKG-INFO (+68/-21)
README.txt (+41/-29)
debian/changelog (+20/-0)
debian/control (+2/-2)
debian/python-distribute.substvars (+1/-1)
debian/rules (+6/-8)
distribute.egg-info/PKG-INFO (+68/-21)
distribute.egg-info/SOURCES.txt (+3/-4)
distribute.egg-info/entry_points.txt (+1/-1)
distribute_setup.py (+34/-16)
distribute_setup_dev.py (+0/-458)
docs/_templates/indexsidebar.html (+8/-0)
docs/build/html/_sources/easy_install.txt (+5/-2)
docs/build/html/_sources/index.txt (+17/-1)
docs/build/html/_sources/pkg_resources.txt (+4/-3)
docs/build/html/_sources/roadmap.txt (+2/-2)
docs/conf.py (+4/-3)
docs/easy_install.txt (+5/-2)
docs/index.txt (+17/-1)
docs/pkg_resources.txt (+4/-3)
docs/roadmap.txt (+2/-2)
ll.txt (+0/-37)
ok.txt (+0/-804)
pkg_resources.py (+22/-3)
setup.py (+4/-2)
setuptools/command/__init__.py (+3/-0)
setuptools/command/easy_install.py (+7/-1)
setuptools/command/install_scripts.py (+4/-1)
setuptools/command/upload_docs.py (+1/-1)
setuptools/sandbox.py (+6/-2)
setuptools/tests/test_develop.py (+1/-1)
setuptools/tests/test_easy_install.py (+39/-1)
setuptools/tests/test_resources.py (+10/-9)
setuptools/tests/test_sandbox.py (+28/-0)
setuptools/tests/test_upload_docs.py (+65/-0)
To merge this branch: bzr merge lp:~barry/ubuntu/lucid/distribute/sync-to-sid
Reviewer Review Type Date Requested Status
Scott Kitterman Needs Fixing
Ubuntu branches Pending
Review via email: mp+17425@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Sync'd via 'bzr merge-package' to lp:debian/sid/distribute. This should give us python-distribute 0.6.10 in Lucid, the latest upstream version.

Revision history for this message
Barry Warsaw (barry) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote :

Needs some cleanup as discussed on IRC.

review: Needs Fixing
9. By Barry Warsaw

Stop building for Python 2.5 as per discussion with ScottK.

10. By Barry Warsaw

Remove another reference to Python 2.5

Revision history for this message
Barry Warsaw (barry) wrote :

As per IRC, removed references to building for Python 2.5.

New diff against sid: http://paste.ubuntu.com/358715/
New diff against lucid: http://paste.ubuntu.com/358716/

Revision history for this message
Scott Kitterman (kitterman) wrote :

The diff looks good. For debian/changelog, we want an entry that looks something like:

  * Merge from Debian Unstable. Remaining Ubuntu changes:
    - Document each item of the diff here so it's clear where we
      diverge from Debian and why
    - Adjust debian/rules to only build modules and extensions for Python 2.6
      instead of Python 2.4/2.5 (or whatever needs describing)

If I didn't know you really wanted to learn this stuff, I'd probably just fix it an upload, but since you do ....

review: Needs Fixing
11. By Barry Warsaw

* Merge from Debian Unstable. Remaining Ubuntu changes:
  - Build only for Python 2.6, since 2.5 and earlier is not supported on
    Lucid.
  - Remove old setuptools.egg-info directories so that we can transition
    to symlinks.
  - When writing the debian/python-setuptools.substvars, only include
    variable substitutions for building Python 2.6.

Revision history for this message
Barry Warsaw (barry) wrote :

I'm not 100% positive I understand what the .substvars files are for, where they're used, or why this rules file is writing them. However, it seems clear that we only want to support Python 2.6. Here is the updated changelog (branch update pushed in r11.

distribute (0.6.10-1ubuntu1) lucid; urgency=low

  * Merge from Debian Unstable. Remaining Ubuntu changes:
    - Build only for Python 2.6, since 2.5 and earlier is not supported on
      Lucid.
    - Remove old setuptools.egg-info directories so that we can transition
      to symlinks.
    - When writing the debian/python-setuptools.substvars, only include
      variable substitutions for building Python 2.6.

 -- Barry Warsaw <email address hidden> Thu, 14 Jan 2010 16:55:50 -0500

Revision history for this message
Michael Bienia (geser) wrote :

FYI: distribute 0.6.10-1ubuntu1 (different to this merge proposal) got uploaded to lucid.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES.txt'
--- CHANGES.txt 2009-11-12 02:12:16 +0000
+++ CHANGES.txt 2010-01-19 00:05:23 +0000
@@ -2,6 +2,41 @@
2CHANGES2CHANGES
3=======3=======
44
5------
60.6.10
7------
8
9* Reverted change made for the DistributionNotFound exception because
10 zc.buildout uses the exception message to get the name of the
11 distribution.
12
13-----
140.6.9
15-----
16
17* Issue 90: unknown setuptools version can be added in the working set
18* Issue 87: setupt.py doesn't try to convert distribute_setup.py anymore
19 Initial Patch by arfrever.
20* Issue 89: added a side bar with a download link to the doc.
21* Issue 86: fixed missing sentence in pkg_resources doc.
22* Added a nicer error message when a DistributionNotFound is raised.
23* Issue 80: test_develop now works with Python 3.1
24* Issue 93: upload_docs now works if there is an empty sub-directory.
25* Issue 70: exec bit on non-exec files
26* Issue 99: now the standalone easy_install command doesn't uses a
27 "setup.cfg" if any exists in the working directory. It will use it
28 only if triggered by ``install_requires`` from a setup.py call
29 (install, develop, etc).
30* Issue 101: Allowing ``os.devnull`` in Sandbox
31* Issue 92: Fixed the "no eggs" found error with MacPort
32 (platform.mac_ver() fails)
33* Issue 103: test_get_script_header_jython_workaround not run
34 anymore under py3 with C or POSIX local. Contributed by Arfrever.
35* Issue 104: remvoved the assertion when the installation fails,
36 with a nicer message for the end user.
37* Issue 100: making sure there's no SandboxViolation when
38 the setup script patches setuptools.
39
5-----40-----
60.6.8410.6.8
7-----42-----
843
=== modified file 'CONTRIBUTORS.txt'
--- CONTRIBUTORS.txt 2009-11-12 02:12:16 +0000
+++ CONTRIBUTORS.txt 2010-01-19 00:05:23 +0000
@@ -3,6 +3,8 @@
3============3============
44
5* Alex Grönholm5* Alex Grönholm
6* Alice Bevan-McGregor
7* Arfrever Frehtes Taifersar Arahesis
6* Daniel Stutzbach8* Daniel Stutzbach
7* Hanno Schlichting9* Hanno Schlichting
8* Jannis Leidel10* Jannis Leidel
911
=== modified file 'PKG-INFO'
--- PKG-INFO 2009-11-12 02:12:16 +0000
+++ PKG-INFO 2010-01-19 00:05:23 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.01Metadata-Version: 1.0
2Name: distribute2Name: distribute
3Version: 0.6.83Version: 0.6.10
4Summary: Easily download, build, install, upgrade, and uninstall Python packages4Summary: Easily download, build, install, upgrade, and uninstall Python packages
5Home-page: http://packages.python.org/distribute5Home-page: http://packages.python.org/distribute
6Author: The fellowship of the packaging6Author: The fellowship of the packaging
@@ -115,9 +115,9 @@
115 115
116 Download the source tarball, uncompress it, then run the install command::116 Download the source tarball, uncompress it, then run the install command::
117 117
118 $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.8.tar.gz118 $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
119 $ tar -xzvf distribute-0.6.8.tar.gz119 $ tar -xzvf distribute-0.6.10.tar.gz
120 $ cd distribute-0.6.8120 $ cd distribute-0.6.10
121 $ python setup.py install121 $ python setup.py install
122 122
123 ---------------------------123 ---------------------------
@@ -157,15 +157,25 @@
157 Quick help for developers157 Quick help for developers
158 -------------------------158 -------------------------
159 159
160 To use Distribute in your package, the recommended way is to ship160 To create an egg which is compatible with Distribute, use the same
161 `distribute_setup.py` alongside your `setup.py` script and call161 practice as with Setuptools, e.g.::
162 it at the very begining of `setup.py` like this::162
163 163 from setuptools import setup
164 from distribute_setup import use_setuptools164
165 use_setuptools()165 setup(...
166 166 )
167 167
168 Another way is to add ``Distribute`` in the ``install_requires`` option::168 To use `pkg_resources` to access data files in the egg, you should
169 require the Setuptools distribution explicitly::
170
171 from setuptools import setup
172
173 setup(...
174 install_requires=['setuptools']
175 )
176
177 Only if you need Distribute-specific functionality should you depend
178 on it explicitly. In this case, replace the Setuptools dependency::
169 179
170 from setuptools import setup180 from setuptools import setup
171 181
@@ -177,14 +187,16 @@
177 Install FAQ187 Install FAQ
178 -----------188 -----------
179 189
180 - **Why Distribute turn my Setuptools installation into an fake one?**190 - **Why is Distribute wrapping my Setuptools installation?**
181 191
182 Since Distribute is a fork, and since it provides the same package and modules,192 Since Distribute is a fork, and since it provides the same package
183 it fakes that the Setuptools installation is still present, so all the programs193 and modules, it renames the existing Setuptools egg and inserts a
184 that where using Setuptools still work.194 new one which merely wraps the Distribute code. This way, full
185 195 backwards compatibility is kept for packages which rely on the
186 If it wasn't doing it, a program that would try to install Setuptools196 Setuptools modules.
187 would overwrite in turn Distribute.197
198 At the same time, packages can meet their dependency on Setuptools
199 without actually installing it (which would disable Distribute).
188 200
189 - **How does Distribute interact with virtualenv?**201 - **How does Distribute interact with virtualenv?**
190 202
@@ -236,6 +248,41 @@
236 CHANGES248 CHANGES
237 =======249 =======
238 250
251 ------
252 0.6.10
253 ------
254
255 * Reverted change made for the DistributionNotFound exception because
256 zc.buildout uses the exception message to get the name of the
257 distribution.
258
259 -----
260 0.6.9
261 -----
262
263 * Issue 90: unknown setuptools version can be added in the working set
264 * Issue 87: setupt.py doesn't try to convert distribute_setup.py anymore
265 Initial Patch by arfrever.
266 * Issue 89: added a side bar with a download link to the doc.
267 * Issue 86: fixed missing sentence in pkg_resources doc.
268 * Added a nicer error message when a DistributionNotFound is raised.
269 * Issue 80: test_develop now works with Python 3.1
270 * Issue 93: upload_docs now works if there is an empty sub-directory.
271 * Issue 70: exec bit on non-exec files
272 * Issue 99: now the standalone easy_install command doesn't uses a
273 "setup.cfg" if any exists in the working directory. It will use it
274 only if triggered by ``install_requires`` from a setup.py call
275 (install, develop, etc).
276 * Issue 101: Allowing ``os.devnull`` in Sandbox
277 * Issue 92: Fixed the "no eggs" found error with MacPort
278 (platform.mac_ver() fails)
279 * Issue 103: test_get_script_header_jython_workaround not run
280 anymore under py3 with C or POSIX local. Contributed by Arfrever.
281 * Issue 104: remvoved the assertion when the installation fails,
282 with a nicer message for the end user.
283 * Issue 100: making sure there's no SandboxViolation when
284 the setup script patches setuptools.
285
239 -----286 -----
240 0.6.8287 0.6.8
241 -----288 -----
242289
=== modified file 'README.txt'
--- README.txt 2009-11-12 02:12:16 +0000
+++ README.txt 2010-01-19 00:05:23 +0000
@@ -29,7 +29,7 @@
29 the same as for Python 2 code, but Distribute also helps you to support29 the same as for Python 2 code, but Distribute also helps you to support
30 Python 2 and Python 3 from the same source code by letting you run 2to330 Python 2 and Python 3 from the same source code by letting you run 2to3
31 on the code as a part of the build process, by setting the keyword parameter31 on the code as a part of the build process, by setting the keyword parameter
32 ``use_2to3`` to True. See http://packages.python.org/distribute for more 32 ``use_2to3`` to True. See http://packages.python.org/distribute for more
33 information.33 information.
3434
35- Refactoring the code, and releasing it in several distributions.35- Refactoring the code, and releasing it in several distributions.
@@ -45,7 +45,7 @@
45==================45==================
4646
47You can get more information in the Sphinx-based documentation, located47You can get more information in the Sphinx-based documentation, located
48at http://packages.python.org/distribute. This documentation includes the old 48at http://packages.python.org/distribute. This documentation includes the old
49Setuptools documentation that is slowly replaced, and brand new content.49Setuptools documentation that is slowly replaced, and brand new content.
5050
51About the installation process51About the installation process
@@ -107,9 +107,9 @@
107107
108Download the source tarball, uncompress it, then run the install command::108Download the source tarball, uncompress it, then run the install command::
109109
110 $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.8.tar.gz110 $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
111 $ tar -xzvf distribute-0.6.8.tar.gz111 $ tar -xzvf distribute-0.6.10.tar.gz
112 $ cd distribute-0.6.8112 $ cd distribute-0.6.10
113 $ python setup.py install113 $ python setup.py install
114114
115---------------------------115---------------------------
@@ -117,7 +117,7 @@
117---------------------------117---------------------------
118118
119Like other distutils-based distributions, Distribute doesn't provide an119Like other distutils-based distributions, Distribute doesn't provide an
120uninstaller yet. It's all done manually! We are all waiting for PEP 376 120uninstaller yet. It's all done manually! We are all waiting for PEP 376
121support in Python.121support in Python.
122122
123Distribute is installed in three steps:123Distribute is installed in three steps:
@@ -149,34 +149,46 @@
149Quick help for developers149Quick help for developers
150-------------------------150-------------------------
151151
152To use Distribute in your package, the recommended way is to ship152To create an egg which is compatible with Distribute, use the same
153`distribute_setup.py` alongside your `setup.py` script and call 153practice as with Setuptools, e.g.::
154it at the very begining of `setup.py` like this::154
155155 from setuptools import setup
156 from distribute_setup import use_setuptools156
157 use_setuptools()157 setup(...
158158 )
159159
160Another way is to add ``Distribute`` in the ``install_requires`` option::160To use `pkg_resources` to access data files in the egg, you should
161161require the Setuptools distribution explicitly::
162 from setuptools import setup162
163163 from setuptools import setup
164 setup(...164
165 install_requires=['distribute']165 setup(...
166 install_requires=['setuptools']
167 )
168
169Only if you need Distribute-specific functionality should you depend
170on it explicitly. In this case, replace the Setuptools dependency::
171
172 from setuptools import setup
173
174 setup(...
175 install_requires=['distribute']
166 )176 )
167177
168-----------178-----------
169Install FAQ179Install FAQ
170-----------180-----------
171181
172- **Why Distribute turn my Setuptools installation into an fake one?**182- **Why is Distribute wrapping my Setuptools installation?**
173183
174 Since Distribute is a fork, and since it provides the same package and modules,184 Since Distribute is a fork, and since it provides the same package
175 it fakes that the Setuptools installation is still present, so all the programs185 and modules, it renames the existing Setuptools egg and inserts a
176 that where using Setuptools still work.186 new one which merely wraps the Distribute code. This way, full
177187 backwards compatibility is kept for packages which rely on the
178 If it wasn't doing it, a program that would try to install Setuptools188 Setuptools modules.
179 would overwrite in turn Distribute.189
190 At the same time, packages can meet their dependency on Setuptools
191 without actually installing it (which would disable Distribute).
180192
181- **How does Distribute interact with virtualenv?**193- **How does Distribute interact with virtualenv?**
182194
@@ -190,7 +202,7 @@
190 and if the virtualenv you are in was generated without the `--no-site-packages`202 and if the virtualenv you are in was generated without the `--no-site-packages`
191 option, the Distribute installation will stop.203 option, the Distribute installation will stop.
192204
193 You need in this case to build a virtualenv with the `--no-site-packages` 205 You need in this case to build a virtualenv with the `--no-site-packages`
194 option or to install `Distribute` globally.206 option or to install `Distribute` globally.
195207
196- **How does Distribute interacts with zc.buildout?**208- **How does Distribute interacts with zc.buildout?**
197209
=== modified file 'debian/changelog'
--- debian/changelog 2009-12-05 13:20:47 +0000
+++ debian/changelog 2010-01-19 00:05:23 +0000
@@ -1,3 +1,22 @@
1distribute (0.6.10-1ubuntu1) lucid; urgency=low
2
3 * Merge from Debian Unstable. Remaining Ubuntu changes:
4 - Build only for Python 2.6, since 2.5 and earlier is not supported on
5 Lucid.
6 - Remove old setuptools.egg-info directories so that we can transition
7 to symlinks.
8 - When writing the debian/python-setuptools.substvars, only include
9 variable substitutions for building Python 2.6.
10
11 -- Barry Warsaw <barry@canonical.com> Thu, 14 Jan 2010 16:55:50 -0500
12
13distribute (0.6.10-1) unstable; urgency=low
14
15 * New upstream version.
16 * Stop building for python2.4. Closes: #557000.
17
18 -- Matthias Klose <doko@debian.org> Mon, 28 Dec 2009 23:52:40 +0100
19
1distribute (0.6.8-1ubuntu2) lucid; urgency=low20distribute (0.6.8-1ubuntu2) lucid; urgency=low
221
3 * python-setuptools.preinst (lp: #490731):22 * python-setuptools.preinst (lp: #490731):
@@ -14,6 +33,7 @@
14distribute (0.6.8-1) unstable; urgency=low33distribute (0.6.8-1) unstable; urgency=low
1534
16 * New upstream version.35 * New upstream version.
36 * Stop building for python2.4. Closes: #557000.
1737
18 -- Matthias Klose <doko@debian.org> Thu, 12 Nov 2009 02:12:16 +010038 -- Matthias Klose <doko@debian.org> Thu, 12 Nov 2009 02:12:16 +0100
1939
2040
=== modified file 'debian/control'
--- debian/control 2009-12-05 13:20:47 +0000
+++ debian/control 2010-01-19 00:05:23 +0000
@@ -4,9 +4,9 @@
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Matthias Klose <doko@debian.org>5XSBC-Original-Maintainer: Matthias Klose <doko@debian.org>
6#Build-Depends-Indep: python-all-dev, python2.5-dev, python2.6-dev, python3-all-dev, python-central (>= 0.6.11), python-sphinx6#Build-Depends-Indep: python-all-dev, python2.5-dev, python2.6-dev, python3-all-dev, python-central (>= 0.6.11), python-sphinx
7Build-Depends-Indep: python2.5-dev, python-all-dev, python-central (>= 0.6.11), python-sphinx7Build-Depends-Indep: python-all-dev, python-central (>= 0.6.11), python-sphinx
8Build-Depends: debhelper (>= 5.0.37.1)8Build-Depends: debhelper (>= 5.0.37.1)
9XS-Python-Version: 2.4, 2.5, 2.69XS-Python-Version: 2.6
10Standards-Version: 3.8.310Standards-Version: 3.8.3
11Homepage: http://packages.python.org/distribute11Homepage: http://packages.python.org/distribute
1212
1313
=== modified file 'debian/python-distribute.substvars'
--- debian/python-distribute.substvars 2009-11-12 02:17:43 +0000
+++ debian/python-distribute.substvars 2010-01-19 00:05:23 +0000
@@ -1,2 +1,2 @@
1python:Versions=2.4, 2.4, 2.5, 2.6, 2.5, 2.61python:Versions=2.4, 2.5, 2.5, 2.6, 2.6
2python:Provides=python2.4-distribute, python2.5-distribute2python:Provides=python2.4-distribute, python2.5-distribute
33
=== modified file 'debian/rules'
--- debian/rules 2009-11-12 02:17:43 +0000
+++ debian/rules 2010-01-19 00:05:23 +0000
@@ -19,12 +19,10 @@
19# setuptools doesn't handle translated messages19# setuptools doesn't handle translated messages
20export LC_ALL=C20export LC_ALL=C
2121
22PYVERS := 2.3 2.5 $(shell pyversions -vr debian/control)22PYVERS := $(shell pyversions -vr debian/control)
23XPYVERS := 2.6 2.523XPYVERS := 2.6
24PYVERS := 2.4 2.5
25PYVERS := 2.6
26PYVER := $(shell python -c 'import sys; print sys.version[:3]')24PYVER := $(shell python -c 'import sys; print sys.version[:3]')
27SETUPTOOLSVER=0.6c925SETUPTOOLSVER=0.6c11
28export XPYVERS26export XPYVERS
2927
30include /usr/share/python/python.mk28include /usr/share/python/python.mk
@@ -161,9 +159,9 @@
161159
162 cat $(d_setp).substvars160 cat $(d_setp).substvars
163 ( \161 ( \
164 echo 'python:Versions=2.4, 2.5, 2.6'; \162 echo 'python:Versions=2.6'; \
165 echo 'python:Provides=python2.4-setuptools, python2.5-setuptools, python2.6-setuptools'; \163 echo 'python:Provides=python2.6-setuptools'; \
166 echo 'python:Depends=python (>= 2.4), python (<< 2.7), python-central (>= 0.6.11)'; \164 echo 'python:Depends=python (>= 2.6), python (<< 2.7), python-central (>= 0.6.11)'; \
167 ) > $(d_setp).substvars165 ) > $(d_setp).substvars
168 cat $(d_setp).substvars166 cat $(d_setp).substvars
169# cp $(d_setp).substvars $(d_dist).substvars167# cp $(d_setp).substvars $(d_dist).substvars
170168
=== modified file 'distribute.egg-info/PKG-INFO'
--- distribute.egg-info/PKG-INFO 2009-11-12 02:12:16 +0000
+++ distribute.egg-info/PKG-INFO 2010-01-19 00:05:23 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.01Metadata-Version: 1.0
2Name: distribute2Name: distribute
3Version: 0.6.83Version: 0.6.10
4Summary: Easily download, build, install, upgrade, and uninstall Python packages4Summary: Easily download, build, install, upgrade, and uninstall Python packages
5Home-page: http://packages.python.org/distribute5Home-page: http://packages.python.org/distribute
6Author: The fellowship of the packaging6Author: The fellowship of the packaging
@@ -115,9 +115,9 @@
115 115
116 Download the source tarball, uncompress it, then run the install command::116 Download the source tarball, uncompress it, then run the install command::
117 117
118 $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.8.tar.gz118 $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
119 $ tar -xzvf distribute-0.6.8.tar.gz119 $ tar -xzvf distribute-0.6.10.tar.gz
120 $ cd distribute-0.6.8120 $ cd distribute-0.6.10
121 $ python setup.py install121 $ python setup.py install
122 122
123 ---------------------------123 ---------------------------
@@ -157,15 +157,25 @@
157 Quick help for developers157 Quick help for developers
158 -------------------------158 -------------------------
159 159
160 To use Distribute in your package, the recommended way is to ship160 To create an egg which is compatible with Distribute, use the same
161 `distribute_setup.py` alongside your `setup.py` script and call161 practice as with Setuptools, e.g.::
162 it at the very begining of `setup.py` like this::162
163 163 from setuptools import setup
164 from distribute_setup import use_setuptools164
165 use_setuptools()165 setup(...
166 166 )
167 167
168 Another way is to add ``Distribute`` in the ``install_requires`` option::168 To use `pkg_resources` to access data files in the egg, you should
169 require the Setuptools distribution explicitly::
170
171 from setuptools import setup
172
173 setup(...
174 install_requires=['setuptools']
175 )
176
177 Only if you need Distribute-specific functionality should you depend
178 on it explicitly. In this case, replace the Setuptools dependency::
169 179
170 from setuptools import setup180 from setuptools import setup
171 181
@@ -177,14 +187,16 @@
177 Install FAQ187 Install FAQ
178 -----------188 -----------
179 189
180 - **Why Distribute turn my Setuptools installation into an fake one?**190 - **Why is Distribute wrapping my Setuptools installation?**
181 191
182 Since Distribute is a fork, and since it provides the same package and modules,192 Since Distribute is a fork, and since it provides the same package
183 it fakes that the Setuptools installation is still present, so all the programs193 and modules, it renames the existing Setuptools egg and inserts a
184 that where using Setuptools still work.194 new one which merely wraps the Distribute code. This way, full
185 195 backwards compatibility is kept for packages which rely on the
186 If it wasn't doing it, a program that would try to install Setuptools196 Setuptools modules.
187 would overwrite in turn Distribute.197
198 At the same time, packages can meet their dependency on Setuptools
199 without actually installing it (which would disable Distribute).
188 200
189 - **How does Distribute interact with virtualenv?**201 - **How does Distribute interact with virtualenv?**
190 202
@@ -236,6 +248,41 @@
236 CHANGES248 CHANGES
237 =======249 =======
238 250
251 ------
252 0.6.10
253 ------
254
255 * Reverted change made for the DistributionNotFound exception because
256 zc.buildout uses the exception message to get the name of the
257 distribution.
258
259 -----
260 0.6.9
261 -----
262
263 * Issue 90: unknown setuptools version can be added in the working set
264 * Issue 87: setupt.py doesn't try to convert distribute_setup.py anymore
265 Initial Patch by arfrever.
266 * Issue 89: added a side bar with a download link to the doc.
267 * Issue 86: fixed missing sentence in pkg_resources doc.
268 * Added a nicer error message when a DistributionNotFound is raised.
269 * Issue 80: test_develop now works with Python 3.1
270 * Issue 93: upload_docs now works if there is an empty sub-directory.
271 * Issue 70: exec bit on non-exec files
272 * Issue 99: now the standalone easy_install command doesn't uses a
273 "setup.cfg" if any exists in the working directory. It will use it
274 only if triggered by ``install_requires`` from a setup.py call
275 (install, develop, etc).
276 * Issue 101: Allowing ``os.devnull`` in Sandbox
277 * Issue 92: Fixed the "no eggs" found error with MacPort
278 (platform.mac_ver() fails)
279 * Issue 103: test_get_script_header_jython_workaround not run
280 anymore under py3 with C or POSIX local. Contributed by Arfrever.
281 * Issue 104: remvoved the assertion when the installation fails,
282 with a nicer message for the end user.
283 * Issue 100: making sure there's no SandboxViolation when
284 the setup script patches setuptools.
285
239 -----286 -----
240 0.6.8287 0.6.8
241 -----288 -----
242289
=== modified file 'distribute.egg-info/SOURCES.txt'
--- distribute.egg-info/SOURCES.txt 2009-11-12 02:12:16 +0000
+++ distribute.egg-info/SOURCES.txt 2010-01-19 00:05:23 +0000
@@ -4,11 +4,8 @@
4MANIFEST.in4MANIFEST.in
5README.txt5README.txt
6distribute_setup.py6distribute_setup.py
7distribute_setup_dev.py
8easy_install.py7easy_install.py
9launcher.c8launcher.c
10ll.txt
11ok.txt
12pkg_resources.py9pkg_resources.py
13setup.cfg10setup.cfg
14setup.py11setup.py
@@ -39,7 +36,7 @@
39docs/build/html/_sources/setuptools.txt36docs/build/html/_sources/setuptools.txt
40docs/build/html/_sources/using.txt37docs/build/html/_sources/using.txt
41docs/build/html/_static/basic.css38docs/build/html/_static/basic.css
42docs/build/html/_static/default.css39docs/build/html/_static/nature.css
43docs/build/html/_static/pygments.css40docs/build/html/_static/pygments.css
44setuptools/__init__.py41setuptools/__init__.py
45setuptools/archive_util.py42setuptools/archive_util.py
@@ -79,6 +76,8 @@
79setuptools/tests/test_easy_install.py76setuptools/tests/test_easy_install.py
80setuptools/tests/test_packageindex.py77setuptools/tests/test_packageindex.py
81setuptools/tests/test_resources.py78setuptools/tests/test_resources.py
79setuptools/tests/test_sandbox.py
80setuptools/tests/test_upload_docs.py
82setuptools/tests/win_script_wrapper.txt81setuptools/tests/win_script_wrapper.txt
83tests/api_tests.txt82tests/api_tests.txt
84tests/install_test.py83tests/install_test.py
8584
=== modified file 'distribute.egg-info/entry_points.txt'
--- distribute.egg-info/entry_points.txt 2009-10-20 00:12:26 +0000
+++ distribute.egg-info/entry_points.txt 2010-01-19 00:05:23 +0000
@@ -33,7 +33,6 @@
33[console_scripts]33[console_scripts]
34easy_install = setuptools.command.easy_install:main34easy_install = setuptools.command.easy_install:main
35easy_install-2.5 = setuptools.command.easy_install:main35easy_install-2.5 = setuptools.command.easy_install:main
36easy_install-2.4 = setuptools.command.easy_install:main
37easy_install-2.6 = setuptools.command.easy_install:main36easy_install-2.6 = setuptools.command.easy_install:main
3837
39[setuptools.file_finders]38[setuptools.file_finders]
@@ -54,6 +53,7 @@
54eager_resources = setuptools.dist:assert_string_list53eager_resources = setuptools.dist:assert_string_list
55zip_safe = setuptools.dist:assert_bool54zip_safe = setuptools.dist:assert_bool
56test_loader = setuptools.dist:check_importable55test_loader = setuptools.dist:check_importable
56packages = setuptools.dist:check_packages
57convert_2to3_doctests = setuptools.dist:assert_string_list57convert_2to3_doctests = setuptools.dist:assert_string_list
58tests_require = setuptools.dist:check_requirements58tests_require = setuptools.dist:check_requirements
5959
6060
=== modified file 'distribute_setup.py'
--- distribute_setup.py 2009-11-12 02:12:16 +0000
+++ distribute_setup.py 2010-01-19 00:05:23 +0000
@@ -46,19 +46,21 @@
46 args = [quote(arg) for arg in args]46 args = [quote(arg) for arg in args]
47 return os.spawnl(os.P_WAIT, sys.executable, *args) == 047 return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
4848
49DEFAULT_VERSION = "0.6.8"49DEFAULT_VERSION = "0.6.10"
50DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"50DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
51SETUPTOOLS_FAKED_VERSION = "0.6c11"
52
51SETUPTOOLS_PKG_INFO = """\53SETUPTOOLS_PKG_INFO = """\
52Metadata-Version: 1.054Metadata-Version: 1.0
53Name: setuptools55Name: setuptools
54Version: 0.6c956Version: %s
55Summary: xxxx57Summary: xxxx
56Home-page: xxx58Home-page: xxx
57Author: xxx59Author: xxx
58Author-email: xxx60Author-email: xxx
59License: xxx61License: xxx
60Description: xxx62Description: xxx
61"""63""" % SETUPTOOLS_FAKED_VERSION
6264
6365
64def _install(tarball):66def _install(tarball):
@@ -79,7 +81,9 @@
7981
80 # installing82 # installing
81 log.warn('Installing Distribute')83 log.warn('Installing Distribute')
82 assert _python_cmd('setup.py', 'install')84 if not _python_cmd('setup.py', 'install'):
85 log.warn('Something went wrong during the installation.')
86 log.warn('See the error message above.')
83 finally:87 finally:
84 os.chdir(old_wd)88 os.chdir(old_wd)
8589
@@ -220,22 +224,34 @@
220def _same_content(path, content):224def _same_content(path, content):
221 return open(path).read() == content225 return open(path).read() == content
222226
223227def _no_sandbox(function):
228 def __no_sandbox(*args, **kw):
229 try:
230 from setuptools.sandbox import DirectorySandbox
231 def violation(*args):
232 pass
233 DirectorySandbox._old = DirectorySandbox._violation
234 DirectorySandbox._violation = violation
235 patched = True
236 except ImportError:
237 patched = False
238
239 try:
240 return function(*args, **kw)
241 finally:
242 if patched:
243 DirectorySandbox._violation = DirectorySandbox._old
244 del DirectorySandbox._old
245
246 return __no_sandbox
247
248@_no_sandbox
224def _rename_path(path):249def _rename_path(path):
225 new_name = path + '.OLD.%s' % time.time()250 new_name = path + '.OLD.%s' % time.time()
226 log.warn('Renaming %s into %s', path, new_name)251 log.warn('Renaming %s into %s', path, new_name)
227 try:
228 from setuptools.sandbox import DirectorySandbox
229 def _violation(*args):
230 pass
231 DirectorySandbox._violation = _violation
232 except ImportError:
233 pass
234
235 os.rename(path, new_name)252 os.rename(path, new_name)
236 return new_name253 return new_name
237254
238
239def _remove_flat_installation(placeholder):255def _remove_flat_installation(placeholder):
240 if not os.path.isdir(placeholder):256 if not os.path.isdir(placeholder):
241 log.warn('Unkown installation at %s', placeholder)257 log.warn('Unkown installation at %s', placeholder)
@@ -275,22 +291,25 @@
275 placeholder = dist.get_command_obj('install').install_purelib291 placeholder = dist.get_command_obj('install').install_purelib
276 _create_fake_setuptools_pkg_info(placeholder)292 _create_fake_setuptools_pkg_info(placeholder)
277293
294@_no_sandbox
278def _create_fake_setuptools_pkg_info(placeholder):295def _create_fake_setuptools_pkg_info(placeholder):
279 if not placeholder or not os.path.exists(placeholder):296 if not placeholder or not os.path.exists(placeholder):
280 log.warn('Could not find the install location')297 log.warn('Could not find the install location')
281 return298 return
282 pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])299 pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
283 setuptools_file = 'setuptools-0.6c9.egg-info'300 setuptools_file = 'setuptools-%s.egg-info' % SETUPTOOLS_FAKED_VERSION
284 pkg_info = os.path.join(placeholder, setuptools_file)301 pkg_info = os.path.join(placeholder, setuptools_file)
285 if os.path.exists(pkg_info):302 if os.path.exists(pkg_info):
286 log.warn('%s already exists', pkg_info)303 log.warn('%s already exists', pkg_info)
287 return304 return
305
288 log.warn('Creating %s', pkg_info)306 log.warn('Creating %s', pkg_info)
289 f = open(pkg_info, 'w')307 f = open(pkg_info, 'w')
290 try:308 try:
291 f.write(SETUPTOOLS_PKG_INFO)309 f.write(SETUPTOOLS_PKG_INFO)
292 finally:310 finally:
293 f.close()311 f.close()
312
294 pth_file = os.path.join(placeholder, 'setuptools.pth')313 pth_file = os.path.join(placeholder, 'setuptools.pth')
295 log.warn('Creating %s', pth_file)314 log.warn('Creating %s', pth_file)
296 f = open(pth_file, 'w')315 f = open(pth_file, 'w')
@@ -299,7 +318,6 @@
299 finally:318 finally:
300 f.close()319 f.close()
301320
302
303def _patch_egg_dir(path):321def _patch_egg_dir(path):
304 # let's check if it's already patched322 # let's check if it's already patched
305 pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')323 pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
306324
=== removed file 'distribute_setup_dev.py'
--- distribute_setup_dev.py 2009-11-12 02:12:16 +0000
+++ distribute_setup_dev.py 1970-01-01 00:00:00 +0000
@@ -1,458 +0,0 @@
1#!python
2"""Bootstrap distribute installation
3
4If you want to use setuptools in your package's setup.py, just include this
5file in the same directory with it, and add this to the top of your setup.py::
6
7 from distribute_setup import use_setuptools
8 use_setuptools()
9
10If you want to require a specific version of setuptools, set a download
11mirror, or use an alternate download directory, you can do so by supplying
12the appropriate options to ``use_setuptools()``.
13
14This file can also be run as a script to install or upgrade setuptools.
15"""
16import os
17import sys
18import time
19import fnmatch
20import tempfile
21import tarfile
22from distutils import log
23
24try:
25 from site import USER_SITE
26except ImportError:
27 USER_SITE = None
28
29try:
30 import subprocess
31
32 def _python_cmd(*args):
33 args = (sys.executable,) + args
34 return subprocess.call(args) == 0
35
36except ImportError:
37 # will be used for python 2.3
38 def _python_cmd(*args):
39 args = (sys.executable,) + args
40 # quoting arguments if windows
41 if sys.platform == 'win32':
42 def quote(arg):
43 if ' ' in arg:
44 return '"%s"' % arg
45 return arg
46 args = [quote(arg) for arg in args]
47 return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
48
49DEFAULT_VERSION = "0.6.7dev"
50DEFAULT_URL = "http://python-distribute.org/"
51SETUPTOOLS_PKG_INFO = """\
52Metadata-Version: 1.0
53Name: setuptools
54Version: 0.6c9
55Summary: xxxx
56Home-page: xxx
57Author: xxx
58Author-email: xxx
59License: xxx
60Description: xxx
61"""
62
63
64def _install(tarball):
65 # extracting the tarball
66 tmpdir = tempfile.mkdtemp()
67 log.warn('Extracting in %s', tmpdir)
68 old_wd = os.getcwd()
69 try:
70 os.chdir(tmpdir)
71 tar = tarfile.open(tarball)
72 _extractall(tar)
73 tar.close()
74
75 # going in the directory
76 subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
77 os.chdir(subdir)
78 log.warn('Now working in %s', subdir)
79
80 # installing
81 log.warn('Installing Distribute')
82 assert _python_cmd('setup.py', 'install')
83 finally:
84 os.chdir(old_wd)
85
86
87def _build_egg(egg, tarball, to_dir):
88 # extracting the tarball
89 tmpdir = tempfile.mkdtemp()
90 log.warn('Extracting in %s', tmpdir)
91 old_wd = os.getcwd()
92 try:
93 os.chdir(tmpdir)
94 tar = tarfile.open(tarball)
95 _extractall(tar)
96 tar.close()
97
98 # going in the directory
99 subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
100 os.chdir(subdir)
101 log.warn('Now working in %s', subdir)
102
103 # building an egg
104 log.warn('Building a Distribute egg in %s', to_dir)
105 _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
106
107 finally:
108 os.chdir(old_wd)
109 # returning the result
110 log.warn(egg)
111 if not os.path.exists(egg):
112 raise IOError('Could not build the egg.')
113
114
115def _do_download(version, download_base, to_dir, download_delay):
116 egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
117 % (version, sys.version_info[0], sys.version_info[1]))
118 if not os.path.exists(egg):
119 tarball = download_setuptools(version, download_base,
120 to_dir, download_delay)
121 _build_egg(egg, tarball, to_dir)
122 sys.path.insert(0, egg)
123 import setuptools
124 setuptools.bootstrap_install_from = egg
125
126
127def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
128 to_dir=os.curdir, download_delay=15, no_fake=True):
129 # making sure we use the absolute path
130 to_dir = os.path.abspath(to_dir)
131 was_imported = 'pkg_resources' in sys.modules or \
132 'setuptools' in sys.modules
133 try:
134 try:
135 import pkg_resources
136 if not hasattr(pkg_resources, '_distribute'):
137 if not no_fake:
138 _fake_setuptools()
139 raise ImportError
140 except ImportError:
141 return _do_download(version, download_base, to_dir, download_delay)
142 try:
143 pkg_resources.require("distribute>="+version)
144 return
145 except pkg_resources.VersionConflict:
146 e = sys.exc_info()[1]
147 if was_imported:
148 sys.stderr.write(
149 "The required version of distribute (>=%s) is not available,\n"
150 "and can't be installed while this script is running. Please\n"
151 "install a more recent version first, using\n"
152 "'easy_install -U distribute'."
153 "\n\n(Currently using %r)\n" % (version, e.args[0]))
154 sys.exit(2)
155 else:
156 del pkg_resources, sys.modules['pkg_resources'] # reload ok
157 return _do_download(version, download_base, to_dir,
158 download_delay)
159 except pkg_resources.DistributionNotFound:
160 return _do_download(version, download_base, to_dir,
161 download_delay)
162 finally:
163 if not no_fake:
164 _create_fake_setuptools_pkg_info(to_dir)
165
166def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
167 to_dir=os.curdir, delay=15):
168 """Download distribute from a specified location and return its filename
169
170 `version` should be a valid distribute version number that is available
171 as an egg for download under the `download_base` URL (which should end
172 with a '/'). `to_dir` is the directory where the egg will be downloaded.
173 `delay` is the number of seconds to pause before an actual download
174 attempt.
175 """
176 # making sure we use the absolute path
177 to_dir = os.path.abspath(to_dir)
178 try:
179 from urllib.request import urlopen
180 except ImportError:
181 from urllib2 import urlopen
182 tgz_name = "distribute-%s.tar.gz" % version
183 url = download_base + tgz_name
184 saveto = os.path.join(to_dir, tgz_name)
185 src = dst = None
186 if not os.path.exists(saveto): # Avoid repeated downloads
187 try:
188 log.warn("Downloading %s", url)
189 src = urlopen(url)
190 # Read/write all in one block, so we don't create a corrupt file
191 # if the download is interrupted.
192 data = src.read()
193 dst = open(saveto, "wb")
194 dst.write(data)
195 finally:
196 if src:
197 src.close()
198 if dst:
199 dst.close()
200 return os.path.realpath(saveto)
201
202
203def _patch_file(path, content):
204 """Will backup the file then patch it"""
205 existing_content = open(path).read()
206 if existing_content == content:
207 # already patched
208 log.warn('Already patched.')
209 return False
210 log.warn('Patching...')
211 _rename_path(path)
212 f = open(path, 'w')
213 try:
214 f.write(content)
215 finally:
216 f.close()
217 return True
218
219
220def _same_content(path, content):
221 return open(path).read() == content
222
223
224def _rename_path(path):
225 new_name = path + '.OLD.%s' % time.time()
226 log.warn('Renaming %s into %s', path, new_name)
227 try:
228 from setuptools.sandbox import DirectorySandbox
229 def _violation(*args):
230 pass
231 DirectorySandbox._violation = _violation
232 except ImportError:
233 pass
234
235 os.rename(path, new_name)
236 return new_name
237
238
239def _remove_flat_installation(placeholder):
240 if not os.path.isdir(placeholder):
241 log.warn('Unkown installation at %s', placeholder)
242 return False
243 found = False
244 for file in os.listdir(placeholder):
245 if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
246 found = True
247 break
248 if not found:
249 log.warn('Could not locate setuptools*.egg-info')
250 return
251
252 log.warn('Removing elements out of the way...')
253 pkg_info = os.path.join(placeholder, file)
254 if os.path.isdir(pkg_info):
255 patched = _patch_egg_dir(pkg_info)
256 else:
257 patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
258
259 if not patched:
260 log.warn('%s already patched.', pkg_info)
261 return False
262 # now let's move the files out of the way
263 for element in ('setuptools', 'pkg_resources.py', 'site.py'):
264 element = os.path.join(placeholder, element)
265 if os.path.exists(element):
266 _rename_path(element)
267 else:
268 log.warn('Could not find the %s element of the '
269 'Setuptools distribution', element)
270 return True
271
272
273def _after_install(dist):
274 log.warn('After install bootstrap.')
275 placeholder = dist.get_command_obj('install').install_purelib
276 _create_fake_setuptools_pkg_info(placeholder)
277
278def _create_fake_setuptools_pkg_info(placeholder):
279 if not placeholder or not os.path.exists(placeholder):
280 log.warn('Could not find the install location')
281 return
282 pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
283 setuptools_file = 'setuptools-0.6c9.egg-info'
284 pkg_info = os.path.join(placeholder, setuptools_file)
285 if os.path.exists(pkg_info):
286 log.warn('%s already exists', pkg_info)
287 return
288 log.warn('Creating %s', pkg_info)
289 f = open(pkg_info, 'w')
290 try:
291 f.write(SETUPTOOLS_PKG_INFO)
292 finally:
293 f.close()
294 pth_file = os.path.join(placeholder, 'setuptools.pth')
295 log.warn('Creating %s', pth_file)
296 f = open(pth_file, 'w')
297 try:
298 f.write(os.path.join(os.curdir, setuptools_file))
299 finally:
300 f.close()
301
302
303def _patch_egg_dir(path):
304 # let's check if it's already patched
305 pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
306 if os.path.exists(pkg_info):
307 if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
308 log.warn('%s already patched.', pkg_info)
309 return False
310 _rename_path(path)
311 os.mkdir(path)
312 os.mkdir(os.path.join(path, 'EGG-INFO'))
313 pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
314 f = open(pkg_info, 'w')
315 try:
316 f.write(SETUPTOOLS_PKG_INFO)
317 finally:
318 f.close()
319 return True
320
321
322def _before_install():
323 log.warn('Before install bootstrap.')
324 _fake_setuptools()
325
326
327def _under_prefix(location):
328 if 'install' not in sys.argv:
329 return True
330 args = sys.argv[sys.argv.index('install')+1:]
331 for index, arg in enumerate(args):
332 for option in ('--root', '--prefix'):
333 if arg.startswith('%s=' % option):
334 top_dir = arg.split('root=')[-1]
335 return location.startswith(top_dir)
336 elif arg == option:
337 if len(args) > index:
338 top_dir = args[index+1]
339 return location.startswith(top_dir)
340 elif option == '--user' and USER_SITE is not None:
341 return location.startswith(USER_SITE)
342 return True
343
344
345def _fake_setuptools():
346 log.warn('Scanning installed packages')
347 try:
348 import pkg_resources
349 except ImportError:
350 # we're cool
351 log.warn('Setuptools or Distribute does not seem to be installed.')
352 return
353 ws = pkg_resources.working_set
354 try:
355 setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
356 replacement=False))
357 except TypeError:
358 # old distribute API
359 setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
360
361 if setuptools_dist is None:
362 log.warn('No setuptools distribution found')
363 return
364 # detecting if it was already faked
365 setuptools_location = setuptools_dist.location
366 log.warn('Setuptools installation detected at %s', setuptools_location)
367
368 # if --root or --preix was provided, and if
369 # setuptools is not located in them, we don't patch it
370 if not _under_prefix(setuptools_location):
371 log.warn('Not patching, --root or --prefix is installing Distribute'
372 ' in another location')
373 return
374
375 # let's see if its an egg
376 if not setuptools_location.endswith('.egg'):
377 log.warn('Non-egg installation')
378 res = _remove_flat_installation(setuptools_location)
379 if not res:
380 return
381 else:
382 log.warn('Egg installation')
383 pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
384 if (os.path.exists(pkg_info) and
385 _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
386 log.warn('Already patched.')
387 return
388 log.warn('Patching...')
389 # let's create a fake egg replacing setuptools one
390 res = _patch_egg_dir(setuptools_location)
391 if not res:
392 return
393 log.warn('Patched done.')
394 _relaunch()
395
396
397def _relaunch():
398 log.warn('Relaunching...')
399 # we have to relaunch the process
400 args = [sys.executable] + sys.argv
401 sys.exit(subprocess.call(args))
402
403
404def _extractall(self, path=".", members=None):
405 """Extract all members from the archive to the current working
406 directory and set owner, modification time and permissions on
407 directories afterwards. `path' specifies a different directory
408 to extract to. `members' is optional and must be a subset of the
409 list returned by getmembers().
410 """
411 import copy
412 import operator
413 from tarfile import ExtractError
414 directories = []
415
416 if members is None:
417 members = self
418
419 for tarinfo in members:
420 if tarinfo.isdir():
421 # Extract directories with a safe mode.
422 directories.append(tarinfo)
423 tarinfo = copy.copy(tarinfo)
424 tarinfo.mode = 448 # decimal for oct 0700
425 self.extract(tarinfo, path)
426
427 # Reverse sort directories.
428 if sys.version_info < (2, 4):
429 def sorter(dir1, dir2):
430 return cmp(dir1.name, dir2.name)
431 directories.sort(sorter)
432 directories.reverse()
433 else:
434 directories.sort(key=operator.attrgetter('name'), reverse=True)
435
436 # Set correct owner, mtime and filemode on directories.
437 for tarinfo in directories:
438 dirpath = os.path.join(path, tarinfo.name)
439 try:
440 self.chown(tarinfo, dirpath)
441 self.utime(tarinfo, dirpath)
442 self.chmod(tarinfo, dirpath)
443 except ExtractError:
444 e = sys.exc_info()[1]
445 if self.errorlevel > 1:
446 raise
447 else:
448 self._dbg(1, "tarfile: %s" % e)
449
450
451def main(argv, version=DEFAULT_VERSION):
452 """Install or upgrade setuptools and EasyInstall"""
453 tarball = download_setuptools()
454 _install(tarball)
455
456
457if __name__ == '__main__':
458 main(sys.argv[1:])
4590
=== added directory 'docs/_templates'
=== added file 'docs/_templates/indexsidebar.html'
--- docs/_templates/indexsidebar.html 1970-01-01 00:00:00 +0000
+++ docs/_templates/indexsidebar.html 2010-01-19 00:05:23 +0000
@@ -0,0 +1,8 @@
1<h3>Download</h3>
2
3<p>Current version: <b>{{ version }}</b></p>
4<p>Get Distribute from the <a href="http://pypi.python.org/pypi/distribute"> Python Package Index</a>
5
6<h3>Questions? Suggestions? Contributions?</h3>
7
8<p>Visit the <a href="http://bitbucket.org/tarek/distribute">Distribute project page</a> </p>
09
=== modified file 'docs/build/html/_sources/easy_install.txt'
--- docs/build/html/_sources/easy_install.txt 2009-11-12 02:12:16 +0000
+++ docs/build/html/_sources/easy_install.txt 2010-01-19 00:05:23 +0000
@@ -628,6 +628,9 @@
628For more information, see also the current Python documentation on the `use and628For more information, see also the current Python documentation on the `use and
629location of distutils configuration files <http://docs.python.org/inst/config-syntax.html>`_.629location of distutils configuration files <http://docs.python.org/inst/config-syntax.html>`_.
630630
631Notice that ``easy_install`` will use the ``setup.cfg`` from the current
632working directory only if it was triggered from ``setup.py`` through the
633``install_requires`` option. The standalone command will not use that file.
631634
632Command-Line Options635Command-Line Options
633--------------------636--------------------
@@ -904,7 +907,7 @@
904 projects, not in-development ones, because such projects may not907 projects, not in-development ones, because such projects may not
905 have a currently-valid version number. So, it usually only installs them908 have a currently-valid version number. So, it usually only installs them
906 when their ``setup.py`` directory is explicitly passed on the command line.909 when their ``setup.py`` directory is explicitly passed on the command line.
907 910
908 However, if this option is used, then any in-development projects that were911 However, if this option is used, then any in-development projects that were
909 installed using the ``setup.py develop`` command, will be used to build912 installed using the ``setup.py develop`` command, will be used to build
910 eggs, effectively upgrading the "in-development" project to a snapshot913 eggs, effectively upgrading the "in-development" project to a snapshot
@@ -1257,7 +1260,7 @@
1257 installed using ``setup.py develop``.1260 installed using ``setup.py develop``.
12581261
1259 * Fixed not HTML-decoding URLs scraped from web pages1262 * Fixed not HTML-decoding URLs scraped from web pages
1260 1263
12610.6c512640.6c5
1262 * Fixed ``.dll`` files on Cygwin not having executable permisions when an egg1265 * Fixed ``.dll`` files on Cygwin not having executable permisions when an egg
1263 is installed unzipped.1266 is installed unzipped.
12641267
=== modified file 'docs/build/html/_sources/index.txt'
--- docs/build/html/_sources/index.txt 2009-10-20 00:12:26 +0000
+++ docs/build/html/_sources/index.txt 2010-01-19 00:05:23 +0000
@@ -1,7 +1,23 @@
1Welcome to Distribute's documentation!1Welcome to Distribute's documentation!
2======================================2======================================
33
4Contents:4`Distribute` is a fork of the `Setuptools` project.
5
6Distribute is intended to replace Setuptools as the standard method for
7working with Python module distributions.
8
9For those who may wonder why they should switch to Distribute over Setuptools, it’s quite simple:
10
11- Distribute is a drop-in replacement for Setuptools
12- The code is actively maintained, and has over 10 commiters
13- Distribute offers Python 3 support !
14
15.. image:: http://python-distribute.org/pip_distribute.png
16
17Design done by Idan Gazit (http://pixane.com) - License: cc-by-3.0
18
19
20Documentation content:
521
6.. toctree::22.. toctree::
7 :maxdepth: 223 :maxdepth: 2
824
=== modified file 'docs/build/html/_sources/pkg_resources.txt'
--- docs/build/html/_sources/pkg_resources.txt 2009-10-20 00:12:26 +0000
+++ docs/build/html/_sources/pkg_resources.txt 2010-01-19 00:05:23 +0000
@@ -1594,8 +1594,9 @@
1594 ``Requirement`` string, as a distribution name, or a PyPI project name.1594 ``Requirement`` string, as a distribution name, or a PyPI project name.
1595 All non-alphanumeric runs are condensed to single "-" characters, such that1595 All non-alphanumeric runs are condensed to single "-" characters, such that
1596 a name like "The $$$ Tree" becomes "The-Tree". Note that if you are1596 a name like "The $$$ Tree" becomes "The-Tree". Note that if you are
1597 generating a filename from this value you should replace the "-" characters1597 generating a filename from this value you should combine it with a call to
1598 with underscores ("_") because setuptools and the distutils1598 ``to_filename()`` so all dashes ("-") are replaced by underscores ("_").
1599 See ``to_filename()``.
15991600
1600``safe_version(version)``1601``safe_version(version)``
1601 Similar to ``safe_name()`` except that spaces in the input become dots, and1602 Similar to ``safe_name()`` except that spaces in the input become dots, and
@@ -1708,7 +1709,7 @@
17081709
1709 * Fix cache dir defaults on Windows when multiple environment vars are needed1710 * Fix cache dir defaults on Windows when multiple environment vars are needed
1710 to construct a path.1711 to construct a path.
1711 1712
17120.6c417130.6c4
1713 * Fix "dev" versions being considered newer than release candidates.1714 * Fix "dev" versions being considered newer than release candidates.
17141715
17151716
=== modified file 'docs/build/html/_sources/roadmap.txt'
--- docs/build/html/_sources/roadmap.txt 2009-10-24 13:13:23 +0000
+++ docs/build/html/_sources/roadmap.txt 2010-01-19 00:05:23 +0000
@@ -4,7 +4,7 @@
44
5Distribute has two branches:5Distribute has two branches:
66
7- 0.6.x : provides a Setuptools-0.6c9 compatible version7- 0.6.x : provides a Setuptools-0.6cX compatible version
8- 0.7.x : will provide a refactoring8- 0.7.x : will provide a refactoring
99
100.6.x100.6.x
@@ -69,7 +69,7 @@
69 reorganized in clean, pep-8 modules. This package will69 reorganized in clean, pep-8 modules. This package will
70 only contain the query APIs and will focus on being PEP 37670 only contain the query APIs and will focus on being PEP 376
71 compatible. We will promote its usage and see if Pip wants71 compatible. We will promote its usage and see if Pip wants
72 to use it as a basis. 72 to use it as a basis.
73 It will probably shrink a lot though, once the stdlib provides PEP 376 support.73 It will probably shrink a lot though, once the stdlib provides PEP 376 support.
7474
75 - distribute.entrypoints: that's the old pkg_resources entry points75 - distribute.entrypoints: that's the old pkg_resources entry points
7676
=== modified file 'docs/conf.py'
--- docs/conf.py 2009-11-12 02:12:16 +0000
+++ docs/conf.py 2010-01-19 00:05:23 +0000
@@ -48,7 +48,7 @@
48# built documents.48# built documents.
49#49#
50# The short X.Y version.50# The short X.Y version.
51version = '0.6.8'51version = '0.6.10'
52# The full version, including alpha/beta/rc tags.52# The full version, including alpha/beta/rc tags.
53release = '0.6.4'53release = '0.6.4'
5454
@@ -94,7 +94,7 @@
9494
95# The theme to use for HTML and HTML Help pages. Major themes that come with95# The theme to use for HTML and HTML Help pages. Major themes that come with
96# Sphinx are currently 'default' and 'sphinxdoc'.96# Sphinx are currently 'default' and 'sphinxdoc'.
97html_theme = 'default'97html_theme = 'nature'
9898
99# Theme options are theme-specific and customize the look and feel of a theme99# Theme options are theme-specific and customize the look and feel of a theme
100# further. For a list of options available for each theme, see the100# further. For a list of options available for each theme, see the
@@ -134,7 +134,8 @@
134#html_use_smartypants = True134#html_use_smartypants = True
135135
136# Custom sidebar templates, maps document names to template names.136# Custom sidebar templates, maps document names to template names.
137#html_sidebars = {}137html_sidebars = {'index': 'indexsidebar.html'}
138
138139
139# Additional templates that should be rendered to pages, maps page names to140# Additional templates that should be rendered to pages, maps page names to
140# template names.141# template names.
141142
=== modified file 'docs/easy_install.txt'
--- docs/easy_install.txt 2009-11-12 02:12:16 +0000
+++ docs/easy_install.txt 2010-01-19 00:05:23 +0000
@@ -628,6 +628,9 @@
628For more information, see also the current Python documentation on the `use and628For more information, see also the current Python documentation on the `use and
629location of distutils configuration files <http://docs.python.org/inst/config-syntax.html>`_.629location of distutils configuration files <http://docs.python.org/inst/config-syntax.html>`_.
630630
631Notice that ``easy_install`` will use the ``setup.cfg`` from the current
632working directory only if it was triggered from ``setup.py`` through the
633``install_requires`` option. The standalone command will not use that file.
631634
632Command-Line Options635Command-Line Options
633--------------------636--------------------
@@ -904,7 +907,7 @@
904 projects, not in-development ones, because such projects may not907 projects, not in-development ones, because such projects may not
905 have a currently-valid version number. So, it usually only installs them908 have a currently-valid version number. So, it usually only installs them
906 when their ``setup.py`` directory is explicitly passed on the command line.909 when their ``setup.py`` directory is explicitly passed on the command line.
907 910
908 However, if this option is used, then any in-development projects that were911 However, if this option is used, then any in-development projects that were
909 installed using the ``setup.py develop`` command, will be used to build912 installed using the ``setup.py develop`` command, will be used to build
910 eggs, effectively upgrading the "in-development" project to a snapshot913 eggs, effectively upgrading the "in-development" project to a snapshot
@@ -1257,7 +1260,7 @@
1257 installed using ``setup.py develop``.1260 installed using ``setup.py develop``.
12581261
1259 * Fixed not HTML-decoding URLs scraped from web pages1262 * Fixed not HTML-decoding URLs scraped from web pages
1260 1263
12610.6c512640.6c5
1262 * Fixed ``.dll`` files on Cygwin not having executable permisions when an egg1265 * Fixed ``.dll`` files on Cygwin not having executable permisions when an egg
1263 is installed unzipped.1266 is installed unzipped.
12641267
=== modified file 'docs/index.txt'
--- docs/index.txt 2009-10-20 00:12:26 +0000
+++ docs/index.txt 2010-01-19 00:05:23 +0000
@@ -1,7 +1,23 @@
1Welcome to Distribute's documentation!1Welcome to Distribute's documentation!
2======================================2======================================
33
4Contents:4`Distribute` is a fork of the `Setuptools` project.
5
6Distribute is intended to replace Setuptools as the standard method for
7working with Python module distributions.
8
9For those who may wonder why they should switch to Distribute over Setuptools, it’s quite simple:
10
11- Distribute is a drop-in replacement for Setuptools
12- The code is actively maintained, and has over 10 commiters
13- Distribute offers Python 3 support !
14
15.. image:: http://python-distribute.org/pip_distribute.png
16
17Design done by Idan Gazit (http://pixane.com) - License: cc-by-3.0
18
19
20Documentation content:
521
6.. toctree::22.. toctree::
7 :maxdepth: 223 :maxdepth: 2
824
=== modified file 'docs/pkg_resources.txt'
--- docs/pkg_resources.txt 2009-10-20 00:12:26 +0000
+++ docs/pkg_resources.txt 2010-01-19 00:05:23 +0000
@@ -1594,8 +1594,9 @@
1594 ``Requirement`` string, as a distribution name, or a PyPI project name.1594 ``Requirement`` string, as a distribution name, or a PyPI project name.
1595 All non-alphanumeric runs are condensed to single "-" characters, such that1595 All non-alphanumeric runs are condensed to single "-" characters, such that
1596 a name like "The $$$ Tree" becomes "The-Tree". Note that if you are1596 a name like "The $$$ Tree" becomes "The-Tree". Note that if you are
1597 generating a filename from this value you should replace the "-" characters1597 generating a filename from this value you should combine it with a call to
1598 with underscores ("_") because setuptools and the distutils1598 ``to_filename()`` so all dashes ("-") are replaced by underscores ("_").
1599 See ``to_filename()``.
15991600
1600``safe_version(version)``1601``safe_version(version)``
1601 Similar to ``safe_name()`` except that spaces in the input become dots, and1602 Similar to ``safe_name()`` except that spaces in the input become dots, and
@@ -1708,7 +1709,7 @@
17081709
1709 * Fix cache dir defaults on Windows when multiple environment vars are needed1710 * Fix cache dir defaults on Windows when multiple environment vars are needed
1710 to construct a path.1711 to construct a path.
1711 1712
17120.6c417130.6c4
1713 * Fix "dev" versions being considered newer than release candidates.1714 * Fix "dev" versions being considered newer than release candidates.
17141715
17151716
=== modified file 'docs/roadmap.txt'
--- docs/roadmap.txt 2009-10-24 13:13:23 +0000
+++ docs/roadmap.txt 2010-01-19 00:05:23 +0000
@@ -4,7 +4,7 @@
44
5Distribute has two branches:5Distribute has two branches:
66
7- 0.6.x : provides a Setuptools-0.6c9 compatible version7- 0.6.x : provides a Setuptools-0.6cX compatible version
8- 0.7.x : will provide a refactoring8- 0.7.x : will provide a refactoring
99
100.6.x100.6.x
@@ -69,7 +69,7 @@
69 reorganized in clean, pep-8 modules. This package will69 reorganized in clean, pep-8 modules. This package will
70 only contain the query APIs and will focus on being PEP 37670 only contain the query APIs and will focus on being PEP 376
71 compatible. We will promote its usage and see if Pip wants71 compatible. We will promote its usage and see if Pip wants
72 to use it as a basis. 72 to use it as a basis.
73 It will probably shrink a lot though, once the stdlib provides PEP 376 support.73 It will probably shrink a lot though, once the stdlib provides PEP 376 support.
7474
75 - distribute.entrypoints: that's the old pkg_resources entry points75 - distribute.entrypoints: that's the old pkg_resources entry points
7676
=== modified file 'easy_install.py' (properties changed: +x to -x)
=== removed file 'll.txt'
--- ll.txt 2009-11-12 02:12:16 +0000
+++ ll.txt 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1changeset: 428:d9553f25b2a7
2branch: 0.6-maintenance
3parent: 423:097e168467b3
4user: Lennart Regebro <regebro@gmail.com>
5date: Tue Sep 22 17:25:53 2009 +0200
6summary: Name changes of the parameters.
7
8changeset: 417:60afc590239e
9branch: 0.6-maintenance
10user: Lennart Regebro <regebro@gmail.com>
11date: Fri Sep 18 17:22:17 2009 +0200
12summary: Works with zope.interface now.
13
14changeset: 146:53a59c53dedb
15branch: setuptools-0.6
16user: phillip.eby
17date: Sat Jan 19 02:55:03 2008 +0000
18summary: Fix interactions between the various "require" options,
19
20changeset: 127:56694796612e
21branch: setuptools-0.6
22user: phillip.eby
23date: Fri Mar 02 01:23:32 2007 +0000
24summary: Fix problem activating dependencies for tests (backport from trunk)
25
26changeset: 126:f4fbe686d6fe
27branch: setuptools-0.6
28user: phillip.eby
29date: Sat Feb 24 22:11:47 2007 +0000
30summary: Fix ``test`` command possibly failing if an older version of the project
31
32changeset: 0:b18d83e6dbf3
33branch: setuptools-0.6
34user: phillip.eby
35date: Fri Apr 14 17:31:02 2006 +0000
36summary: Creating a branch for the "stable" 0.6 development line of setuptools,
37
380
=== removed file 'ok.txt'
--- ok.txt 2009-11-12 02:12:16 +0000
+++ ok.txt 1970-01-01 00:00:00 +0000
@@ -1,804 +0,0 @@
1Index: ../../svn.python.org/setuptools-0.6/setuptools/sandbox.py
2===================================================================
3--- ../../svn.python.org/setuptools-0.6/setuptools/sandbox.py (révision 75384)
4+++ ../../svn.python.org/setuptools-0.6/setuptools/sandbox.py (révision 75385)
5@@ -1,14 +1,46 @@
6-import os, sys, __builtin__, tempfile, operator
7+import os, sys, __builtin__, tempfile, operator, pkg_resources
8 _os = sys.modules[os.name]
9 _open = open
10+_file = file
11+
12 from distutils.errors import DistutilsError
13+from pkg_resources import working_set
14+
15 __all__ = [
16 "AbstractSandbox", "DirectorySandbox", "SandboxViolation", "run_setup",
17 ]
18
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48 def run_setup(setup_script, args):
49 """Run a distutils setup script, sandboxed in its directory"""
50-
51 old_dir = os.getcwd()
52 save_argv = sys.argv[:]
53 save_path = sys.path[:]
54@@ -16,13 +48,16 @@
55 temp_dir = os.path.join(setup_dir,'temp')
56 if not os.path.isdir(temp_dir): os.makedirs(temp_dir)
57 save_tmp = tempfile.tempdir
58-
59+ save_modules = sys.modules.copy()
60+ pr_state = pkg_resources.__getstate__()
61 try:
62- tempfile.tempdir = temp_dir
63- os.chdir(setup_dir)
64+ tempfile.tempdir = temp_dir; os.chdir(setup_dir)
65 try:
66 sys.argv[:] = [setup_script]+list(args)
67 sys.path.insert(0, setup_dir)
68+ # reset to include setup dir, w/clean callback list
69+ working_set.__init__()
70+ working_set.callbacks.append(lambda dist:dist.activate())
71 DirectorySandbox(setup_dir).run(
72 lambda: execfile(
73 "setup.py",
74@@ -34,11 +69,17 @@
75 raise
76 # Normal exit, just return
77 finally:
78+ pkg_resources.__setstate__(pr_state)
79+ sys.modules.update(save_modules)
80+ for key in list(sys.modules):
81+ if key not in save_modules: del sys.modules[key]
82 os.chdir(old_dir)
83 sys.path[:] = save_path
84 sys.argv[:] = save_argv
85 tempfile.tempdir = save_tmp
86
87+
88+
89 class AbstractSandbox:
90 """Wrap 'os' module and 'open()' builtin for virtualizing setup scripts"""
91
92@@ -58,15 +99,16 @@
93 """Run 'func' under os sandboxing"""
94 try:
95 self._copy(self)
96- __builtin__.open = __builtin__.file = self._open
97+ __builtin__.file = self._file
98+ __builtin__.open = self._open
99 self._active = True
100 return func()
101 finally:
102 self._active = False
103- __builtin__.open = __builtin__.file = _open
104+ __builtin__.open = _file
105+ __builtin__.file = _open
106 self._copy(_os)
107
108-
109 def _mk_dual_path_wrapper(name):
110 original = getattr(_os,name)
111 def wrap(self,src,dst,*args,**kw):
112@@ -75,7 +117,6 @@
113 return original(src,dst,*args,**kw)
114 return wrap
115
116-
117 for name in ["rename", "link", "symlink"]:
118 if hasattr(_os,name): locals()[name] = _mk_dual_path_wrapper(name)
119
120@@ -88,7 +129,8 @@
121 return original(path,*args,**kw)
122 return wrap
123
124- _open = _mk_single_path_wrapper('file', _open)
125+ _open = _mk_single_path_wrapper('open', _open)
126+ _file = _mk_single_path_wrapper('file', _file)
127 for name in [
128 "stat", "listdir", "chdir", "open", "chmod", "chown", "mkdir",
129 "remove", "unlink", "rmdir", "utime", "lchown", "chroot", "lstat",
130@@ -96,7 +138,6 @@
131 ]:
132 if hasattr(_os,name): locals()[name] = _mk_single_path_wrapper(name)
133
134-
135 def _mk_single_with_return(name):
136 original = getattr(_os,name)
137 def wrap(self,path,*args,**kw):
138@@ -187,22 +228,22 @@
139 self._violation(operation, src, dst, *args, **kw)
140 return (src,dst)
141
142+ def _file(self, path, mode='r', *args, **kw):
143+ if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
144+ self._violation("file", path, mode, *args, **kw)
145+ return _file(path,mode,*args,**kw)
146+
147 def open(self, file, flags, mode=0777):
148 """Called for low-level os.open()"""
149 if flags & WRITE_FLAGS and not self._ok(file):
150 self._violation("os.open", file, flags, mode)
151 return _os.open(file,flags,mode)
152
153-
154 WRITE_FLAGS = reduce(
155- operator.or_,
156- [getattr(_os, a, 0) for a in
157+ operator.or_, [getattr(_os, a, 0) for a in
158 "O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARY".split()]
159 )
160
161-
162-
163-
164 class SandboxViolation(DistutilsError):
165 """A setup script attempted to modify the filesystem outside the sandbox"""
166
167Index: ../../svn.python.org/setuptools-0.6/setuptools/__init__.py
168===================================================================
169--- ../../svn.python.org/setuptools-0.6/setuptools/__init__.py (révision 75384)
170+++ ../../svn.python.org/setuptools-0.6/setuptools/__init__.py (révision 75385)
171@@ -7,7 +7,7 @@
172 from distutils.util import convert_path
173 import os.path
174
175-__version__ = '0.6c9'
176+__version__ = '0.6c10'
177 __all__ = [
178 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require',
179 'find_packages'
180Index: ../../svn.python.org/setuptools-0.6/setuptools/depends.py
181===================================================================
182--- ../../svn.python.org/setuptools-0.6/setuptools/depends.py (révision 75384)
183+++ ../../svn.python.org/setuptools-0.6/setuptools/depends.py (révision 75385)
184@@ -36,7 +36,7 @@
185 def version_ok(self,version):
186 """Is 'version' sufficiently up-to-date?"""
187 return self.attribute is None or self.format is None or \
188- str(version)<>"unknown" and version >= self.requested_version
189+ str(version)!="unknown" and version >= self.requested_version
190
191
192 def get_version(self, paths=None, default="unknown"):
193Index: ../../svn.python.org/setuptools-0.6/setuptools/package_index.py
194===================================================================
195--- ../../svn.python.org/setuptools-0.6/setuptools/package_index.py (révision 75384)
196+++ ../../svn.python.org/setuptools-0.6/setuptools/package_index.py (révision 75385)
197@@ -1,5 +1,6 @@
198 """PyPI and direct package downloading"""
199 import sys, os.path, re, urlparse, urllib2, shutil, random, socket, cStringIO
200+import httplib
201 from pkg_resources import *
202 from distutils import log
203 from distutils.errors import DistutilsError
204@@ -8,7 +9,6 @@
205 except ImportError:
206 from md5 import md5
207 from fnmatch import translate
208-
209 EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.]+)$')
210 HREF = re.compile("""href\\s*=\\s*['"]?([^'"> ]+)""", re.I)
211 # this is here to fix emacs' cruddy broken syntax highlighting
212@@ -42,6 +42,8 @@
213 def egg_info_for_url(url):
214 scheme, server, path, parameters, query, fragment = urlparse.urlparse(url)
215 base = urllib2.unquote(path.split('/')[-1])
216+ if server=='sourceforge.net' and base=='download': # XXX Yuck
217+ base = urllib2.unquote(path.split('/')[-2])
218 if '#' in base: base, fragment = base.split('#',1)
219 return base,fragment
220
221@@ -64,14 +66,12 @@
222 if basename.endswith('.egg') and '-' in basename:
223 # only one, unambiguous interpretation
224 return [Distribution.from_location(location, basename, metadata)]
225-
226 if basename.endswith('.exe'):
227 win_base, py_ver = parse_bdist_wininst(basename)
228 if win_base is not None:
229 return interpret_distro_name(
230 location, win_base, metadata, py_ver, BINARY_DIST, "win32"
231 )
232-
233 # Try source distro extensions (.zip, .tgz, etc.)
234 #
235 for ext in EXTENSIONS:
236@@ -186,10 +186,10 @@
237 return
238
239 self.info("Reading %s", url)
240+ self.fetched_urls[url] = True # prevent multiple fetch attempts
241 f = self.open_url(url, "Download error: %s -- Some packages may not be found!")
242 if f is None: return
243- self.fetched_urls[url] = self.fetched_urls[f.url] = True
244-
245+ self.fetched_urls[f.url] = True
246 if 'html' not in f.headers.get('content-type', '').lower():
247 f.close() # not html, we can't process it
248 return
249@@ -329,7 +329,7 @@
250 def check_md5(self, cs, info, filename, tfp):
251 if re.match('md5=[0-9a-f]{32}$', info):
252 self.debug("Validating md5 checksum for %s", filename)
253- if cs.hexdigest()<>info[4:]:
254+ if cs.hexdigest()!=info[4:]:
255 tfp.close()
256 os.unlink(filename)
257 raise DistutilsError(
258@@ -409,7 +409,8 @@
259
260
261 def fetch_distribution(self,
262- requirement, tmpdir, force_scan=False, source=False, develop_ok=False
263+ requirement, tmpdir, force_scan=False, source=False, develop_ok=False,
264+ local_index=None,
265 ):
266 """Obtain a distribution suitable for fulfilling `requirement`
267
268@@ -427,15 +428,15 @@
269 set, development and system eggs (i.e., those using the ``.egg-info``
270 format) will be ignored.
271 """
272-
273 # process a Requirement
274 self.info("Searching for %s", requirement)
275 skipped = {}
276+ dist = None
277
278- def find(req):
279+ def find(env, req):
280 # Find a matching distribution; may be called more than once
281
282- for dist in self[req.key]:
283+ for dist in env[req.key]:
284
285 if dist.precedence==DEVELOP_DIST and not develop_ok:
286 if dist not in skipped:
287@@ -444,23 +445,25 @@
288 continue
289
290 if dist in req and (dist.precedence<=SOURCE_DIST or not source):
291- self.info("Best match: %s", dist)
292- return dist.clone(
293- location=self.download(dist.location, tmpdir)
294- )
295+ return dist
296
297+
298+
299 if force_scan:
300 self.prescan()
301 self.find_packages(requirement)
302+ dist = find(self, requirement)
303+
304+ if local_index is not None:
305+ dist = dist or find(local_index, requirement)
306
307- dist = find(requirement)
308 if dist is None and self.to_scan is not None:
309 self.prescan()
310- dist = find(requirement)
311+ dist = find(self, requirement)
312
313 if dist is None and not force_scan:
314 self.find_packages(requirement)
315- dist = find(requirement)
316+ dist = find(self, requirement)
317
318 if dist is None:
319 self.warn(
320@@ -468,8 +471,10 @@
321 (source and "a source distribution of " or ""),
322 requirement,
323 )
324- return dist
325+ self.info("Best match: %s", dist)
326+ return dist.clone(location=self.download(dist.location, tmpdir))
327
328+
329 def fetch(self, requirement, tmpdir, force_scan=False, source=False):
330 """Obtain a file suitable for fulfilling `requirement`
331
332@@ -485,11 +490,6 @@
333
334
335
336-
337-
338-
339-
340-
341 def gen_setup(self, filename, fragment, tmpdir):
342 match = EGG_FRAGMENT.match(fragment)
343 dists = match and [d for d in
344@@ -573,17 +573,19 @@
345
346
347 def open_url(self, url, warning=None):
348- if url.startswith('file:'):
349- return local_open(url)
350+ if url.startswith('file:'): return local_open(url)
351 try:
352 return open_with_auth(url)
353 except urllib2.HTTPError, v:
354 return v
355 except urllib2.URLError, v:
356- if warning: self.warn(warning, v.reason)
357- else:
358- raise DistutilsError("Download error for %s: %s"
359- % (url, v.reason))
360+ reason = v.reason
361+ except httplib.HTTPException, v:
362+ reason = "%s: %s" % (v.__doc__ or v.__class__.__name__, v)
363+ if warning:
364+ self.warn(warning, reason)
365+ else:
366+ raise DistutilsError("Download error for %s: %s" % (url, reason))
367
368 def _download_url(self, scheme, url, tmpdir):
369 # Determine download filename
370@@ -611,8 +613,6 @@
371 self.url_ok(url, True) # raises error if not allowed
372 return self._attempt_download(url, filename)
373
374-
375-
376 def scan_url(self, url):
377 self.process_url(url, True)
378
379Index: ../../svn.python.org/setuptools-0.6/setuptools/dist.py
380===================================================================
381--- ../../svn.python.org/setuptools-0.6/setuptools/dist.py (révision 75384)
382+++ ../../svn.python.org/setuptools-0.6/setuptools/dist.py (révision 75385)
383@@ -8,7 +8,7 @@
384 from distutils.errors import DistutilsOptionError, DistutilsPlatformError
385 from distutils.errors import DistutilsSetupError
386 import setuptools, pkg_resources, distutils.core, distutils.dist, distutils.cmd
387-import os, distutils.log
388+import os, distutils.log, re
389
390 def _get_unpatched(cls):
391 """Protect against re-patching the distutils if reloaded
392@@ -61,8 +61,8 @@
393 parent = '.'.join(nsp.split('.')[:-1])
394 if parent not in value:
395 distutils.log.warn(
396- "%r is declared as a package namespace, but %r is not:"
397- " please correct this in setup.py", nsp, parent
398+ "WARNING: %r is declared as a package namespace, but %r"
399+ " is not: please correct this in setup.py", nsp, parent
400 )
401
402 def check_extras(dist, attr, value):
403@@ -121,6 +121,47 @@
404 "wildcard patterns"
405 )
406
407+def check_packages(dist, attr, value):
408+ for pkgname in value:
409+ if not re.match(r'\w+(\.\w+)*', pkgname):
410+ distutils.log.warn(
411+ "WARNING: %r not a valid package name; please use only"
412+ ".-separated package names in setup.py", pkgname
413+ )
414+
415+
416+
417+
418+
419+
420+
421+
422+
423+
424+
425+
426+
427+
428+
429+
430+
431+
432+
433+
434+
435+
436+
437+
438+
439+
440+
441+
442+
443+
444+
445+
446+
447+
448 class Distribution(_Distribution):
449 """Distribution with support for features, tests, and package data
450
451@@ -415,19 +456,19 @@
452 if self.packages:
453 self.packages = [
454 p for p in self.packages
455- if p<>package and not p.startswith(pfx)
456+ if p!=package and not p.startswith(pfx)
457 ]
458
459 if self.py_modules:
460 self.py_modules = [
461 p for p in self.py_modules
462- if p<>package and not p.startswith(pfx)
463+ if p!=package and not p.startswith(pfx)
464 ]
465
466 if self.ext_modules:
467 self.ext_modules = [
468 p for p in self.ext_modules
469- if p.name<>package and not p.name.startswith(pfx)
470+ if p.name!=package and not p.name.startswith(pfx)
471 ]
472
473
474Index: ../../svn.python.org/setuptools-0.6/setuptools/command/alias.py
475===================================================================
476--- ../../svn.python.org/setuptools-0.6/setuptools/command/alias.py (révision 75384)
477+++ ../../svn.python.org/setuptools-0.6/setuptools/command/alias.py (révision 75385)
478@@ -9,7 +9,7 @@
479 """Quote an argument for later parsing by shlex.split()"""
480 for c in '"', "'", "\\", "#":
481 if c in arg: return repr(arg)
482- if arg.split()<>[arg]:
483+ if arg.split()!=[arg]:
484 return repr(arg)
485 return arg
486
487@@ -33,7 +33,7 @@
488
489 def finalize_options(self):
490 option_base.finalize_options(self)
491- if self.remove and len(self.args)<>1:
492+ if self.remove and len(self.args)!=1:
493 raise DistutilsOptionError(
494 "Must specify exactly one argument (the alias name) when "
495 "using --remove"
496Index: ../../svn.python.org/setuptools-0.6/setuptools/command/egg_info.py
497===================================================================
498--- ../../svn.python.org/setuptools-0.6/setuptools/command/egg_info.py (révision 75384)
499+++ ../../svn.python.org/setuptools-0.6/setuptools/command/egg_info.py (révision 75385)
500@@ -217,18 +217,21 @@
501 data = f.read()
502 f.close()
503
504- if data.startswith('9') or data.startswith('8'):
505+ if data.startswith('<?xml'):
506+ dirurl = urlre.search(data).group(1) # get repository URL
507+ localrev = max([int(m.group(1)) for m in revre.finditer(data)]+[0])
508+ else:
509+ try: svnver = int(data.splitlines()[0])
510+ except: svnver=-1
511+ if data<8:
512+ log.warn("unrecognized .svn/entries format; skipping %s", base)
513+ dirs[:] = []
514+ continue
515+
516 data = map(str.splitlines,data.split('\n\x0c\n'))
517 del data[0][0] # get rid of the '8' or '9'
518 dirurl = data[0][3]
519 localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
520- elif data.startswith('<?xml'):
521- dirurl = urlre.search(data).group(1) # get repository URL
522- localrev = max([int(m.group(1)) for m in revre.finditer(data)]+[0])
523- else:
524- log.warn("unrecognized .svn/entries format; skipping %s", base)
525- dirs[:] = []
526- continue
527 if base==os.curdir:
528 base_url = dirurl+'/' # save the root url
529 elif not dirurl.startswith(base_url):
530@@ -241,9 +244,6 @@
531
532
533
534-
535-
536-
537 def find_sources(self):
538 """Generate SOURCES.txt manifest file"""
539 manifest_filename = os.path.join(self.egg_info,"SOURCES.txt")
540Index: ../../svn.python.org/setuptools-0.6/setuptools/command/build_ext.py
541===================================================================
542--- ../../svn.python.org/setuptools-0.6/setuptools/command/build_ext.py (révision 75384)
543+++ ../../svn.python.org/setuptools-0.6/setuptools/command/build_ext.py (révision 75385)
544@@ -82,15 +82,15 @@
545
546 def get_ext_filename(self, fullname):
547 filename = _build_ext.get_ext_filename(self,fullname)
548- ext = self.ext_map[fullname]
549- if isinstance(ext,Library):
550- fn, ext = os.path.splitext(filename)
551- return self.shlib_compiler.library_filename(fn,libtype)
552- elif use_stubs and ext._links_to_dynamic:
553- d,fn = os.path.split(filename)
554- return os.path.join(d,'dl-'+fn)
555- else:
556- return filename
557+ if fullname in self.ext_map:
558+ ext = self.ext_map[fullname]
559+ if isinstance(ext,Library):
560+ fn, ext = os.path.splitext(filename)
561+ return self.shlib_compiler.library_filename(fn,libtype)
562+ elif use_stubs and ext._links_to_dynamic:
563+ d,fn = os.path.split(filename)
564+ return os.path.join(d,'dl-'+fn)
565+ return filename
566
567 def initialize_options(self):
568 _build_ext.initialize_options(self)
569Index: ../../svn.python.org/setuptools-0.6/setuptools/command/sdist.py
570===================================================================
571--- ../../svn.python.org/setuptools-0.6/setuptools/command/sdist.py (révision 75384)
572+++ ../../svn.python.org/setuptools-0.6/setuptools/command/sdist.py (révision 75385)
573@@ -1,6 +1,7 @@
574 from distutils.command.sdist import sdist as _sdist
575 from distutils.util import convert_path
576 from distutils import log
577+from glob import glob
578 import os, re, sys, pkg_resources
579
580 entities = [
581@@ -38,7 +39,6 @@
582
583
584
585-
586 def walk_revctrl(dirname=''):
587 """Find all files under revision control"""
588 for ep in pkg_resources.iter_entry_points('setuptools.file_finders'):
589@@ -86,18 +86,22 @@
590 f = open(filename,'rU')
591 data = f.read()
592 f.close()
593- if data.startswith('9') or data.startswith('8'): # subversion 1.5/1.4
594+ if data.startswith('<?xml'):
595+ for match in entries_pattern.finditer(data):
596+ yield joinpath(dirname,unescape(match.group(1)))
597+ else:
598+ svnver=-1
599+ try: svnver = int(data.splitlines()[0])
600+ except: pass
601+ if svnver<8:
602+ log.warn("unrecognized .svn/entries format in %s", dirname)
603+ return
604 for record in map(str.splitlines, data.split('\n\x0c\n')[1:]):
605 if not record or len(record)>=6 and record[5]=="delete":
606 continue # skip deleted
607 yield joinpath(dirname, record[0])
608- elif data.startswith('<?xml'):
609- for match in entries_pattern.finditer(data):
610- yield joinpath(dirname,unescape(match.group(1)))
611- else:
612- log.warn("unrecognized .svn/entries format in %s", dirname)
613+
614
615-
616 finders = [
617 (convert_path('CVS/Entries'),
618 re_finder(re.compile(r"^\w?/([^/]+)/", re.M))),
619@@ -117,10 +121,6 @@
620
621
622
623-
624-
625-
626-
627 class sdist(_sdist):
628 """Smart sdist that finds anything supported by revision control"""
629
630@@ -162,6 +162,56 @@
631 sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
632 raise
633
634+ # Cribbed from old distutils code, to work around new distutils code
635+ # that tries to do some of the same stuff as we do, in a way that makes
636+ # us loop.
637+
638+ def add_defaults (self):
639+ standards = [('README', 'README.txt'), self.distribution.script_name]
640+
641+ for fn in standards:
642+ if type(fn) is tuple:
643+ alts = fn
644+ got_it = 0
645+ for fn in alts:
646+ if os.path.exists(fn):
647+ got_it = 1
648+ self.filelist.append(fn)
649+ break
650+
651+ if not got_it:
652+ self.warn("standard file not found: should have one of " +
653+ string.join(alts, ', '))
654+ else:
655+ if os.path.exists(fn):
656+ self.filelist.append(fn)
657+ else:
658+ self.warn("standard file '%s' not found" % fn)
659+
660+ optional = ['test/test*.py', 'setup.cfg']
661+
662+ for pattern in optional:
663+ files = filter(os.path.isfile, glob(pattern))
664+ if files:
665+ self.filelist.extend(files)
666+
667+ if self.distribution.has_pure_modules():
668+ build_py = self.get_finalized_command('build_py')
669+ self.filelist.extend(build_py.get_source_files())
670+
671+ if self.distribution.has_ext_modules():
672+ build_ext = self.get_finalized_command('build_ext')
673+ self.filelist.extend(build_ext.get_source_files())
674+
675+ if self.distribution.has_c_libraries():
676+ build_clib = self.get_finalized_command('build_clib')
677+ self.filelist.extend(build_clib.get_source_files())
678+
679+ if self.distribution.has_scripts():
680+ build_scripts = self.get_finalized_command('build_scripts')
681+ self.filelist.extend(build_scripts.get_source_files())
682+
683+
684 def check_readme(self):
685 alts = ("README", "README.txt")
686 for f in alts:
687@@ -193,13 +243,4 @@
688
689
690
691-
692-
693-
694-
695-
696-
697-
698-
699-
700 #
701Index: ../../svn.python.org/setuptools-0.6/setuptools/command/easy_install.py
702===================================================================
703--- ../../svn.python.org/setuptools-0.6/setuptools/command/easy_install.py (révision 75384)
704+++ ../../svn.python.org/setuptools-0.6/setuptools/command/easy_install.py (révision 75385)
705@@ -204,7 +204,7 @@
706 self.outputs = []
707
708 def run(self):
709- if self.verbose<>self.distribution.verbose:
710+ if self.verbose!=self.distribution.verbose:
711 log.set_verbosity(self.verbose)
712 try:
713 for spec in self.args:
714@@ -252,7 +252,7 @@
715 # Is it a configured, PYTHONPATH, implicit, or explicit site dir?
716 is_site_dir = instdir in self.all_site_dirs
717
718- if not is_site_dir:
719+ if not is_site_dir and not self.multi_version:
720 # No? Then directly test whether it does .pth file processing
721 is_site_dir = self.check_pth_processing()
722 else:
723@@ -430,9 +430,9 @@
724
725 self.check_editable(spec)
726 dist = self.package_index.fetch_distribution(
727- spec, tmpdir, self.upgrade, self.editable, not self.always_copy
728+ spec, tmpdir, self.upgrade, self.editable, not self.always_copy,
729+ self.local_index
730 )
731-
732 if dist is None:
733 msg = "Could not find suitable distribution for %r" % spec
734 if self.always_copy:
735@@ -722,7 +722,7 @@
736 f = open(pkg_inf,'w')
737 f.write('Metadata-Version: 1.0\n')
738 for k,v in cfg.items('metadata'):
739- if k<>'target_version':
740+ if k!='target_version':
741 f.write('%s: %s\n' % (k.replace('_','-').title(), v))
742 f.close()
743 script_dir = os.path.join(egg_info,'scripts')
744@@ -988,7 +988,6 @@
745 def pf(src,dst):
746 if dst.endswith('.py') and not src.startswith('EGG-INFO/'):
747 to_compile.append(dst)
748- to_chmod.append(dst)
749 elif dst.endswith('.dll') or dst.endswith('.so'):
750 to_chmod.append(dst)
751 self.unpack_progress(src,dst)
752@@ -1023,6 +1022,7 @@
753
754
755
756+
757 def no_default_version_msg(self):
758 return """bad install directory or PYTHONPATH
759
760@@ -1286,7 +1286,7 @@
761 if parts[1].endswith('.egg-info'):
762 prefixes.insert(0,('/'.join(parts[:2]), 'EGG-INFO/'))
763 break
764- if len(parts)<>2 or not name.endswith('.pth'):
765+ if len(parts)!=2 or not name.endswith('.pth'):
766 continue
767 if name.endswith('-nspkg.pth'):
768 continue
769Index: ../../svn.python.org/setuptools-0.6/setuptools/command/bdist_egg.py
770===================================================================
771--- ../../svn.python.org/setuptools-0.6/setuptools/command/bdist_egg.py (révision 75384)
772+++ ../../svn.python.org/setuptools-0.6/setuptools/command/bdist_egg.py (révision 75385)
773@@ -165,12 +165,13 @@
774 def run(self):
775 # Generate metadata first
776 self.run_command("egg_info")
777-
778 # We run install_lib before install_data, because some data hacks
779 # pull their data path from the install_lib command.
780 log.info("installing library code to %s" % self.bdist_dir)
781 instcmd = self.get_finalized_command('install')
782 old_root = instcmd.root; instcmd.root = None
783+ if self.distribution.has_c_libraries() and not self.skip_build:
784+ self.run_command('build_clib')
785 cmd = self.call_command('install_lib', warn_dir=0)
786 instcmd.root = old_root
787
788@@ -190,7 +191,6 @@
789 to_compile.extend(self.make_init_files())
790 if to_compile:
791 cmd.byte_compile(to_compile)
792-
793 if self.distribution.data_files:
794 self.do_install_data()
795
796@@ -398,7 +398,7 @@
797 for flag,fn in safety_flags.items():
798 fn = os.path.join(egg_dir, fn)
799 if os.path.exists(fn):
800- if safe is None or bool(safe)<>flag:
801+ if safe is None or bool(safe)!=flag:
802 os.unlink(fn)
803 elif safe is not None and bool(safe)==flag:
804 f=open(fn,'wb'); f.write('\n'); f.close()
8050
=== modified file 'pkg_resources.py'
--- pkg_resources.py 2009-11-12 02:12:16 +0000
+++ pkg_resources.py 2010-01-19 00:05:23 +0000
@@ -186,6 +186,15 @@
186 if not _cache:186 if not _cache:
187 import platform187 import platform
188 version = platform.mac_ver()[0]188 version = platform.mac_ver()[0]
189 # fallback for MacPorts
190 if version == '':
191 import plistlib
192 plist = '/System/Library/CoreServices/SystemVersion.plist'
193 if os.path.exists(plist):
194 plist_content = plistlib.readPlist(plist)
195 if 'ProductVersion' in plist_content:
196 version = plist_content['ProductVersion']
197
189 _cache.append(version.split('.'))198 _cache.append(version.split('.'))
190 return _cache[0]199 return _cache[0]
191200
@@ -528,7 +537,13 @@
528 env = Environment(self.entries)537 env = Environment(self.entries)
529 dist = best[req.key] = env.best_match(req, self, installer)538 dist = best[req.key] = env.best_match(req, self, installer)
530 if dist is None:539 if dist is None:
531 raise DistributionNotFound(req) # XXX put more info here540 #msg = ("The '%s' distribution was not found on this "
541 # "system, and is required by this application.")
542 #raise DistributionNotFound(msg % req)
543
544 # unfortunately, zc.buildout uses a str(err)
545 # to get the name of the distribution here..
546 raise DistributionNotFound(req)
532 to_activate.append(dist)547 to_activate.append(dist)
533 if dist not in req:548 if dist not in req:
534 # Oops, the "best" so far conflicts with a dependency549 # Oops, the "best" so far conflicts with a dependency
@@ -2253,10 +2268,14 @@
2253 loc = loc or self.location2268 loc = loc or self.location
22542269
2255 if self.project_name == 'setuptools':2270 if self.project_name == 'setuptools':
2256 if '0.7' in self.version:2271 try:
2272 version = self.version
2273 except ValueError:
2274 version = ''
2275 if '0.7' in version:
2257 raise ValueError(2276 raise ValueError(
2258 "A 0.7-series setuptools cannot be installed "2277 "A 0.7-series setuptools cannot be installed "
2259 "with distribute")2278 "with distribute. Found one at %s" % str(self.location))
22602279
2261 if not loc:2280 if not loc:
2262 return2281 return
22632282
=== modified file 'setup.py' (properties changed: +x to -x)
--- setup.py 2009-11-12 02:12:16 +0000
+++ setup.py 2010-01-19 00:05:23 +0000
@@ -14,9 +14,10 @@
14 fl.process_template_line(line)14 fl.process_template_line(line)
15 dir_util.create_tree(tmp_src, fl.files)15 dir_util.create_tree(tmp_src, fl.files)
16 outfiles_2to3 = []16 outfiles_2to3 = []
17 dist_script = os.path.join("build", "src", "distribute_setup.py")
17 for f in fl.files:18 for f in fl.files:
18 outf, copied = file_util.copy_file(f, os.path.join(tmp_src, f), update=1)19 outf, copied = file_util.copy_file(f, os.path.join(tmp_src, f), update=1)
19 if copied and outf.endswith(".py"):20 if copied and outf.endswith(".py") and outf != dist_script:
20 outfiles_2to3.append(outf)21 outfiles_2to3.append(outf)
21 if copied and outf.endswith('api_tests.txt'):22 if copied and outf.endswith('api_tests.txt'):
22 # XXX support this in distutils as well23 # XXX support this in distutils as well
@@ -36,7 +37,7 @@
36exec(open(init_path).read(), d)37exec(open(init_path).read(), d)
3738
38SETUP_COMMANDS = d['__all__']39SETUP_COMMANDS = d['__all__']
39VERSION = "0.6.8"40VERSION = "0.6.10"
4041
41from setuptools import setup, find_packages42from setuptools import setup, find_packages
42from setuptools.command.build_py import build_py as _build_py43from setuptools.command.build_py import build_py as _build_py
@@ -135,6 +136,7 @@
135 "package_data = setuptools.dist:check_package_data",136 "package_data = setuptools.dist:check_package_data",
136 "exclude_package_data = setuptools.dist:check_package_data",137 "exclude_package_data = setuptools.dist:check_package_data",
137 "include_package_data = setuptools.dist:assert_bool",138 "include_package_data = setuptools.dist:assert_bool",
139 "packages = setuptools.dist:check_packages",
138 "dependency_links = setuptools.dist:assert_string_list",140 "dependency_links = setuptools.dist:assert_string_list",
139 "test_loader = setuptools.dist:check_importable",141 "test_loader = setuptools.dist:check_importable",
140 "use_2to3 = setuptools.dist:assert_bool",142 "use_2to3 = setuptools.dist:assert_bool",
141143
=== modified file 'setuptools/archive_util.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/__init__.py'
--- setuptools/command/__init__.py 2009-10-20 00:12:26 +0000
+++ setuptools/command/__init__.py 2010-01-19 00:05:23 +0000
@@ -5,13 +5,16 @@
5 'register', 'bdist_wininst', 'upload_docs',5 'register', 'bdist_wininst', 'upload_docs',
6]6]
77
8from setuptools.command import install_scripts
8import sys9import sys
10
9if sys.version>='2.5':11if sys.version>='2.5':
10 # In Python 2.5 and above, distutils includes its own upload command12 # In Python 2.5 and above, distutils includes its own upload command
11 __all__.remove('upload')13 __all__.remove('upload')
1214
13from distutils.command.bdist import bdist15from distutils.command.bdist import bdist
1416
17
15if 'egg' not in bdist.format_commands:18if 'egg' not in bdist.format_commands:
16 bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")19 bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
17 bdist.format_commands.append('egg')20 bdist.format_commands.append('egg')
1821
=== modified file 'setuptools/command/alias.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/bdist_rpm.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/bdist_wininst.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/develop.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/easy_install.py' (properties changed: +x to -x)
--- setuptools/command/easy_install.py 2009-11-12 02:12:16 +0000
+++ setuptools/command/easy_install.py 2010-01-19 00:05:23 +0000
@@ -1720,7 +1720,6 @@
1720 import setuptools; argv0 = os.path.dirname(setuptools.__path__[0])1720 import setuptools; argv0 = os.path.dirname(setuptools.__path__[0])
1721 sys.argv[0] = argv0; sys.argv.append(argv0); main()1721 sys.argv[0] = argv0; sys.argv.append(argv0); main()
17221722
1723
1724def main(argv=None, **kw):1723def main(argv=None, **kw):
1725 from setuptools import setup1724 from setuptools import setup
1726 from setuptools.dist import Distribution1725 from setuptools.dist import Distribution
@@ -1745,9 +1744,16 @@
17451744
1746 class DistributionWithoutHelpCommands(Distribution):1745 class DistributionWithoutHelpCommands(Distribution):
1747 common_usage = ""1746 common_usage = ""
1747
1748 def _show_help(self,*args,**kw):1748 def _show_help(self,*args,**kw):
1749 with_ei_usage(lambda: Distribution._show_help(self,*args,**kw))1749 with_ei_usage(lambda: Distribution._show_help(self,*args,**kw))
17501750
1751 def find_config_files(self):
1752 files = Distribution.find_config_files(self)
1753 if 'setup.cfg' in files:
1754 files.remove('setup.cfg')
1755 return files
1756
1751 if argv is None:1757 if argv is None:
1752 argv = sys.argv[1:]1758 argv = sys.argv[1:]
17531759
17541760
=== modified file 'setuptools/command/egg_info.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/install_egg_info.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/install_scripts.py' (properties changed: +x to -x)
--- setuptools/command/install_scripts.py 2009-11-12 02:12:16 +0000
+++ setuptools/command/install_scripts.py 2010-01-19 00:05:23 +0000
@@ -1,6 +1,5 @@
1from distutils.command.install_scripts import install_scripts \1from distutils.command.install_scripts import install_scripts \
2 as _install_scripts2 as _install_scripts
3from easy_install import get_script_args, sys_executable, chmod
4from pkg_resources import Distribution, PathMetadata, ensure_directory3from pkg_resources import Distribution, PathMetadata, ensure_directory
5import os4import os
6from distutils import log5from distutils import log
@@ -13,6 +12,9 @@
13 self.no_ep = False12 self.no_ep = False
1413
15 def run(self):14 def run(self):
15 from setuptools.command.easy_install import (get_script_args,
16 sys_executable)
17
16 self.run_command("egg_info")18 self.run_command("egg_info")
17 if self.distribution.scripts:19 if self.distribution.scripts:
18 _install_scripts.run(self) # run first to set up self.outfiles20 _install_scripts.run(self) # run first to set up self.outfiles
@@ -37,6 +39,7 @@
3739
38 def write_script(self, script_name, contents, mode="t", *ignored):40 def write_script(self, script_name, contents, mode="t", *ignored):
39 """Write an executable file to the scripts directory"""41 """Write an executable file to the scripts directory"""
42 from setuptools.command.easy_install import chmod
40 log.info("Installing %s script to %s", script_name, self.install_dir)43 log.info("Installing %s script to %s", script_name, self.install_dir)
41 target = os.path.join(self.install_dir, script_name)44 target = os.path.join(self.install_dir, script_name)
42 self.outfiles.append(target)45 self.outfiles.append(target)
4346
=== modified file 'setuptools/command/register.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/rotate.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/saveopts.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/sdist.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/setopt.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/upload.py' (properties changed: +x to -x)
=== modified file 'setuptools/command/upload_docs.py'
--- setuptools/command/upload_docs.py 2009-10-20 00:12:26 +0000
+++ setuptools/command/upload_docs.py 2010-01-19 00:05:23 +0000
@@ -50,7 +50,7 @@
50 tmp_file = os.path.join(tmp_dir, "%s.zip" % name)50 tmp_file = os.path.join(tmp_dir, "%s.zip" % name)
51 zip_file = zipfile.ZipFile(tmp_file, "w")51 zip_file = zipfile.ZipFile(tmp_file, "w")
52 for root, dirs, files in os.walk(self.upload_dir):52 for root, dirs, files in os.walk(self.upload_dir):
53 if not files:53 if root == self.upload_dir and not files:
54 raise DistutilsOptionError(54 raise DistutilsOptionError(
55 "no files found in upload directory '%s'"55 "no files found in upload directory '%s'"
56 % self.upload_dir)56 % self.upload_dir)
5757
=== modified file 'setuptools/package_index.py' (properties changed: +x to -x)
=== modified file 'setuptools/sandbox.py' (properties changed: +x to -x)
--- setuptools/sandbox.py 2009-10-24 13:13:23 +0000
+++ setuptools/sandbox.py 2010-01-19 00:05:23 +0000
@@ -152,6 +152,8 @@
152 )152 )
153153
154154
155_EXCEPTIONS = [os.devnull,]
156
155class DirectorySandbox(AbstractSandbox):157class DirectorySandbox(AbstractSandbox):
156 """Restrict operations to a single subdirectory - pseudo-chroot"""158 """Restrict operations to a single subdirectory - pseudo-chroot"""
157159
@@ -160,9 +162,10 @@
160 "utime", "lchown", "chroot", "mkfifo", "mknod", "tempnam",162 "utime", "lchown", "chroot", "mkfifo", "mknod", "tempnam",
161 ])163 ])
162164
163 def __init__(self,sandbox):165 def __init__(self, sandbox, exceptions=_EXCEPTIONS):
164 self._sandbox = os.path.normcase(os.path.realpath(sandbox))166 self._sandbox = os.path.normcase(os.path.realpath(sandbox))
165 self._prefix = os.path.join(self._sandbox,'')167 self._prefix = os.path.join(self._sandbox,'')
168 self._exceptions = exceptions
166 AbstractSandbox.__init__(self)169 AbstractSandbox.__init__(self)
167170
168 def _violation(self, operation, *args, **kw):171 def _violation(self, operation, *args, **kw):
@@ -187,7 +190,8 @@
187 try:190 try:
188 self._active = False191 self._active = False
189 realpath = os.path.normcase(os.path.realpath(path))192 realpath = os.path.normcase(os.path.realpath(path))
190 if realpath==self._sandbox or realpath.startswith(self._prefix):193 if (realpath in self._exceptions or realpath == self._sandbox
194 or realpath.startswith(self._prefix)):
191 return True195 return True
192 finally:196 finally:
193 self._active = active197 self._active = active
194198
=== modified file 'setuptools/tests/test_develop.py'
--- setuptools/tests/test_develop.py 2009-11-12 02:12:16 +0000
+++ setuptools/tests/test_develop.py 2010-01-19 00:05:23 +0000
@@ -20,7 +20,7 @@
2020
21 def setUp(self):21 def setUp(self):
22 self.dir = tempfile.mkdtemp()22 self.dir = tempfile.mkdtemp()
23 setup = os.path.join(self.dir, SETUP_PY)23 setup = os.path.join(self.dir, 'setup.py')
24 f = open(setup, 'w')24 f = open(setup, 'w')
25 f.write(SETUP_PY)25 f.write(SETUP_PY)
26 f.close()26 f.close()
2727
=== modified file 'setuptools/tests/test_easy_install.py'
--- setuptools/tests/test_easy_install.py 2009-11-12 02:12:16 +0000
+++ setuptools/tests/test_easy_install.py 2010-01-19 00:05:23 +0000
@@ -2,7 +2,7 @@
2"""2"""
3import sys3import sys
4import os, shutil, tempfile, unittest4import os, shutil, tempfile, unittest
5from setuptools.command.easy_install import easy_install, get_script_args5from setuptools.command.easy_install import easy_install, get_script_args, main
6from setuptools.dist import Distribution6from setuptools.dist import Distribution
77
8class FakeDist(object):8class FakeDist(object):
@@ -27,6 +27,12 @@
27 )27 )
28""" % sys.executable28""" % sys.executable
2929
30SETUP_PY = """\
31from setuptools import setup
32
33setup(name='foo')
34"""
35
30class TestEasyInstallTest(unittest.TestCase):36class TestEasyInstallTest(unittest.TestCase):
3137
32 def test_install_site_py(self):38 def test_install_site_py(self):
@@ -52,3 +58,35 @@
5258
53 self.assertEquals(script, WANTED)59 self.assertEquals(script, WANTED)
5460
61 def test_no_setup_cfg(self):
62 # makes sure easy_install as a command (main)
63 # doesn't use a setup.cfg file that is located
64 # in the current working directory
65 dir = tempfile.mkdtemp()
66 setup_cfg = open(os.path.join(dir, 'setup.cfg'), 'w')
67 setup_cfg.write('[easy_install]\nfind_links = http://example.com')
68 setup_cfg.close()
69 setup_py = open(os.path.join(dir, 'setup.py'), 'w')
70 setup_py.write(SETUP_PY)
71 setup_py.close()
72
73 from setuptools.dist import Distribution
74
75 def _parse_command_line(self):
76 msg = 'Error: a local setup.cfg was used'
77 opts = self.command_options
78 if 'easy_install' in opts:
79 assert 'find_links' not in opts['easy_install'], msg
80 return self._old_parse_command_line
81
82 Distribution._old_parse_command_line = Distribution.parse_command_line
83 Distribution.parse_command_line = _parse_command_line
84
85 old_wd = os.getcwd()
86 try:
87 os.chdir(dir)
88 main([])
89 finally:
90 os.chdir(old_wd)
91 shutil.rmtree(dir)
92
5593
=== modified file 'setuptools/tests/test_resources.py'
--- setuptools/tests/test_resources.py 2009-10-24 13:13:23 +0000
+++ setuptools/tests/test_resources.py 2010-01-19 00:05:23 +0000
@@ -203,15 +203,12 @@
203 version="0.6c9")203 version="0.6c9")
204 ws.add(d2)204 ws.add(d2)
205205
206206 # a unexisting version needs to work
207207 ws = WorkingSet([])
208208 d3 = Distribution(
209209 "/some/path",
210210 project_name="setuptools")
211211 ws.add(d3)
212
213
214
215212
216213
217class EntryPointTests(TestCase):214class EntryPointTests(TestCase):
@@ -536,6 +533,10 @@
536 '#!%s -x\n' % self.non_ascii_exe)533 '#!%s -x\n' % self.non_ascii_exe)
537534
538 def test_get_script_header_jython_workaround(self):535 def test_get_script_header_jython_workaround(self):
536 # This test doesn't work with Python 3 in some locales
537 if (sys.version_info >= (3,) and os.environ.get("LC_CTYPE")
538 in (None, "C", "POSIX")):
539 return
539 platform = sys.platform540 platform = sys.platform
540 sys.platform = 'java1.5.0_13'541 sys.platform = 'java1.5.0_13'
541 stdout = sys.stdout542 stdout = sys.stdout
542543
=== added file 'setuptools/tests/test_sandbox.py'
--- setuptools/tests/test_sandbox.py 1970-01-01 00:00:00 +0000
+++ setuptools/tests/test_sandbox.py 2010-01-19 00:05:23 +0000
@@ -0,0 +1,28 @@
1"""develop tests
2"""
3import sys
4import os
5import shutil
6import unittest
7import tempfile
8
9from setuptools.sandbox import DirectorySandbox
10
11class TestSandbox(unittest.TestCase):
12
13 def setUp(self):
14 self.dir = tempfile.mkdtemp()
15
16 def tearDown(self):
17 shutil.rmtree(self.dir)
18
19 def test_devnull(self):
20 sandbox = DirectorySandbox(self.dir)
21
22 def _write():
23 f = open(os.devnull, 'w')
24 f.write('xxx')
25 f.close()
26
27 sandbox.run(_write)
28
029
=== added file 'setuptools/tests/test_upload_docs.py'
--- setuptools/tests/test_upload_docs.py 1970-01-01 00:00:00 +0000
+++ setuptools/tests/test_upload_docs.py 2010-01-19 00:05:23 +0000
@@ -0,0 +1,65 @@
1"""build_ext tests
2"""
3import sys, os, shutil, tempfile, unittest, site, zipfile
4from setuptools.command.upload_docs import upload_docs
5from setuptools.dist import Distribution
6
7SETUP_PY = """\
8from setuptools import setup
9
10setup(name='foo')
11"""
12
13class TestUploadDocsTest(unittest.TestCase):
14 def setUp(self):
15 self.dir = tempfile.mkdtemp()
16 setup = os.path.join(self.dir, 'setup.py')
17 f = open(setup, 'w')
18 f.write(SETUP_PY)
19 f.close()
20 self.old_cwd = os.getcwd()
21 os.chdir(self.dir)
22
23 self.upload_dir = os.path.join(self.dir, 'build')
24 os.mkdir(self.upload_dir)
25
26 # A test document.
27 f = open(os.path.join(self.upload_dir, 'index.html'), 'w')
28 f.write("Hello world.")
29 f.close()
30
31 # An empty folder.
32 os.mkdir(os.path.join(self.upload_dir, 'empty'))
33
34 if sys.version >= "2.6":
35 self.old_base = site.USER_BASE
36 site.USER_BASE = upload_docs.USER_BASE = tempfile.mkdtemp()
37 self.old_site = site.USER_SITE
38 site.USER_SITE = upload_docs.USER_SITE = tempfile.mkdtemp()
39
40 def tearDown(self):
41 os.chdir(self.old_cwd)
42 shutil.rmtree(self.dir)
43 if sys.version >= "2.6":
44 shutil.rmtree(site.USER_BASE)
45 shutil.rmtree(site.USER_SITE)
46 site.USER_BASE = self.old_base
47 site.USER_SITE = self.old_site
48
49 def test_create_zipfile(self):
50 # Test to make sure zipfile creation handles common cases.
51 # This explicitly includes a folder containing an empty folder.
52
53 dist = Distribution()
54
55 cmd = upload_docs(dist)
56 cmd.upload_dir = self.upload_dir
57 zip_file = cmd.create_zipfile()
58
59 assert zipfile.is_zipfile(zip_file)
60
61 zip_f = zipfile.ZipFile(zip_file) # woh...
62
63 assert zip_f.namelist() == ['index.html']
64
65
066
=== modified file 'site.py' (properties changed: +x to -x)
=== modified file 'tests/shlib_test/setup.py' (properties changed: +x to -x)
=== modified file 'tests/shlib_test/test_hello.py' (properties changed: +x to -x)

Subscribers

People subscribed via source and target branches

to all changes: