summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-09-03 19:57:54 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-09-03 20:01:45 -0400
commitdcb24ad15465c266a3f258471766fbbe8fc8a42e (patch)
tree13123440610d78e398476a8ce1e8cc3d9f9ec72e /docs
parentf14930e66601b462699c44384c482cd966f53b8f (diff)
parent1b192005562d5cf0de30c02154c58fd1dca577c8 (diff)
downloadpython-setuptools-git-dcb24ad15465c266a3f258471766fbbe8fc8a42e.tar.gz
Merge branch 'master' into drop-py26
Diffstat (limited to 'docs')
-rw-r--r--docs/_templates/indexsidebar.html2
-rw-r--r--docs/conf.py72
-rw-r--r--docs/developer-guide.txt10
-rw-r--r--docs/history.txt38
-rw-r--r--docs/index.txt6
-rw-r--r--docs/pkg_resources.txt10
-rw-r--r--docs/releases.txt29
-rw-r--r--docs/requirements.txt6
-rw-r--r--docs/setuptools.txt307
9 files changed, 203 insertions, 277 deletions
diff --git a/docs/_templates/indexsidebar.html b/docs/_templates/indexsidebar.html
index a27c85fe..3b127602 100644
--- a/docs/_templates/indexsidebar.html
+++ b/docs/_templates/indexsidebar.html
@@ -5,4 +5,4 @@
<h3>Questions? Suggestions? Contributions?</h3>
-<p>Visit the <a href="https://bitbucket.org/pypa/setuptools">Setuptools project page</a> </p>
+<p>Visit the <a href="https://github.com/pypa/setuptools">Setuptools project page</a> </p>
diff --git a/docs/conf.py b/docs/conf.py
index fae8e632..f7d02303 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -18,18 +18,23 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-# Allow Sphinx to find the setup command that is imported below, as referenced above.
-import os
+import subprocess
import sys
-sys.path.append(os.path.abspath('..'))
+import os
+
-import setup as setup_script
+# hack to run the bootstrap script so that jaraco.packaging.sphinx
+# can invoke setup.py
+'READTHEDOCS' in os.environ and subprocess.check_call(
+ [sys.executable, 'bootstrap.py'],
+ cwd=os.path.join(os.path.dirname(__file__), os.path.pardir),
+)
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['rst.linker']
+extensions = ['jaraco.packaging.sphinx', 'rst.linker', 'sphinx.ext.autosectionlabel']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -40,19 +45,6 @@ source_suffix = '.txt'
# The master toctree document.
master_doc = 'index'
-# General information about the project.
-project = 'Setuptools'
-copyright = '2009-2014, The fellowship of the packaging'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = setup_script.setup_params['version']
-# The full version, including alpha/beta/rc tags.
-release = setup_script.setup_params['version']
-
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = []
@@ -69,13 +61,6 @@ html_theme = 'nature'
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['_theme']
-# The name for this set of Sphinx documents. If None, it defaults to
-# "<project> v<release> documentation".
-html_title = "Setuptools documentation"
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-html_short_title = "Setuptools"
-
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = True
@@ -89,9 +74,6 @@ html_use_modindex = False
# If false, no index is generated.
html_use_index = False
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'Setuptoolsdoc'
-
# -- Options for LaTeX output --------------------------------------------------
# Grouping the document tree into LaTeX files. List of tuples
@@ -109,56 +91,60 @@ link_files = {
),
replace=[
dict(
- pattern=r"(Issue )?#(?P<issue>\d+)",
- url='{GH}/pypa/setuptools/issues/{issue}',
+ pattern=r'(Issue )?#(?P<issue>\d+)',
+ url='{package_url}/issues/{issue}',
),
dict(
- pattern=r"BB Pull Request ?#(?P<bb_pull_request>\d+)",
+ pattern=r'BB Pull Request ?#(?P<bb_pull_request>\d+)',
url='{BB}/pypa/setuptools/pull-request/{bb_pull_request}',
),
dict(
- pattern=r"Distribute #(?P<distribute>\d+)",
+ pattern=r'Distribute #(?P<distribute>\d+)',
url='{BB}/tarek/distribute/issue/{distribute}',
),
dict(
- pattern=r"Buildout #(?P<buildout>\d+)",
+ pattern=r'Buildout #(?P<buildout>\d+)',
url='{GH}/buildout/buildout/issues/{buildout}',
),
dict(
- pattern=r"Old Setuptools #(?P<old_setuptools>\d+)",
+ pattern=r'Old Setuptools #(?P<old_setuptools>\d+)',
url='http://bugs.python.org/setuptools/issue{old_setuptools}',
),
dict(
- pattern=r"Jython #(?P<jython>\d+)",
+ pattern=r'Jython #(?P<jython>\d+)',
url='http://bugs.jython.org/issue{jython}',
),
dict(
- pattern=r"Python #(?P<python>\d+)",
+ pattern=r'Python #(?P<python>\d+)',
url='http://bugs.python.org/issue{python}',
),
dict(
- pattern=r"Interop #(?P<interop>\d+)",
+ pattern=r'Interop #(?P<interop>\d+)',
url='{GH}/pypa/interoperability-peps/issues/{interop}',
),
dict(
- pattern=r"Pip #(?P<pip>\d+)",
+ pattern=r'Pip #(?P<pip>\d+)',
url='{GH}/pypa/pip/issues/{pip}',
),
dict(
- pattern=r"Packaging #(?P<packaging>\d+)",
+ pattern=r'Packaging #(?P<packaging>\d+)',
url='{GH}/pypa/packaging/issues/{packaging}',
),
dict(
- pattern=r"[Pp]ackaging (?P<packaging_ver>\d+(\.\d+)+)",
+ pattern=r'[Pp]ackaging (?P<packaging_ver>\d+(\.\d+)+)',
url='{GH}/pypa/packaging/blob/{packaging_ver}/CHANGELOG.rst',
),
dict(
- pattern=r"PEP[- ](?P<pep_number>\d+)",
+ pattern=r'PEP[- ](?P<pep_number>\d+)',
url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
),
dict(
- pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
- with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n",
+ pattern=r'setuptools_svn #(?P<setuptools_svn>\d+)',
+ url='{GH}/jaraco/setuptools_svn/issues/{setuptools_svn}',
+ ),
+ dict(
+ pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
+ with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
),
],
),
diff --git a/docs/developer-guide.txt b/docs/developer-guide.txt
index c8f51b02..8a136380 100644
--- a/docs/developer-guide.txt
+++ b/docs/developer-guide.txt
@@ -13,11 +13,11 @@ Recommended Reading
-------------------
Please read `How to write the perfect pull request
-<http://blog.jaraco.com/2014/04/how-to-write-perfect-pull-request.html>`_
-for some tips on contributing to open source projects. Although the article
-is not authoritative, it was authored by the maintainer of Setuptools, so
-reflects his opinions and will improve the likelihood of acceptance and
-quality of contribution.
+<https://blog.jaraco.com/how-to-write-perfect-pull-request/>`_ for some tips
+on contributing to open source projects. Although the article is not
+authoritative, it was authored by the maintainer of Setuptools, so reflects
+his opinions and will improve the likelihood of acceptance and quality of
+contribution.
------------------
Project Management
diff --git a/docs/history.txt b/docs/history.txt
index 8e217503..8fd1dc65 100644
--- a/docs/history.txt
+++ b/docs/history.txt
@@ -6,3 +6,41 @@ History
*******
.. include:: ../CHANGES (links).rst
+
+Credits
+*******
+
+* The original design for the ``.egg`` format and the ``pkg_resources`` API was
+ co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first
+ version of ``pkg_resources``, and supplied the OS X operating system version
+ compatibility algorithm.
+
+* Ian Bicking implemented many early "creature comfort" features of
+ easy_install, including support for downloading via Sourceforge and
+ Subversion repositories. Ian's comments on the Web-SIG about WSGI
+ application deployment also inspired the concept of "entry points" in eggs,
+ and he has given talks at PyCon and elsewhere to inform and educate the
+ community about eggs and setuptools.
+
+* Jim Fulton contributed time and effort to build automated tests of various
+ aspects of ``easy_install``, and supplied the doctests for the command-line
+ ``.exe`` wrappers on Windows.
+
+* Phillip J. Eby is the seminal author of setuptools, and
+ first proposed the idea of an importable binary distribution format for
+ Python application plug-ins.
+
+* Significant parts of the implementation of setuptools were funded by the Open
+ Source Applications Foundation, to provide a plug-in infrastructure for the
+ Chandler PIM application. In addition, many OSAF staffers (such as Mike
+ "Code Bear" Taylor) contributed their time and stress as guinea pigs for the
+ use of eggs and setuptools, even before eggs were "cool". (Thanks, guys!)
+
+* Tarek Ziadé is the principal author of the Distribute fork, which
+ re-invigorated the community on the project, encouraged renewed innovation,
+ and addressed many defects.
+
+* Since the merge with Distribute, Jason R. Coombs is the
+ maintainer of setuptools. The project is maintained in coordination with
+ the Python Packaging Authority (PyPA) and the larger Python community.
+
diff --git a/docs/index.txt b/docs/index.txt
index 6ac37252..74aabb5e 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -16,10 +16,10 @@ Documentation content:
.. toctree::
:maxdepth: 2
- history
- roadmap
- python3
setuptools
easy_install
pkg_resources
+ python3
development
+ roadmap
+ history
diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt
index c504412d..8d337cb2 100644
--- a/docs/pkg_resources.txt
+++ b/docs/pkg_resources.txt
@@ -143,10 +143,10 @@ namespace package for Zope Corporation packages, and the ``peak`` namespace
package for the Python Enterprise Application Kit.
To create a namespace package, you list it in the ``namespace_packages``
-argument to ``setup()``, in your project's ``setup.py``. (See the `setuptools
-documentation on namespace packages`_ for more information on this.) Also,
-you must add a ``declare_namespace()`` call in the package's ``__init__.py``
-file(s):
+argument to ``setup()``, in your project's ``setup.py``. (See the
+:ref:`setuptools documentation on namespace packages <Namespace Packages>` for
+more information on this.) Also, you must add a ``declare_namespace()`` call
+in the package's ``__init__.py`` file(s):
``declare_namespace(name)``
Declare that the dotted package name `name` is a "namespace package" whose
@@ -175,8 +175,6 @@ filesystem and zip importers, you can extend its support to other "importers"
compatible with PEP 302 using the ``register_namespace_handler()`` function.
See the section below on `Supporting Custom Importers`_ for details.
-.. _setuptools documentation on namespace packages: http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
-
``WorkingSet`` Objects
======================
diff --git a/docs/releases.txt b/docs/releases.txt
index c84ddd75..30ea084f 100644
--- a/docs/releases.txt
+++ b/docs/releases.txt
@@ -7,25 +7,20 @@ mechanical technique for releases, enacted by Travis following a
successful build of a tagged release per
`PyPI deployment <https://docs.travis-ci.com/user/deployment/pypi>`_.
-To cut a release, install and run ``bumpversion {part}`` where ``part``
+Prior to cutting a release, please check that the CHANGES.rst reflects
+the summary of changes since the last release.
+Ideally, these changelog entries would have been added
+along with the changes, but it's always good to check.
+Think about it from the
+perspective of a user not involved with the development--what would
+that person want to know about what has changed--or from the
+perspective of your future self wanting to know when a particular
+change landed.
+
+To cut a release, install and run ``bump2version {part}`` where ``part``
is major, minor, or patch based on the scope of the changes in the
release. Then, push the commits to the master branch. If tests pass,
-the release will be uploaded to PyPI (from the Python 3.5 tests).
-
-Bootstrap Branch
-----------------
-
-Setuptools has a bootstrap script (ez_setup.py), which is hosted in the
-repository in the ``bootstrap`` branch.
-
-Therefore, the latest bootstrap script can be retrieved by checking out
-that branch.
-
-The officially-published location of the bootstrap script is hosted on Python
-infrastructure (#python-infra on freenode) at https://bootstrap.pypa.io and
-is updated every fifteen minutes from the bootstrap branch. Sometimes,
-especially when the bootstrap script is rolled back, this
-process doesn't work as expected and requires manual intervention.
+the release will be uploaded to PyPI (from the Python 3.6 tests).
Release Frequency
-----------------
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 0871ed76..2138c884 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1 +1,5 @@
-rst.linker>=1.6.1
+sphinx
+rst.linker>=1.9
+jaraco.packaging>=3.2
+
+setuptools>=34
diff --git a/docs/setuptools.txt b/docs/setuptools.txt
index 1b0be77d..a9242a51 100644
--- a/docs/setuptools.txt
+++ b/docs/setuptools.txt
@@ -59,14 +59,6 @@ Feature Highlights:
* Create extensible applications and frameworks that automatically discover
extensions, using simple "entry points" declared in a project's setup script.
-In addition to the PyPI downloads, the development version of ``setuptools``
-is available from the `Python SVN sandbox`_, and in-development versions of the
-`0.6 branch`_ are available as well.
-
-.. _0.6 branch: http://svn.python.org/projects/sandbox/branches/setuptools-0.6/#egg=setuptools-dev06
-
-.. _Python SVN sandbox: http://svn.python.org/projects/sandbox/trunk/setuptools/#egg=setuptools-dev
-
.. contents:: **Table of Contents**
.. _ez_setup.py: `bootstrap module`_
@@ -769,6 +761,40 @@ so that Package B doesn't have to remove the ``[PDF]`` from its requirement
specifier.
+.. _Platform Specific Dependencies:
+
+
+Declaring platform specific dependencies
+----------------------------------------
+
+Sometimes a project might require a dependency to run on a specific platform.
+This could to a package that back ports a module so that it can be used in
+older python versions. Or it could be a package that is required to run on a
+specific operating system. This will allow a project to work on multiple
+different platforms without installing dependencies that are not required for
+a platform that is installing the project.
+
+For example, here is a project that uses the ``enum`` module and ``pywin32``::
+
+ setup(
+ name="Project",
+ ...
+ install_requires=[
+ 'enum34;python_version<"3.4"',
+ 'pywin32 >= 1.0;platform_system=="Windows"'
+ ]
+ )
+
+Since the ``enum`` module was added in Python 3.4, it should only be installed
+if the python version is earlier. Since ``pywin32`` will only be used on
+windows, it should only be installed when the operating system is Windows.
+Specifying version requirements for the dependencies is supported as normal.
+
+The environmental markers that may be used for testing platform types are
+detailed in `PEP 508`_.
+
+.. _PEP 508: https://www.python.org/dev/peps/pep-0508/
+
Including Data Files
====================
@@ -914,14 +940,13 @@ Typically, existing programs manipulate a package's ``__file__`` attribute in
order to find the location of data files. However, this manipulation isn't
compatible with PEP 302-based import hooks, including importing from zip files
and Python Eggs. It is strongly recommended that, if you are using data files,
-you should use the `Resource Management API`_ of ``pkg_resources`` to access
+you should use the :ref:`ResourceManager API` of ``pkg_resources`` to access
them. The ``pkg_resources`` module is distributed as part of setuptools, so if
you're using setuptools to distribute your package, there is no reason not to
use its resource management API. See also `Accessing Package Resources`_ for
a quick example of converting code that uses ``__file__`` to use
``pkg_resources`` instead.
-.. _Resource Management API: http://peak.telecommunity.com/DevCenter/PkgResources#resourcemanager-api
.. _Accessing Package Resources: http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources
@@ -933,8 +958,8 @@ location (e.g. ``/usr/share``). This feature intended to be used for things
like documentation, example configuration files, and the like. ``setuptools``
does not install these data files in a separate location, however. They are
bundled inside the egg file or directory, alongside the Python modules and
-packages. The data files can also be accessed using the `Resource Management
-API`_, by specifying a ``Requirement`` instead of a package name::
+packages. The data files can also be accessed using the :ref:`ResourceManager
+API`, by specifying a ``Requirement`` instead of a package name::
from pkg_resources import Requirement, resource_filename
filename = resource_filename(Requirement.parse("MyProject"),"sample.conf")
@@ -1151,6 +1176,8 @@ Distributing a ``setuptools``-based project
Using ``setuptools``... Without bundling it!
---------------------------------------------
+.. warning:: **ez_setup** is deprecated in favor of PIP with **PEP-518** support.
+
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``
@@ -1422,10 +1449,6 @@ egg distributions by adding one or more of the following to the project's
manually-specified post-release tag, such as a build or revision number
(``--tag-build=STRING, -bSTRING``)
-* A "last-modified revision number" string generated automatically from
- Subversion's metadata (assuming your project is being built from a Subversion
- "working copy") (``--tag-svn-revision, -r``)
-
* An 8-character representation of the build date (``--tag-date, -d``), as
a postrelease tag
@@ -1557,68 +1580,6 @@ this::
in order to check out the in-development version of ``projectname``.
-Managing "Continuous Releases" Using Subversion
------------------------------------------------
-
-If you expect your users to track in-development versions of your project via
-Subversion, there are a few additional steps you should take to ensure that
-things work smoothly with EasyInstall. First, you should add the following
-to your project's ``setup.cfg`` file:
-
-.. code-block:: ini
-
- [egg_info]
- tag_build = .dev
- tag_svn_revision = 1
-
-This will tell ``setuptools`` to generate package version numbers like
-``1.0a1.dev-r1263``, which will be considered to be an *older* release than
-``1.0a1``. Thus, when you actually release ``1.0a1``, the entire egg
-infrastructure (including ``setuptools``, ``pkg_resources`` and EasyInstall)
-will know that ``1.0a1`` supersedes any interim snapshots from Subversion, and
-handle upgrades accordingly.
-
-(Note: the project version number you specify in ``setup.py`` should always be
-the *next* version of your software, not the last released version.
-Alternately, you can leave out the ``tag_build=.dev``, and always use the
-*last* release as a version number, so that your post-1.0 builds are labelled
-``1.0-r1263``, indicating a post-1.0 patchlevel. Most projects so far,
-however, seem to prefer to think of their project as being a future version
-still under development, rather than a past version being patched. It is of
-course possible for a single project to have both situations, using
-post-release numbering on release branches, and pre-release numbering on the
-trunk. But you don't have to make things this complex if you don't want to.)
-
-Commonly, projects releasing code from Subversion will include a PyPI link to
-their checkout URL (as described in the previous section) with an
-``#egg=projectname-dev`` suffix. This allows users to request EasyInstall
-to download ``projectname==dev`` in order to get the latest in-development
-code. Note that if your project depends on such in-progress code, you may wish
-to specify your ``install_requires`` (or other requirements) to include
-``==dev``, e.g.:
-
-.. code-block:: python
-
- install_requires=["OtherProject>=0.2a1.dev-r143,==dev"]
-
-The above example says, "I really want at least this particular development
-revision number, but feel free to follow and use an ``#egg=OtherProject-dev``
-link if you find one". This avoids the need to have actual source or binary
-distribution snapshots of in-development code available, just to be able to
-depend on the latest and greatest a project has to offer.
-
-A final note for Subversion development: if you are using SVN revision tags
-as described in this section, it's a good idea to run ``setup.py develop``
-after each Subversion checkin or update, because your project's version number
-will be changing, and your script wrappers need to be updated accordingly.
-
-Also, if the project's requirements have changed, the ``develop`` command will
-take care of fetching the updated dependencies, building changed extensions,
-etc. Be sure to also remind any of your users who check out your project
-from Subversion that they need to run ``setup.py develop`` after every update
-in order to keep their checkout completely in sync.
-
-
Making "Official" (Non-Snapshot) Releases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1632,18 +1593,18 @@ tagging the release, so the trunk will still produce development snapshots.
Alternately, if you are not branching for releases, you can override the
default version options on the command line, using something like::
- python setup.py egg_info -RDb "" sdist bdist_egg register upload
+ python setup.py egg_info -Db "" sdist bdist_egg register upload
-The first part of this command (``egg_info -RDb ""``) will override the
+The first part of this command (``egg_info -Db ""``) will override the
configured tag information, before creating source and binary eggs, registering
the project with PyPI, and uploading the files. Thus, these commands will use
-the plain version from your ``setup.py``, without adding the Subversion
-revision number or build designation string.
+the plain version from your ``setup.py``, without adding the build designation
+string.
Of course, if you will be doing this a lot, you may wish to create a personal
alias for this operation, e.g.::
- python setup.py alias -u release egg_info -RDb ""
+ python setup.py alias -u release egg_info -Db ""
You can then use it like this::
@@ -1703,8 +1664,7 @@ the command line supplies its expansion. For example, this command defines
a sitewide alias called "daily", that sets various ``egg_info`` tagging
options::
- setup.py alias --global-config daily egg_info --tag-svn-revision \
- --tag-build=development
+ setup.py alias --global-config daily egg_info --tag-build=development
Once the alias is defined, it can then be used with other setup commands,
e.g.::
@@ -1714,7 +1674,7 @@ e.g.::
setup.py daily sdist bdist_egg # generate both
The above commands are interpreted as if the word ``daily`` were replaced with
-``egg_info --tag-svn-revision --tag-build=development``.
+``egg_info --tag-build=development``.
Note that setuptools will expand each alias *at most once* in a given command
line. This serves two purposes. First, if you accidentally create an alias
@@ -2001,27 +1961,6 @@ added in the following order:
it on the command line using ``-b ""`` or ``--tag-build=""`` as an argument
to the ``egg_info`` command.
-``--tag-svn-revision, -r``
- If the current directory is a Subversion checkout (i.e. has a ``.svn``
- subdirectory, this appends a string of the form "-rNNNN" to the project's
- version string, where NNNN is the revision number of the most recent
- modification to the current directory, as obtained from the ``svn info``
- command.
-
- If the current directory is not a Subversion checkout, the command will
- look for a ``PKG-INFO`` file instead, and try to find the revision number
- from that, by looking for a "-rNNNN" string at the end of the version
- number. (This is so that building a package from a source distribution of
- a Subversion snapshot will produce a binary with the correct version
- number.)
-
- If there is no ``PKG-INFO`` file, or the version number contained therein
- does not end with ``-r`` and a number, then ``-r0`` is used.
-
-``--no-svn-revision, -R``
- Don't include the Subversion revision in the version number. This option
- is included so you can override a default setting put in ``setup.cfg``.
-
``--tag-date, -d``
Add a date stamp of the form "-YYYYMMDD" (e.g. "-20050528") to the
project's version number.
@@ -2335,73 +2274,16 @@ password from the keyring.
New in 20.1: Added keyring support.
-.. _upload_docs:
-
-``upload_docs`` - Upload package documentation to PyPI
-======================================================
-
-PyPI now supports uploading project documentation to the dedicated URL
-https://pythonhosted.org/<project>/.
-
-The ``upload_docs`` command will create the necessary zip file out of a
-documentation directory and will post to the repository.
-
-Note that to upload the documentation of a project, the corresponding version
-must already be registered with PyPI, using the distutils ``register``
-command -- just like the ``upload`` command.
-
-Assuming there is an ``Example`` project with documentation in the
-subdirectory ``docs``, e.g.::
-
- Example/
- |-- example.py
- |-- setup.cfg
- |-- setup.py
- |-- docs
- | |-- build
- | | `-- html
- | | | |-- index.html
- | | | `-- tips_tricks.html
- | |-- conf.py
- | |-- index.txt
- | `-- tips_tricks.txt
-
-You can simply pass the documentation directory path to the ``upload_docs``
-command::
-
- python setup.py upload_docs --upload-dir=docs/build/html
-
-If no ``--upload-dir`` is given, ``upload_docs`` will attempt to run the
-``build_sphinx`` command to generate uploadable documentation.
-For the command to become available, `Sphinx <http://sphinx.pocoo.org/>`_
-must be installed in the same environment as distribute.
-
-As with other ``setuptools``-based commands, you can define useful
-defaults in the ``setup.cfg`` of your Python project, e.g.:
-
-.. code-block:: ini
-
- [upload_docs]
- upload-dir = docs/build/html
-
-The ``upload_docs`` command has the following options:
-
-``--upload-dir``
- The directory to be uploaded to the repository.
-
-``--show-response``
- Display the full response text from server; this is useful for debugging
- PyPI problems.
-
-``--repository=URL, -r URL``
- The URL of the repository to upload to. Defaults to
- https://pypi.python.org/pypi (i.e., the main PyPI installation).
-
-----------------------------------------
Configuring setup() using setup.cfg files
-----------------------------------------
+.. note:: New in 30.3.0 (8 Dec 2016).
+
+.. important:: ``setup.py`` with ``setup()`` function call is still required even
+ if your configuration resides in ``setup.cfg``.
+
``Setuptools`` allows using configuration files (usually `setup.cfg`)
to define package’s metadata and other options which are normally supplied
to ``setup()`` function.
@@ -2424,13 +2306,13 @@ boilerplate code in some cases.
name = my_package
version = attr: src.VERSION
description = My package description
- long_description = file: README.rst
+ long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst
keywords = one, two
license = BSD 3-Clause License
-
- [metadata.classifiers]
- Framework :: Django
- Programming Language :: Python :: 3.5
+ classifiers =
+ Framework :: Django
+ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.5
[options]
zip_safe = False
@@ -2448,6 +2330,11 @@ boilerplate code in some cases.
pdf = ReportLab>=1.2; RXP
rest = docutils>=0.3; pack ==1.1, ==1.3
+ [options.packages.find]
+ exclude =
+ src.subpackage1
+ src.subpackage2
+
Metadata and options could be set in sections with the same names.
@@ -2486,13 +2373,13 @@ Type names used below:
* ``list-semi`` - dangling list or semicolon-separated values string
* ``bool`` - ``True`` is 1, yes, true
* ``dict`` - list-comma where keys from values are separated by =
+* ``section`` - values could be read from a dedicated (sub)section
Special directives:
* ``attr:`` - value could be read from module attribute
-* ``file:`` - value could be read from a file
-* ``section:`` - values could be read from a dedicated (sub)section
+* ``file:`` - value could be read from a list of files and then concatenated
.. note::
@@ -2507,30 +2394,33 @@ Metadata
Aliases given below are supported for compatibility reasons,
but not advised.
-================= ================= =====
-Key Aliases Accepted value type
-================= ================= =====
-name str
-version attr:, str
-url home-page str
-download_url download-url str
-author str
-author_email author-email str
-maintainer str
-maintainer_email maintainer-email str
-classifiers classifier file:, section, list-comma
-license file:, str
-description summary file:, str
-long_description long-description file:, str
-keywords list-comma
-platforms platform list-comma
-provides list-comma
-requires list-comma
-obsoletes list-comma
-================= ================= =====
-
-**version** - ``attr:`` supports callables; supports iterables;
-unsupported types are casted using ``str()``.
+============================== ================= =====
+Key Aliases Accepted value type
+============================== ================= =====
+name str
+version attr:, str
+url home-page str
+download_url download-url str
+author str
+author_email author-email str
+maintainer str
+maintainer_email maintainer-email str
+classifiers classifier file:, list-comma
+license file:, str
+description summary file:, str
+long_description long-description file:, str
+long_description_content_type str
+keywords list-comma
+platforms platform list-comma
+provides list-comma
+requires list-comma
+obsoletes list-comma
+============================== ================= =====
+
+.. note::
+
+ **version** - ``attr:`` supports callables; supports iterables;
+ unsupported types are casted using ``str()``.
Options
@@ -2543,7 +2433,8 @@ zip_safe bool
setup_requires list-semi
install_requires list-semi
extras_require section
-entry_points file, section
+python_requires str
+entry_points file:, section
use_2to3 bool
use_2to3_fixers list-comma
use_2to3_exclude_fixers list-comma
@@ -2558,8 +2449,16 @@ package_dir dict
package_data section
exclude_package_data section
namespace_packages list-comma
+py_modules list-comma
======================= =====
+.. note::
+
+ **packages** - ``find:`` directive can be further configured
+ in a dedicated subsection `options.packages.find`. This subsection
+ accepts the same keys as `setuptools.find` function:
+ `where`, `include`, `exclude`.
+
Configuration API
=================
@@ -2582,6 +2481,12 @@ in the first argument. To include values from other configuration files
which could be in various places set `find_others` function argument
to ``True``.
+If you have only a configuration file but not the whole package you can still
+try to get data out of it with the help of `ignore_option_errors` function
+argument. When it is set to ``True`` all options with errors possibly produced
+by directives, such as ``attr:`` and others will be silently ignored.
+As a consequence the resulting dictionary will include no such options.
+
--------------------------------
Extending and Reusing Setuptools