aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-01-27 10:02:52 -0500
committerGitHub <noreply@github.com>2019-01-27 10:02:52 -0500
commit0551421f082eea3f633bc6be23c16a04483aca98 (patch)
tree76c5b37e3a56a232b4b5b66ab7e933edbe64cd25 /docs
parent28872fc9e7d15a1acf3bc557795c76c5e64dbad3 (diff)
parent78fd73026ad7284819936b651f7cfbe8a1ec98c8 (diff)
downloadexternal_python_setuptools-0551421f082eea3f633bc6be23c16a04483aca98.tar.gz
external_python_setuptools-0551421f082eea3f633bc6be23c16a04483aca98.tar.bz2
external_python_setuptools-0551421f082eea3f633bc6be23c16a04483aca98.zip
Merge branch 'master' into license-fix-357
Diffstat (limited to 'docs')
-rw-r--r--docs/_templates/indexsidebar.html9
-rw-r--r--docs/developer-guide.txt17
-rw-r--r--docs/ez_setup.txt195
-rw-r--r--docs/index.txt2
-rw-r--r--docs/python3.txt2
-rw-r--r--docs/requirements.txt2
-rw-r--r--docs/roadmap.txt11
-rw-r--r--docs/setuptools.txt313
8 files changed, 343 insertions, 208 deletions
diff --git a/docs/_templates/indexsidebar.html b/docs/_templates/indexsidebar.html
index 80002d08..504de6b0 100644
--- a/docs/_templates/indexsidebar.html
+++ b/docs/_templates/indexsidebar.html
@@ -5,4 +5,11 @@
<h3>Questions? Suggestions? Contributions?</h3>
-<p>Visit the <a href="https://github.com/pypa/setuptools">Setuptools project page</a> </p>
+<p>Visit the <a href="{{ package_url }}">Project page</a> </p>
+
+<h3 class="donation">Professional support</h3>
+
+<p>
+Professionally-supported {{ project }} is available with the
+<a href="https://tidelift.com/subscription/pkg/pypi-{{ project }}?utm_source=pypi-{{ project }}&utm_medium=readme">Tidelift Subscription</a>.
+</p>
diff --git a/docs/developer-guide.txt b/docs/developer-guide.txt
index c011491a..a5942c8b 100644
--- a/docs/developer-guide.txt
+++ b/docs/developer-guide.txt
@@ -67,8 +67,8 @@ All PRs with code changes should include tests. All changes should include a
changelog entry.
``setuptools`` uses `towncrier <https://pypi.org/project/towncrier/>`_
-for changelog managment, so when making a PR, please add a news fragment in the
-``changelog.d/`` folder. Changelog files are written in Restructured Text and
+for changelog management, so when making a PR, please add a news fragment in the
+``changelog.d/`` folder. Changelog files are written in reStructuredText and
should be a 1 or 2 sentence description of the substantive changes in the PR.
They should be named ``<pr_number>.<category>.rst``, where the categories are:
@@ -76,7 +76,7 @@ They should be named ``<pr_number>.<category>.rst``, where the categories are:
- ``breaking``: Any backwards-compatibility breaking change
- ``doc``: A change to the documentation
- ``misc``: Changes internal to the repo like CI, test and build changes
-- ``deprecation``: For deprecations of an existing feature of behavior
+- ``deprecation``: For deprecations of an existing feature or behavior
A pull request may have more than one of these components, for example a code
change may introduce a new feature that deprecates an old feature, in which
@@ -89,6 +89,17 @@ code changes. See the following for an example news fragment:
$ cat changelog.d/1288.change.rst
Add support for maintainer in PKG-INFO
+-------------------
+Auto-Merge Requests
+-------------------
+
+To support running all code through CI, even lightweight contributions,
+the project employs Mergify to auto-merge pull requests tagged as
+auto-merge.
+
+Use ``hub pull-request -l auto-merge`` to create such a pull request
+from the command line after pushing a new branch.
+
-------
Testing
-------
diff --git a/docs/ez_setup.txt b/docs/ez_setup.txt
new file mode 100644
index 00000000..0126fee3
--- /dev/null
+++ b/docs/ez_setup.txt
@@ -0,0 +1,195 @@
+:orphan:
+
+``ez_setup`` distribution guide
+===============================
+
+Using ``setuptools``... Without bundling it!
+---------------------------------------------
+
+.. warning:: **ez_setup** is deprecated in favor of PIP with **PEP-518** support.
+
+.. _ez_setup.py: https://bootstrap.pypa.io/ez_setup.py
+
+.. _EasyInstall Installation Instructions: easy_install.html
+
+.. _Custom Installation Locations: easy_install.html
+
+Your users might not have ``setuptools`` installed on their machines, or even
+if they do, it might not be the right version. Fixing this is easy; just
+download `ez_setup.py`_, and put it in the same directory as your ``setup.py``
+script. (Be sure to add it to your revision control system, too.) Then add
+these two lines to the very top of your setup script, before the script imports
+anything from setuptools:
+
+.. code-block:: python
+
+ import ez_setup
+ ez_setup.use_setuptools()
+
+That's it. The ``ez_setup`` module will automatically download a matching
+version of ``setuptools`` from PyPI, if it isn't present on the target system.
+Whenever you install an updated version of setuptools, you should also update
+your projects' ``ez_setup.py`` files, so that a matching version gets installed
+on the target machine(s).
+
+(By the way, if you need to distribute a specific version of ``setuptools``,
+you can specify the exact version and base download URL as parameters to the
+``use_setuptools()`` function. See the function's docstring for details.)
+
+
+What Your Users Should Know
+---------------------------
+
+In general, a setuptools-based project looks just like any distutils-based
+project -- as long as your users have an internet connection and are installing
+to ``site-packages``, that is. But for some users, these conditions don't
+apply, and they may become frustrated if this is their first encounter with
+a setuptools-based project. To keep these users happy, you should review the
+following topics in your project's installation instructions, if they are
+relevant to your project and your target audience isn't already familiar with
+setuptools and ``easy_install``.
+
+Network Access
+ If your project is using ``ez_setup``, you should inform users of the
+ need to either have network access, or to preinstall the correct version of
+ setuptools using the `EasyInstall installation instructions`_. Those
+ instructions also have tips for dealing with firewalls as well as how to
+ manually download and install setuptools.
+
+Custom Installation Locations
+ You should inform your users that if they are installing your project to
+ somewhere other than the main ``site-packages`` directory, they should
+ first install setuptools using the instructions for `Custom Installation
+ Locations`_, before installing your project.
+
+Your Project's Dependencies
+ If your project depends on other projects that may need to be downloaded
+ from PyPI or elsewhere, you should list them in your installation
+ instructions, or tell users how to find out what they are. While most
+ users will not need this information, any users who don't have unrestricted
+ internet access may have to find, download, and install the other projects
+ manually. (Note, however, that they must still install those projects
+ using ``easy_install``, or your project will not know they are installed,
+ and your setup script will try to download them again.)
+
+ If you want to be especially friendly to users with limited network access,
+ you may wish to build eggs for your project and its dependencies, making
+ them all available for download from your site, or at least create a page
+ with links to all of the needed eggs. In this way, users with limited
+ network access can manually download all the eggs to a single directory,
+ then use the ``-f`` option of ``easy_install`` to specify the directory
+ to find eggs in. Users who have full network access can just use ``-f``
+ with the URL of your download page, and ``easy_install`` will find all the
+ needed eggs using your links directly. This is also useful when your
+ target audience isn't able to compile packages (e.g. most Windows users)
+ and your package or some of its dependencies include C code.
+
+Revision Control System Users and Co-Developers
+ Users and co-developers who are tracking your in-development code using
+ a revision control system should probably read this manual's sections
+ regarding such development. Alternately, you may wish to create a
+ quick-reference guide containing the tips from this manual that apply to
+ your particular situation. For example, if you recommend that people use
+ ``setup.py develop`` when tracking your in-development code, you should let
+ them know that this needs to be run after every update or commit.
+
+ Similarly, if you remove modules or data files from your project, you
+ should remind them to run ``setup.py clean --all`` and delete any obsolete
+ ``.pyc`` or ``.pyo``. (This tip applies to the distutils in general, not
+ just setuptools, but not everybody knows about them; be kind to your users
+ by spelling out your project's best practices rather than leaving them
+ guessing.)
+
+Creating System Packages
+ Some users want to manage all Python packages using a single package
+ manager, and sometimes that package manager isn't ``easy_install``!
+ Setuptools currently supports ``bdist_rpm``, ``bdist_wininst``, and
+ ``bdist_dumb`` formats for system packaging. If a user has a locally-
+ installed "bdist" packaging tool that internally uses the distutils
+ ``install`` command, it should be able to work with ``setuptools``. Some
+ examples of "bdist" formats that this should work with include the
+ ``bdist_nsi`` and ``bdist_msi`` formats for Windows.
+
+ However, packaging tools that build binary distributions by running
+ ``setup.py install`` on the command line or as a subprocess will require
+ modification to work with setuptools. They should use the
+ ``--single-version-externally-managed`` option to the ``install`` command,
+ combined with the standard ``--root`` or ``--record`` options.
+ See the `install command`_ documentation below for more details. The
+ ``bdist_deb`` command is an example of a command that currently requires
+ this kind of patching to work with setuptools.
+
+ Please note that building system packages may require you to install
+ some system software, for example ``bdist_rpm`` requires the ``rpmbuild``
+ command to be installed.
+
+ If you or your users have a problem building a usable system package for
+ your project, please report the problem via the mailing list so that
+ either the "bdist" tool in question or setuptools can be modified to
+ resolve the issue.
+
+Your users might not have ``setuptools`` installed on their machines, or even
+if they do, it might not be the right version. Fixing this is easy; just
+download `ez_setup.py`_, and put it in the same directory as your ``setup.py``
+script. (Be sure to add it to your revision control system, too.) Then add
+these two lines to the very top of your setup script, before the script imports
+anything from setuptools:
+
+.. code-block:: python
+
+ import ez_setup
+ ez_setup.use_setuptools()
+
+That's it. The ``ez_setup`` module will automatically download a matching
+version of ``setuptools`` from PyPI, if it isn't present on the target system.
+Whenever you install an updated version of setuptools, you should also update
+your projects' ``ez_setup.py`` files, so that a matching version gets installed
+on the target machine(s).
+
+(By the way, if you need to distribute a specific version of ``setuptools``,
+you can specify the exact version and base download URL as parameters to the
+``use_setuptools()`` function. See the function's docstring for details.)
+
+.. _install command:
+
+``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. It is also automatically in effect if
+you specify the ``--root`` option.
+
+
+``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.
diff --git a/docs/index.txt b/docs/index.txt
index 74aabb5e..13a46e74 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -17,9 +17,9 @@ Documentation content:
:maxdepth: 2
setuptools
- easy_install
pkg_resources
python3
development
roadmap
+ Deprecated: Easy Install <easy_install>
history
diff --git a/docs/python3.txt b/docs/python3.txt
index c528fc3c..6b55fe78 100644
--- a/docs/python3.txt
+++ b/docs/python3.txt
@@ -9,7 +9,7 @@ code.
Setuptools provides a facility to invoke 2to3 on the code as a part of the
build process, by setting the keyword parameter ``use_2to3`` to True, but
-the Setuptools strongly recommends instead developing a unified codebase
+the Setuptools project strongly recommends instead developing a unified codebase
using `six <https://pypi.org/project/six/>`_,
`future <https://pypi.org/project/future/>`_, or another compatibility
library.
diff --git a/docs/requirements.txt b/docs/requirements.txt
index c6d594e8..bc27165b 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,5 +1,5 @@
sphinx!=1.8.0
rst.linker>=1.9
-jaraco.packaging>=3.2
+jaraco.packaging>=6.1
setuptools>=34
diff --git a/docs/roadmap.txt b/docs/roadmap.txt
index d5a127e8..147288f3 100644
--- a/docs/roadmap.txt
+++ b/docs/roadmap.txt
@@ -2,11 +2,6 @@
Roadmap
=======
-Setuptools has the following large-scale goals on the roadmap:
-
-- Mature declarative config to supersede imperative config in
- all supported use-cases and harmonize with pyproject.toml
- syntax.
-- Deprecate and remove setup_requires and easy_install in
- favor of PEP 518 build requirements and pip install.
-- Adopt the Distutils package and stop monkeypatching stdlib.
+Setuptools maintains a series of `milestones
+<https://github.com/pypa/setuptools/milestones>`_ to track
+a roadmap of large-scale goals.
diff --git a/docs/setuptools.txt b/docs/setuptools.txt
index 436f207d..a4e05d75 100644
--- a/docs/setuptools.txt
+++ b/docs/setuptools.txt
@@ -41,9 +41,9 @@ Feature Highlights:
files for any number of "main" functions in your project. (Note: this is not
a py2exe replacement; the .exe files rely on the local Python installation.)
-* Transparent Pyrex support, so that your setup.py can list ``.pyx`` files and
- still work even when the end-user doesn't have Pyrex installed (as long as
- you include the Pyrex-generated C in your source distribution)
+* Transparent Cython support, so that your setup.py can list ``.pyx`` files and
+ still work even when the end-user doesn't have Cython installed (as long as
+ you include the Cython-generated C in your source distribution)
* Command aliases - create project-specific, per-user, or site-wide shortcut
names for commonly used commands and options
@@ -73,23 +73,17 @@ Developer's Guide
Installing ``setuptools``
=========================
-Please follow the `EasyInstall Installation Instructions`_ to install the
-current stable version of setuptools. In particular, be sure to read the
-section on `Custom Installation Locations`_ if you are installing anywhere
-other than Python's ``site-packages`` directory.
+.. _EasyInstall Installation Instructions: easy_install.html
-.. _EasyInstall Installation Instructions: easy_install.html#installation-instructions
+.. _Custom Installation Locations: easy_install.html
-.. _Custom Installation Locations: easy_install.html#custom-installation-locations
+.. _Installing Packages: https://packaging.python.org/tutorials/installing-packages/
-If you want the current in-development version of setuptools, you should first
-install a stable version, and then run::
+To install the latest version of setuptools, use::
- ez_setup.py setuptools==dev
-
-This will download and install the latest development (i.e. unstable) version
-of setuptools from the Python Subversion sandbox.
+ pip install -U setuptools
+Refer to `Installing Packages`_ guide for more information.
Basic Use
=========
@@ -1229,121 +1223,53 @@ the quoted part.
Distributing a ``setuptools``-based project
===========================================
-Using ``setuptools``... Without bundling it!
----------------------------------------------
+Detailed instructions to distribute a setuptools project can be found at
+`Packaging project tutorials`_.
-.. warning:: **ez_setup** is deprecated in favor of PIP with **PEP-518** support.
+.. _Packaging project tutorials: https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives
-Your users might not have ``setuptools`` installed on their machines, or even
-if they do, it might not be the right version. Fixing this is easy; just
-download `ez_setup.py`_, and put it in the same directory as your ``setup.py``
-script. (Be sure to add it to your revision control system, too.) Then add
-these two lines to the very top of your setup script, before the script imports
-anything from setuptools:
+Before you begin, make sure you have the latest versions of setuptools and wheel::
-.. code-block:: python
+ python3 -m pip install --user --upgrade setuptools wheel
- import ez_setup
- ez_setup.use_setuptools()
+To build a setuptools project, run this command from the same directory where
+setup.py is located::
-That's it. The ``ez_setup`` module will automatically download a matching
-version of ``setuptools`` from PyPI, if it isn't present on the target system.
-Whenever you install an updated version of setuptools, you should also update
-your projects' ``ez_setup.py`` files, so that a matching version gets installed
-on the target machine(s).
+ python3 setup.py sdist bdist_wheel
-(By the way, if you need to distribute a specific version of ``setuptools``,
-you can specify the exact version and base download URL as parameters to the
-``use_setuptools()`` function. See the function's docstring for details.)
+This will generate distribution archives in the `dist` directory.
+Before you upload the generated archives make sure you're registered on
+https://test.pypi.org/account/register/. You will also need to verify your email
+to be able to upload any packages.
+You should install twine to be able to upload packages::
-What Your Users Should Know
----------------------------
+ python3 -m pip install --user --upgrade setuptools wheel
+
+Now, to upload these archives, run::
+
+ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
+
+To install your newly uploaded package ``example_pkg``, you can use pip::
+
+ python3 -m pip install --index-url https://test.pypi.org/simple/ example_pkg
+
+If you have issues at any point, please refer to `Packaging project tutorials`_
+for clarification.
+
+Distributing legacy ``setuptools`` projects using ez_setup.py
+-------------------------------------------------------------
+
+.. warning:: **ez_setup** is deprecated in favor of PIP with **PEP-518** support.
+
+Distributing packages using the legacy ``ez_setup.py`` and ``easy_install`` is
+deprecated in favor of PIP. Please consider migrating to using pip and twine based
+distribution.
-In general, a setuptools-based project looks just like any distutils-based
-project -- as long as your users have an internet connection and are installing
-to ``site-packages``, that is. But for some users, these conditions don't
-apply, and they may become frustrated if this is their first encounter with
-a setuptools-based project. To keep these users happy, you should review the
-following topics in your project's installation instructions, if they are
-relevant to your project and your target audience isn't already familiar with
-setuptools and ``easy_install``.
-
-Network Access
- If your project is using ``ez_setup``, you should inform users of the
- need to either have network access, or to preinstall the correct version of
- setuptools using the `EasyInstall installation instructions`_. Those
- instructions also have tips for dealing with firewalls as well as how to
- manually download and install setuptools.
-
-Custom Installation Locations
- You should inform your users that if they are installing your project to
- somewhere other than the main ``site-packages`` directory, they should
- first install setuptools using the instructions for `Custom Installation
- Locations`_, before installing your project.
-
-Your Project's Dependencies
- If your project depends on other projects that may need to be downloaded
- from PyPI or elsewhere, you should list them in your installation
- instructions, or tell users how to find out what they are. While most
- users will not need this information, any users who don't have unrestricted
- internet access may have to find, download, and install the other projects
- manually. (Note, however, that they must still install those projects
- using ``easy_install``, or your project will not know they are installed,
- and your setup script will try to download them again.)
-
- If you want to be especially friendly to users with limited network access,
- you may wish to build eggs for your project and its dependencies, making
- them all available for download from your site, or at least create a page
- with links to all of the needed eggs. In this way, users with limited
- network access can manually download all the eggs to a single directory,
- then use the ``-f`` option of ``easy_install`` to specify the directory
- to find eggs in. Users who have full network access can just use ``-f``
- with the URL of your download page, and ``easy_install`` will find all the
- needed eggs using your links directly. This is also useful when your
- target audience isn't able to compile packages (e.g. most Windows users)
- and your package or some of its dependencies include C code.
-
-Revision Control System Users and Co-Developers
- Users and co-developers who are tracking your in-development code using
- a revision control system should probably read this manual's sections
- regarding such development. Alternately, you may wish to create a
- quick-reference guide containing the tips from this manual that apply to
- your particular situation. For example, if you recommend that people use
- ``setup.py develop`` when tracking your in-development code, you should let
- them know that this needs to be run after every update or commit.
-
- Similarly, if you remove modules or data files from your project, you
- should remind them to run ``setup.py clean --all`` and delete any obsolete
- ``.pyc`` or ``.pyo``. (This tip applies to the distutils in general, not
- just setuptools, but not everybody knows about them; be kind to your users
- by spelling out your project's best practices rather than leaving them
- guessing.)
-
-Creating System Packages
- Some users want to manage all Python packages using a single package
- manager, and sometimes that package manager isn't ``easy_install``!
- Setuptools currently supports ``bdist_rpm``, ``bdist_wininst``, and
- ``bdist_dumb`` formats for system packaging. If a user has a locally-
- installed "bdist" packaging tool that internally uses the distutils
- ``install`` command, it should be able to work with ``setuptools``. Some
- examples of "bdist" formats that this should work with include the
- ``bdist_nsi`` and ``bdist_msi`` formats for Windows.
-
- However, packaging tools that build binary distributions by running
- ``setup.py install`` on the command line or as a subprocess will require
- modification to work with setuptools. They should use the
- ``--single-version-externally-managed`` option to the ``install`` command,
- combined with the standard ``--root`` or ``--record`` options.
- See the `install command`_ documentation below for more details. The
- ``bdist_deb`` command is an example of a command that currently requires
- this kind of patching to work with setuptools.
-
- If you or your users have a problem building a usable system package for
- your project, please report the problem via the mailing list so that
- either the "bdist" tool in question or setuptools can be modified to
- resolve the issue.
+However, if you still have any ``ez_setup`` based packages, documentation for
+ez_setup based distributions can be found at `ez_setup distribution guide`_.
+.. _ez_setup distribution guide: ez_setup.html
Setting the ``zip_safe`` flag
-----------------------------
@@ -1651,29 +1577,43 @@ See the sections below on the `egg_info`_ and `alias`_ commands for more ideas.
-Distributing Extensions compiled with Pyrex
--------------------------------------------
+Distributing Extensions compiled with Cython
+--------------------------------------------
-``setuptools`` includes transparent support for building Pyrex extensions, as
-long as you define your extensions using ``setuptools.Extension``, *not*
-``distutils.Extension``. You must also not import anything from Pyrex in
-your setup script.
+``setuptools`` will detect at build time whether Cython is installed or not.
+If Cython is not found ``setuptools`` will ignore pyx files.
+
+To ensure Cython is available, include Cython in the build-requires section
+of your pyproject.toml::
+
+ [build-system]
+ requires=[..., 'cython']
+
+Built with pip 10 or later, that declaration is sufficient to include Cython
+in the build. For broader compatibility, declare the dependency in your
+setup-requires of setup.cfg::
+
+ [options]
+ setup_requires =
+ ...
+ cython
+
+As long as Cython is present in the build environment, ``setuptools`` includes
+transparent support for building Cython extensions, as
+long as extensions are defined using ``setuptools.Extension``.
If you follow these rules, you can safely list ``.pyx`` files as the source
-of your ``Extension`` objects in the setup script. ``setuptools`` will detect
-at build time whether Pyrex is installed or not. If it is, then ``setuptools``
-will use it. If not, then ``setuptools`` will silently change the
-``Extension`` objects to refer to the ``.c`` counterparts of the ``.pyx``
-files, so that the normal distutils C compilation process will occur.
+of your ``Extension`` objects in the setup script. If it is, then ``setuptools``
+will use it.
Of course, for this to work, your source distributions must include the C
-code generated by Pyrex, as well as your original ``.pyx`` files. This means
+code generated by Cython, as well as your original ``.pyx`` files. This means
that you will probably want to include current ``.c`` files in your revision
control system, rebuilding them whenever you check changes in for the ``.pyx``
source files. This will ensure that people tracking your project in a revision
-control system will be able to build it even if they don't have Pyrex
+control system will be able to build it even if they don't have Cython
installed, and that your source releases will be similarly usable with or
-without Pyrex.
+without Cython.
-----------------
@@ -2046,52 +1986,6 @@ specified in ``setup.cfg``::
(Notice that ``egg_info`` must always appear on the command line *before* any
commands that you want the version changes to apply to.)
-
-.. _install command:
-
-``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. It is also automatically in effect if
-you specify the ``--root`` option.
-
-
-``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:
``rotate`` - Delete outdated distribution files
@@ -2400,6 +2294,35 @@ Metadata and options are set in the config sections of the same name.
* Unknown keys are ignored.
+Using a ``src/`` layout
+=======================
+
+One commonly used package configuration has all the module source code in a
+subdirectory (often called the ``src/`` layout), like this::
+
+ ├── src
+ │   └── mypackage
+ │   ├── __init__.py
+ │   └── mod1.py
+ ├── setup.py
+ └── setup.cfg
+
+You can set up your ``setup.cfg`` to automatically find all your packages in
+the subdirectory like this:
+
+.. code-block:: ini
+
+ # This example contains just the necessary options for a src-layout, set up
+ # the rest of the file as described above.
+
+ [options]
+ package_dir=
+ =src
+ packages=find:
+
+ [options.packages.find]
+ where=src
+
Specifying values
=================
@@ -2434,42 +2357,45 @@ Metadata
The aliases given below are supported for compatibility reasons,
but their use is not advised.
-============================== ================= =====
-Key Aliases Type
-============================== ================= =====
+============================== ================= ================= =============== =====
+Key Aliases Type Minimum Version Notes
+============================== ================= ================= =============== =====
name str
-version attr:, file:, str
+version attr:, file:, str 39.2.0 (1)
url home-page str
download_url download-url str
-project_urls dict
+project_urls dict 38.3.0
author str
author_email author-email str
maintainer str
maintainer_email maintainer-email str
classifiers classifier file:, list-comma
-license file:, str
+license str
license_file str
description summary file:, str
long_description long-description file:, str
-long_description_content_type str
+long_description_content_type str 38.6.0
keywords list-comma
platforms platform list-comma
provides list-comma
requires list-comma
obsoletes list-comma
-============================== ================= =====
+============================== ================= ================= =============== =====
.. note::
A version loaded using the ``file:`` directive must comply with PEP 440.
It is easy to accidentally put something other than a valid version
string in such a file, so validation is stricter in this case.
+Notes:
+1. The `version` file attribute has only been supported since 39.2.0.
+
Options
-------
-======================= =====
-Key Type
-======================= =====
+======================= =================================== =============== =====
+Key Type Minimum Version Notes
+======================= =================================== =============== =====
zip_safe bool
setup_requires list-semi
install_requires list-semi
@@ -2491,7 +2417,8 @@ package_data section
exclude_package_data section
namespace_packages list-comma
py_modules list-comma
-======================= =====
+data_files dict 40.6.0
+======================= =================================== =============== =====
.. note::
@@ -2500,7 +2427,7 @@ py_modules list-comma
accepts the same keys as the `setuptools.find_packages` and the
`setuptools.find_namespace_packages` function:
``where``, ``include``, and ``exclude``.
-
+
**find_namespace directive** - The ``find_namespace:`` directive is supported since Python >=3.3.