diff options
| -rw-r--r-- | .hgtags | 1 | ||||
| -rw-r--r-- | CHANGES.txt | 11 | ||||
| -rwxr-xr-x | README.txt | 88 | ||||
| -rw-r--r-- | distribute.egg-info/entry_points.txt | 2 | ||||
| -rw-r--r-- | distribute_setup.py | 66 | ||||
| -rw-r--r-- | docs/conf.py | 2 | ||||
| -rw-r--r-- | docs/index.txt | 5 | ||||
| -rw-r--r-- | docs/roadmap.txt | 86 | ||||
| -rw-r--r-- | docs/setuptools.txt | 14 | ||||
| -rw-r--r-- | docs/using.txt | 21 | ||||
| -rw-r--r-- | pkg_resources.py | 13 | ||||
| -rwxr-xr-x | release.sh | 25 | ||||
| -rwxr-xr-x | setup.py | 2 |
13 files changed, 263 insertions, 73 deletions
@@ -2,3 +2,4 @@ 4d114c5f2a3ecb4a0fa552075dbbb221b19e291b 0.6.1 41415244ee90664042d277d0b1f0f59c04ddd0e4 0.6.2 e033bf2d3d05f4a7130f5f8f5de152c4db9ff32e 0.6.3 +e06c416e911c61771708f5afbf3f35db0e12ba71 0.6.4 diff --git a/CHANGES.txt b/CHANGES.txt index 690367df..21624f32 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,11 +3,22 @@ CHANGES ======= ----- +0.6.5 +----- + + +----- 0.6.4 ----- +* Added the generation of `distribute_setup_3k.py` during the release. + This close http://bitbucket.org/tarek/distribute/issue/52. + * Added an upload_docs command to easily upload project documentation to PyPI's http://packages.python.org. + This close http://bitbucket.org/tarek/distribute/issue/56. + +* Fixed a bootstrap bug on the use_setuptools() API. ----- 0.6.3 @@ -18,22 +18,26 @@ for working with Python module distributions. The fork has two goals: -- Providing a backward compatible version to replace Setuptools +- Providing a backward compatible version to replace Setuptools and make all distributions that depend on Setuptools work as before, but with less bugs and behaviorial issues. This work is done in the 0.6.x series - Starting with version 0.6.2, Distribute supports Python 3. - Installing and using distribute for Python 3 code works exactly - the same as for Python 2 code, but Distribute also helps you to support - Python 2 and Python 3 from the same source code by letting you run 2to3 - on the code as a part of the build process, by setting the keyword parameter - ``use_2to3`` to True. See docs/python3.txt for more information. + Starting with version 0.6.2, Distribute supports Python 3. + Installing and using distribute for Python 3 code works exactly + the same as for Python 2 code, but Distribute also helps you to support + Python 2 and Python 3 from the same source code by letting you run 2to3 + on the code as a part of the build process, by setting the keyword parameter + ``use_2to3`` to True. See http://packages.python.org/distribute for more + information. - Refactoring the code, and releasing it in several distributions. This work is being done in the 0.7.x series but not yet released. +The roadmap is still evolving, and the page that is up-to-date is +located at : `http://packages.python.org/distribute/roadmap`. + If you install `Distribute` and want to switch back for any reason to `Setuptools`, get to the `Uninstallation instructions`_ section. @@ -41,21 +45,21 @@ More documentation ================== You can get more information in the Sphinx-based documentation, located -in the archive in `docs`. This documentation includes the old Setuptools -documentation that is slowly replaced, and brand new content. +at http://packages.python.org/distribute. This documentation includes the old +Setuptools documentation that is slowly replaced, and brand new content. About the installation process ============================== The `Distribute` installer modifies your installation by de-activating an -existing installation of `Setuptools` in a bootstrap process. This process -has been tested in various installation schemes and contexts but in case of a +existing installation of `Setuptools` in a bootstrap process. This process +has been tested in various installation schemes and contexts but in case of a bug during this process your Python installation might be left in a broken -state. Since all modified files and directories are copied before the -installation, you will be able to get back to a normal state by reading +state. Since all modified files and directories are copied before the +installation starts, you will be able to get back to a normal state by reading the instructions in the `Uninstallation instructions`_ section. -In any case, it is recommended to save you `site-packages` directory before +In any case, it is recommended to save you `site-packages` directory before you start the installation of `Distribute`. ------------------------- @@ -86,6 +90,8 @@ If you are under Python 3, use ``distribute_setup_3k.py``:: $ curl -O http://nightly.ziade.org/distribute_setup_3k.py $ python distribute_setup_3k.py +Notice that both files are provided in the source release. + easy_install or pip =================== @@ -99,22 +105,23 @@ Source installation Download the source tarball, uncompress it, then run the install command:: - $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.4.tar.gz - $ tar -xzvf distribute-0.6.4.tar.gz - $ cd distribute-0.6 + $ curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.5.tar.gz + $ tar -xzvf distribute-0.6.5.tar.gz + $ cd distribute-0.6.5 $ python setup.py install --------------------------- Uninstallation Instructions --------------------------- -Like other distutils-based distributions, Distribute doesn't provide an -uninstaller yet. It's all done manually! +Like other distutils-based distributions, Distribute doesn't provide an +uninstaller yet. It's all done manually! We are all waiting for PEP 376 +support in Python. Distribute is installed in three steps: 1. it gets out of the way an existing installation of Setuptools -2. it installs a `fake` setuptools installation +2. it installs a `fake` setuptools installation 3. it installs distribute Distribute can be removed like this: @@ -136,6 +143,26 @@ Lastly: - remove the *.OLD.* directory located in your site-packages directory if any, **once you have checked everything was working correctly again**. +------------------------- +Quick help for developers +------------------------- + +To use Distribute in your package, the recommended way is to ship +`distribute_setup.py` alongside your `setup.py` script and call +it at the very begining of `setup.py` like this:: + + from distribute_setup import use_setuptools + use_setuptools() + + +Another way is to add ``Distribute`` in the ``install_requires`` option:: + + from setuptools import setup + + setup(... + install_requires=['distribute'] + ) + ----------- Install FAQ ----------- @@ -146,7 +173,7 @@ Install FAQ it fakes that the Setuptools installation is still present, so all the programs that where using Setuptools still work. - If it wasn't doing it, a program that would try to install Setuptools + If it wasn't doing it, a program that would try to install Setuptools would overwrite in turn Distribute. - **How does Distribute interacts with virtualenv?** @@ -154,6 +181,7 @@ Install FAQ Everytime you create a virtualenv it will install setuptools, so you need to re-install Distribute in it right after. The Distribute project will not attempt to patch virtualenv so it uses it when globally installed. + We will just wait for virtualenv to eventually switch to Distribute. Once installed, your virtualenv will use Distribute transparently. @@ -161,19 +189,21 @@ Install FAQ and if the virtualenv you are in was generated without the `--no-site-packages` option, the Distribute installation will stop. - You need in this case to build a virtualenv with the --no-site-packages option - or to install `Distribute` globally. + You need in this case to build a virtualenv with the `--no-site-packages` + option or to install `Distribute` globally. - **How does Distribute interacts with zc.buildout?** - Some work is being done on zc.buildout side to make its bootstrap - work with Distribute. Until then, using Distribute in zc.buildout is a bit - tricky because the bootstrap process of zc.buildout hardcodes the - installation of Setuptools. + You can use Distribute in your zc.buildout. - The plan is to come with a custom bootstrap.py for zc.buildout for the - 0.6.4 release, together with some small changes on zc.buildout side. + Although you have to run a specific `bootstrap.py` file that is available + at `http://nightly.ziade.org/bootstrap.py`. The code is located at + `http://bitbucket.org/tarek/buildout-distribute`. + Beware that if you use a shared eggs folder with buildout, you need to + switch all buildouts that use it to distribute. This is due to the fact + that the setuptools eggs located in the shared folder will be replaced + by a fake one, alongside distribute. ----------------------------- Feedback and getting involved diff --git a/distribute.egg-info/entry_points.txt b/distribute.egg-info/entry_points.txt index f4b74da0..3728f74f 100644 --- a/distribute.egg-info/entry_points.txt +++ b/distribute.egg-info/entry_points.txt @@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete [console_scripts] easy_install = setuptools.command.easy_install:main -easy_install-2.6 = setuptools.command.easy_install:main +easy_install-3.1 = setuptools.command.easy_install:main [setuptools.file_finders] svn_cvs = setuptools.command.sdist:_default_revctrl diff --git a/distribute_setup.py b/distribute_setup.py index dcea856e..c8c319bd 100644 --- a/distribute_setup.py +++ b/distribute_setup.py @@ -46,7 +46,7 @@ except ImportError: args = [quote(arg) for arg in args] return os.spawnl(os.P_WAIT, sys.executable, *args) == 0 -DEFAULT_VERSION = "0.6.4" +DEFAULT_VERSION = "0.6.5" DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/" SETUPTOOLS_PKG_INFO = """\ Metadata-Version: 1.0 @@ -130,28 +130,34 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, was_imported = 'pkg_resources' in sys.modules or \ 'setuptools' in sys.modules try: - import pkg_resources - if not hasattr(pkg_resources, '_distribute'): - raise ImportError - except ImportError: - return _do_download(version, download_base, to_dir, download_delay) - try: - pkg_resources.require("distribute>="+version) - return - except pkg_resources.VersionConflict, e: - if was_imported: - print >>sys.stderr, ( - "The required version of distribute (>=%s) is not available, and\n" - "can't be installed while this script is running. Please install\n" - " a more recent version first, using 'easy_install -U distribute'." - "\n\n(Currently using %r)") % (version, e.args[0]) - sys.exit(2) - else: - del pkg_resources, sys.modules['pkg_resources'] # reload ok + try: + import pkg_resources + if not hasattr(pkg_resources, '_distribute'): + fake_setuptools() + raise ImportError + except ImportError: return _do_download(version, download_base, to_dir, download_delay) - except pkg_resources.DistributionNotFound: - return _do_download(version, download_base, to_dir, download_delay) - + try: + pkg_resources.require("distribute>="+version) + return + except pkg_resources.VersionConflict, e: + if was_imported: + print >>sys.stderr, ( + "The required version of distribute (>=%s) is not available,\n" + "and can't be installed while this script is running. Please\n" + "install a more recent version first, using\n" + "'easy_install -U distribute'." + "\n\n(Currently using %r)") % (version, e.args[0]) + sys.exit(2) + else: + del pkg_resources, sys.modules['pkg_resources'] # reload ok + return _do_download(version, download_base, to_dir, + download_delay) + except pkg_resources.DistributionNotFound: + return _do_download(version, download_base, to_dir, + download_delay) + finally: + _create_fake_setuptools_pkg_info(to_dir) def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15): @@ -234,13 +240,14 @@ def _remove_flat_installation(placeholder): break if not found: log.warn('Could not locate setuptools*.egg-info') + return + + log.warn('Removing elements out of the way...') + pkg_info = os.path.join(placeholder, file) + if os.path.isdir(pkg_info): + patched = _patch_egg_dir(pkg_info) else: - log.warn('Removing elements out of the way...') - pkg_info = os.path.join(placeholder, file) - if os.path.isdir(pkg_info): - patched = _patch_egg_dir(pkg_info) - else: - patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO) + patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO) if not patched: log.warn('%s already patched.', pkg_info) @@ -259,6 +266,9 @@ def _remove_flat_installation(placeholder): def _after_install(dist): log.warn('After install bootstrap.') placeholder = dist.get_command_obj('install').install_purelib + _create_fake_setuptools_pkg_info(placeholder) + +def _create_fake_setuptools_pkg_info(placeholder): if not placeholder or not os.path.exists(placeholder): log.warn('Could not find the install location') return diff --git a/docs/conf.py b/docs/conf.py index bad1a578..f7e762eb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,7 +48,7 @@ copyright = u'2009, The fellowship of the packaging' # built documents. # # The short X.Y version. -version = '0.6.4' +version = '0.6.5' # The full version, including alpha/beta/rc tags. release = '0.6.4' diff --git a/docs/index.txt b/docs/index.txt index f814ff9b..e64b8c88 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -6,11 +6,12 @@ Contents: .. toctree:: :maxdepth: 2 + roadmap + python3 + using setuptools easy_install pkg_resources - python3 - Indices and tables ================== diff --git a/docs/roadmap.txt b/docs/roadmap.txt new file mode 100644 index 00000000..e97ab57d --- /dev/null +++ b/docs/roadmap.txt @@ -0,0 +1,86 @@ +======= +Roadmap +======= + +Distribute has two branches: + +- 0.6.x : provides a Setuptools-0.6c9 compatible version +- 0.7.x : will provide a refactoring + +0.6.x +===== + +Not "much" is going to happen here, we want this branch to be helpful +to the community *today* by addressing the 40-or-so bugs +that were found in Setuptools and never fixed. This is eventually +happen soon because its development is +fast : there are up to 5 commiters that are working on it very often +(and the number grows weekly.) + +The biggest issue with this branch is that it is providing the same +packages and modules setuptools does, and this +requires some bootstrapping work where we make sure once Distribute is +installed, all Distribution that requires Setuptools +will continue to work. This is done by faking the metadata of +Setuptools 0.6c9. That's the only way we found to do this. + +There's one major thing though: thanks to the work of Lennart, Alex, +Martin, this branch supports Python 3, +which is great to have to speed up Py3 adoption. + +The goal of the 0.6.x is to remove as much bugs as we can, and try if +possible to remove the patches done +on Distutils. We will support 0.6.x maintenance for years and we will +promote its usage everywhere instead of +Setuptools. + +Some new commands are added there, when they are helpful and don't +interact with the rest. I am thinking +about "upload_docs" that let you upload documentation to PyPI. The +goal is to move it to Distutils +at some point, if the documentation feature of PyPI stays and starts to be used. + +0.7.x +===== + +We've started to refactor Distribute with this roadmap in mind (and +no, as someone said, it's not vaporware, +we've done a lot already) + +- 0.7.x can be installed and used with 0.6.x + +- easy_install is going to be deprecated ! use Pip ! + +- the version system will be deprecated, in favor of the one in Distutils + +- no more Distutils monkey-patch that happens once you use the code + (things like 'from distutils import cmd; cmd.Command = CustomCommand') + +- no more custom site.py (that is: if something misses in Python's + site.py we'll add it there instead of patching it) + +- no more namespaced packages system, if PEP 381 (namespaces package + support) makes it to 2.7 + +- The code is splitted in many packages and might be distributed under + several distributions. + + - distribute.resources: that's the old pkg_resources, but + reorganized in clean, pep-8 modules. This package will + only contain the query APIs and will focus on being PEP 376 + compatible. We will promote its usage and see if Pip wants + to use it as a basis. + It will probably shrink a lot though, once the stdlib provides PEP 376 support. + + - distribute.entrypoints: that's the old pkg_resources entry points + system, but on its own. it uses distribute.resources + + - distribute.index: that's package_index and a few other things. + everything required to interact with PyPI. We will promote + its usage and see if Pip wants to use it as a basis. + + - distribute.core (might be renamed to main): that's everything + else, and uses the other packages. + +Goal: A first release before (or when) Python 2.7 / 3.2 is out. + diff --git a/docs/setuptools.txt b/docs/setuptools.txt index d5bd98b5..2e2366f6 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -1,8 +1,8 @@ -====================================================== -Building and Distributing Packages with ``setuptools`` -====================================================== +================================================== +Building and Distributing Packages with Distribute +================================================== -``setuptools`` is a collection of enhancements to the Python ``distutils`` +``Distribute`` is a collection of enhancements to the Python ``distutils`` (for Python 2.3.5 and up on most platforms; 64-bit platforms require a minimum of Python 2.4) that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages. @@ -2433,9 +2433,9 @@ The ``upload_docs`` command has the following options: http://pypi.python.org/pypi (i.e., the main PyPI installation). ------------------------------------- -Extending and Reusing ``setuptools`` ------------------------------------- +-------------------------------- +Extending and Reusing Distribute +-------------------------------- Creating ``distutils`` Extensions ================================= diff --git a/docs/using.txt b/docs/using.txt new file mode 100644 index 00000000..192f1dc2 --- /dev/null +++ b/docs/using.txt @@ -0,0 +1,21 @@ +================================ +Using Distribute in your project +================================ + +To use Distribute in your project, the recommended way is to ship +`distribute_setup.py` alongside your `setup.py` script and call +it at the very begining of `setup.py` like this:: + + from distribute_setup import use_setuptools + use_setuptools() + +Another way is to add ``Distribute`` in the ``install_requires`` option:: + + from setuptools import setup + + setup(... + install_requires=['distribute'] + ) + + +XXX to be finished diff --git a/pkg_resources.py b/pkg_resources.py index d0e840b8..20815ffe 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -2486,6 +2486,19 @@ class Requirement: #@staticmethod def parse(s): + # if asked for setuptools distribution + # and if distribute is installed, we want to give + # distribute instead + stripped_s = s.replace(' ', '') + stripped_s = stripped_s.strip() + if stripped_s in ('setuptools', 'setuptools==0.6c9', + 'setuptools>0.6c9', 'setuptools>=0.6c9'): + reqs = list(parse_requirements('distribute')) + if reqs: + if len(reqs)==1: + # ok we can replace the requirement + return reqs[0] + reqs = list(parse_requirements(s)) if reqs: if len(reqs)==1: @@ -1,12 +1,29 @@ #!/bin/sh -export VERSION="0.6.4" +export VERSION="0.6.5" + +# tagging +hg tag $VERSION +hg ci -m "bumped revision" + +# creating the 3k script +mkdir ./temp +cp distribute_setup.py ./temp/distribute_setup.py +cd ./temp +2to3 -w distribute_setup.py > /dev/null +mv distribute_setup.py ../distribute_setup_3k.py +cd .. +rm -rf ./temp # creating the releases -rm -rf dist +rm -rf ./dist -# now preparing the source release +# now preparing the source release, pushing it and its doc python2.6 setup.py -q egg_info -RDb '' sdist register upload +python2.6 setup.py build_sphinx upload_docs -# pushing the bootstrap script +# pushing the bootstrap scripts scp distribute_setup.py ziade.org:nightly/build/ +scp distribute_setup_3k.py ziade.org:nightly/build/ + +# starting the new dev @@ -36,7 +36,7 @@ init_path = convert_path('setuptools/command/__init__.py') exec(open(init_path).read(), d) SETUP_COMMANDS = d['__all__'] -VERSION = "0.6.4" +VERSION = "0.6.5" from setuptools import setup, find_packages import sys |
