diff options
author | PJ Eby <distutils-sig@python.org> | 2005-12-14 18:10:11 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-12-14 18:10:11 +0000 |
commit | 66d77b786bd16b4f186c37951f18edfc1c8dec00 (patch) | |
tree | 414d47374a7d6561b51d9f8817b84ac954db6fd1 | |
parent | c7eeb6273fd7593d7bccfbe41f44b5aa2ab17c1d (diff) | |
download | external_python_setuptools-66d77b786bd16b4f186c37951f18edfc1c8dec00.tar.gz external_python_setuptools-66d77b786bd16b4f186c37951f18edfc1c8dec00.tar.bz2 external_python_setuptools-66d77b786bd16b4f186c37951f18edfc1c8dec00.zip |
Added a ``--single-version-externally-managed`` option to the ``install``
command so that you can more easily wrap a "flat" egg in a system package.
Enhanced ``bdist_rpm`` so that it installs single-version eggs that
don't rely on a ``.pth`` file. The ``--no-egg`` option has been removed,
since all RPMs are now built in a more backwards-compatible format.
Some work is now needed for easy_install to recognize bdist_wininst
.exe's that wrap these new flat eggs, as currently the .egg-info will
not be recognized.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041673
-rwxr-xr-x | EasyInstall.txt | 4 | ||||
-rwxr-xr-x | setuptools.txt | 67 | ||||
-rwxr-xr-x | setuptools/command/bdist_rpm.py | 22 | ||||
-rw-r--r-- | setuptools/command/install.py | 46 |
4 files changed, 98 insertions, 41 deletions
diff --git a/EasyInstall.txt b/EasyInstall.txt index 0d98e7c1..f0cf23f7 100755 --- a/EasyInstall.txt +++ b/EasyInstall.txt @@ -874,6 +874,10 @@ Known Issues the shortest one. This helps to avoid "table of contents" CGI URLs like the ones on effbot.org. + * Quote arguments to python.exe (including python's path) to avoid problems + when Python (or a script) is installed in a directory whose name contains + spaces on Windows. + 0.6a8 * Update for changed SourceForge mirror format diff --git a/setuptools.txt b/setuptools.txt index ddccf390..54f4d3e1 100755 --- a/setuptools.txt +++ b/setuptools.txt @@ -1629,6 +1629,25 @@ files), the ``develop`` command will use them as defaults, unless you override them in a ``[develop]`` section or on the command line. +``easy_install`` - Find and install packages +============================================ + +This command runs the `EasyInstall tool +<http://peak.telecommunity.com/DevCenter/EasyInstall>`_ for you. It is exactly +equivalent to running the ``easy_install`` command. All command line arguments +following this command are consumed and not processed further by the distutils, +so this must be the last command listed on the command line. Please see +the EasyInstall documentation for the options reference and usage examples. +Normally, there is no reason to use this command via the command line, as you +can just use ``easy_install`` directly. It's only listed here so that you know +it's a distutils command, which means that you can: + +* create command aliases that use it, +* create distutils extensions that invoke it as a subcommand, and +* configure options for it in your ``setup.cfg`` or other distutils config + files. + + .. _egg_info: ``egg_info`` - Create egg metadata and set build tags @@ -1717,6 +1736,47 @@ Other ``egg_info`` Options no ``package_dir`` set, this option defaults to the current directory. +``install`` - Run ``easy_install`` or old-style installation +============================================================ + +The setuptools ``install`` command is basically a shortcut to run the +``easy_install`` command on the current project. However, for convenience +in creating "system packages" of setuptools-based projects, you can also +use this option: + +``--single-version-externally-managed`` + This boolean option tells the ``install`` command to perform an "old style" + installation, with the addition of an ``.egg-info`` directory so that the + installed project will still have its metadata available and operate + normally. If you use this option, you *must* also specify the ``--root`` + or ``--record`` options (or both), because otherwise you will have no way + to identify and remove the installed files. + +This option is automatically in effect when ``install`` is invoked by another +distutils command, so that commands like ``bdist_wininst`` and ``bdist_rpm`` +will create system packages of eggs. + + +``install_egg_info`` - Install an ``.egg-info`` directory in ``site-packages`` +============================================================================== + +Setuptools runs this command as part of ``install`` operations that use the +``--single-version-externally-managed`` options. You should not invoke it +directly; it is documented here for completeness and so that distutils +extensions such as system package builders can make use of it. This command +has only one option: + +``--install-dir=DIR, -d DIR`` + The parent directory where the ``.egg-info`` directory will be placed. + Defaults to the same as the ``--install-dir`` option specified for the + ``install_lib`` command, which is usually the system ``site-packages`` + directory. + +This command assumes that the ``egg_info`` command has been given valid options +via the command line or ``setup.cfg``, as it will invoke the ``egg_info`` +command and use its options to locate the project's source ``.egg-info`` +directory. + .. _rotate: @@ -2185,6 +2245,13 @@ Release Notes/Change History ``install`` operations, that installs an ``.egg-info`` directory with the package. + * Added a ``--single-version-externally-managed`` option to the ``install`` + command so that you can more easily wrap a "flat" egg in a system package. + + * Enhanced ``bdist_rpm`` so that it installs single-version eggs that + don't rely on a ``.pth`` file. The ``--no-egg`` option has been removed, + since all RPMs are now built in a more backwards-compatible format. + 0.6a8 * Fixed some problems building extensions when Pyrex was installed, especially with Python 2.4 and/or packages using SWIG. diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 4db04a32..1a0b0484 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -6,12 +6,6 @@ from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): - user_options = _bdist_rpm.user_options + [ - ('no-egg', None, "Don't install as an egg (may break the package!)") - ] - - boolean_options = _bdist_rpm.boolean_options + ['no-egg'] - def initialize_options(self): _bdist_rpm.initialize_options(self) self.no_egg = None @@ -31,24 +25,16 @@ class bdist_rpm(_bdist_rpm): "Source0: %{name}-%{version}.tar", "Source0: %{name}-%{unmangled_version}.tar" ).replace( + "setup.py install ", + "setup.py install --single-version-externally-managed " + ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" ).replace(line23,line24) for line in spec ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) - - - if not self.no_egg: - return spec - - # Hack the spec file so that we install old-style - return [ - line.replace( - "setup.py install ","setup.py install --old-and-unmanageable " - ) for line in spec - ] - + return spec diff --git a/setuptools/command/install.py b/setuptools/command/install.py index 51d4ffe0..77b97b67 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -1,29 +1,47 @@ import setuptools, sys from distutils.command.install import install as _install +from distutils.errors import DistutilsArgError class install(_install): """Use easy_install to install the package, w/dependencies""" user_options = _install.user_options + [ ('old-and-unmanageable', None, "Try not to use this!"), + ('single-version-externally-managed', None, + "used by system package builders to create 'flat' eggs"), ] - boolean_options = _install.boolean_options + ['old-and-unmanageable'] + boolean_options = _install.boolean_options + [ + 'old-and-unmanageable', 'single-version-externally-managed', + ] + + sub_commands = _install.sub_commands + [ + ('install_egg_info', lambda self: True), + ] def initialize_options(self): _install.initialize_options(self) self.old_and_unmanageable = None + self.single_version_externally_managed = None self.no_compile = None # make DISTUTILS_DEBUG work right! + def finalize_options(self): + _install.initialize_options(self) + if self.single_version_externally_managed: + if not self.root and not self.record: + raise DistutilsArgError( + "You must specify --record or --root when building system" + " packages" + ) + def handle_extra_path(self): - # We always ignore extra_path, because we always install eggs - # (you can always use install_* commands directly if needed) + # We always ignore extra_path, because we install as .egg or .egg-info self.path_file = None self.extra_dirs = '' def run(self): - if (self.old_and_unmanageable or - sys._getframe(1).f_globals.get('__name__','') != 'distutils.dist' + if (self.old_and_unmanageable or self.single_version_externally_managed + or sys._getframe(1).f_globals.get('__name__','') != 'distutils.dist' ): # Either we were asked for the old behavior, or we're not being # run from the command line. This is a bit kludgy, because a @@ -50,24 +68,6 @@ class install(_install): cmd.run() setuptools.bootstrap_install_from = None - sub_commands = _install.sub_commands + [ - ('install_egg_info', lambda self: True), - ] - - - - - - - - - - - - - - - |