[Python-checkins] peps: PEP 426: tweak standard build system description

nick.coghlan python-checkins at python.org
Mon Jun 24 13:38:41 CEST 2013


http://hg.python.org/peps/rev/5be19fe2c1fa
changeset:   4961:5be19fe2c1fa
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Mon Jun 24 21:38:31 2013 +1000
summary:
  PEP 426: tweak standard build system description

files:
  pep-0426.txt |  78 +++++++++++++++++++++++----------------
  1 files changed, 45 insertions(+), 33 deletions(-)


diff --git a/pep-0426.txt b/pep-0426.txt
--- a/pep-0426.txt
+++ b/pep-0426.txt
@@ -261,10 +261,8 @@
 * obtain the original source code that was used to create a distribution
 * identify and retrieve the dependencies (if any) required to use a
   distribution
-* identify and retrieve the dependencies (if any) required to build a distribution
-  from source
-* if supported by the distribution, run the distribution's automatic test
-  suite on an installed instance of the distribution
+* identify and retrieve the dependencies (if any) required to build a
+  distribution from source
 * identify and retrieve the dependencies (if any) required to run a
   distribution's test suite
 * find resources on using and contributing to the project
@@ -272,18 +270,6 @@
   publishers through appropriate channels, as well as finding distributions
   that are relevant to particular problems
 
-The current iteration of the metadata relies on the ``distutils`` commands
-system to support other necessary integration and deployment activities:
-
-* ``python setup.py bdist_wheel``: create a binary archive from a source
-  archive or checkout
-* ``python setup.py test``: run the distribution's test suite on a built
-  (but not yet installed) distribution
-
-Future iterations of the metadata will aim to replace these ``distutils``/
-``setuptools`` dependent commands with build system independent entry
-points.
-
 
 Development and publication of distributions
 --------------------------------------------
@@ -307,17 +293,30 @@
 * specify the additional dependencies (if any) required to develop and
   publish the distribution
 
-The current iteration of the metadata relies on the ``distutils`` commands
-system to support other necessary development and publication activities:
-
-* ``python setup.py dist_info``: generate the ``pymeta.json`` file for a
-  distribution
+
+Standard build system
+---------------------
+
+Both development and integration of distributions relies on the ability to
+build extension modules and perform other operations in a distribution
+independent manner.
+
+The current iteration of the metadata relies on the
+``distutils``/``setuptools`` commands system to support these necessary
+development and integration activities:
+
+* ``python setup.py dist_info``: generate distribution metadata in place
+  given a source archive or VCS checkout
 * ``python setup.py sdist``: create an sdist from a source archive
   or VCS checkout
-* ``python setup.py test``: run the distribution's test suite on a built
-  (but not yet installed) distribution
-
-Future iterations of the metadata and associated PEPs will aim to replace
+* ``python setup.py build_ext --inplace``: build extension modules in place
+  given an sdist, source archive or VCS checkout
+* ``python setup.py test``: run the distribution's test suite in place
+  given an sdist, source archive or VCS checkout
+* ``python setup.py bdist_wheel``: create a binary archive from an sdist,
+  source archive or VCS checkout
+
+Future iterations of the metadata and associated PEPs may aim to replace
 these ``distutils``/``setuptools`` dependent commands with build system
 independent entry points.
 
@@ -1506,11 +1505,12 @@
 Install hook implementations MUST use the given parameter names.
 
 Installation tools SHOULD invoke install hooks automatically after
-installing a distribution from a binary archive. When installing from
-an sdist, source archive or VCS checkout using ``setup.py install``
-installation tools MUST NOT invoke the install hooks - it is assumed
-that the ``setup.py`` script will already invoke any necessary
-post-installation behaviour.
+installing a distribution from a binary archive.
+
+When installing from an sdist, source archive or VCS checkout, installation
+tools SHOULD create a binary archive using ``setup.py bdist_wheel`` and
+then install binary archive normally (including invocation of any install
+hooks). Installation tools SHOULD NOT invoke ``setup.py install`` directly.
 
 Installation tools SHOULD treat an exception thrown by a postinstall hook
 as a failure of the installation and revert any other changes made to the
@@ -2024,8 +2024,9 @@
 communities, while still interoperating with the cross-platform Python
 tools.
 
-Falling back to invoking ``setup.py install`` directly remains as the
-interim solution for installation from source archives.
+Legacy packages that expect to able to run code on target systems using
+``setup.py install`` will no longer work correctly. Such packages will
+already break when pip 1.4+ is configured to use a wheel cache directory.
 
 
 Changes to environment markers
@@ -2252,8 +2253,9 @@
 
 * ``python setup.py dist_info``
 * ``python setup.py sdist``
+* ``python setup.py build_ext --inplace``
+* ``python setup.py test``
 * ``python setup.py bdist_wheel``
-* ``python setup.py test``
 
 The following metabuild hooks may be defined in metadata 2.1 to
 cover these operations without relying on ``setup.py``:
@@ -2326,6 +2328,16 @@
 way it doesn't matter if the additional dependencies were requested
 explicitly or just happen to be available on the system.
 
+There are still a number of open questions with this design, such as whether
+a single build hook is sufficient to cover both "build for testing" and
+"prep for deployment", as well as various complexities like support for
+cross-compilation of binaries, specification of target platforms and
+Python versions when creating wheel files, etc.
+
+Opting to retain the status quo for now allows us to make progress on
+improved metadata publication and binary installation support, rather than
+having to delay that awaiting the creation of a viable metabuild framework.
+
 
 Appendix E: Rejected features
 =============================

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list