diff --git a/README.rst b/README.rst index 0ec5f2bc41..93bfd771ec 100644 --- a/README.rst +++ b/README.rst @@ -6,8 +6,8 @@ http://packaging.python.org The "Python Packaging User Guide" (PyPUG) aims to be the authoritative resource on how to package and install distributions in Python using current tools. -To follow the development of Python packaging, see the `Python -Packaging Authority `_. +To follow the development of Python packaging, see the :doc:`Python +Packaging Authority `. Code of Conduct --------------- diff --git a/source/conf.py b/source/conf.py index e47e45c05a..1a3ab3592f 100644 --- a/source/conf.py +++ b/source/conf.py @@ -398,14 +398,34 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { + 'boltons': ('https://boltons.readthedocs.io/en/latest/', None), + 'build': ('https://pypa-build.readthedocs.io/en/stable/', None), + 'cffi': ('https://cffi.readthedocs.io/en/latest/', None), + 'conda': ('https://conda.io/en/latest/', None), + 'devpi': ('https://devpi.net/docs/devpi/devpi/latest/+doc', None), + 'dh-virtualenv': ('https://dh-virtualenv.readthedocs.io/en/latest/', None), + 'distlib': ('https://distlib.readthedocs.io/en/latest/', None), + 'flexx': ('https://flexx.readthedocs.io/en/latest/', None), + 'nox': ('https://nox.thea.codes/en/latest/', None), 'openstack': ('https://docs.openstack.org/glance/latest/', None), + 'packaging': ('https://packaging.pypa.io/en/latest/', None), + 'packaging.python.org': ('https://packaging.python.org/', None), + 'pip': ('https://pip.pypa.io/en/latest/', None), + 'pipenv': ('https://pipenv.pypa.io/en/latest/', None), + 'piwheels': ('https://piwheels.readthedocs.io/en/latest/', None), + 'pybind11': ('https://pybind11.readthedocs.io/en/stable/', None), + 'pynsist': ('https://pynsist.readthedocs.io/en/latest/', None), + 'pypa': ('https://www.pypa.io/en/latest/', None), 'python': ('https://docs.python.org/3', None), + 'python-guide': ('https://docs.python-guide.org', None), 'python2': ('https://docs.python.org/2', None), - 'pip': ('https://pip.pypa.io/en/latest/', None), 'scipy': ('https://www.scipy.org', None), 'setuptools': ('https://setuptools.readthedocs.io/en/latest/', None), + 'spack': ('https://spack.readthedocs.io/en/latest/', None), + 'sphinx': ('https://www.sphinx-doc.org/en/master', None), 'tox': ('https://tox.readthedocs.io/en/latest/', None), 'twine': ('https://twine.readthedocs.io/en/stable/', None), + 'virtualenv': ('https://virtualenv.pypa.io/en/stable/', None), } diff --git a/source/contribute.rst b/source/contribute.rst index e51fab8e24..155945d230 100644 --- a/source/contribute.rst +++ b/source/contribute.rst @@ -18,9 +18,9 @@ Most of the work on the |PyPUG| takes place on the `open issues`__ and `pull requests`__. If you're planning to write or edit the guide, please read the :ref:`style guide `. -.. __: https://github.com/pypa/python-packaging-user-guide/ -.. __: https://github.com/pypa/python-packaging-user-guide/issues -.. __: https://github.com/pypa/python-packaging-user-guide/pulls +.. __: https://github.com/pypa/packaging.python.org/ +.. __: https://github.com/pypa/packaging.python.org/issues +.. __: https://github.com/pypa/packaging.python.org/pulls By contributing to the |PyPUG|, you're expected to follow the PSF's `Code of Conduct`__. @@ -124,7 +124,7 @@ Though not required to contribute, it may be useful to build this guide locally in order to test your changes. In order to build this guide locally, you'll need: -1. `Nox `_. You can install or upgrade +1. :doc:`Nox `. You can install or upgrade nox using ``pip``: .. code-block:: bash @@ -132,11 +132,8 @@ need: python -m pip install --user nox 2. Python 3.6. Our build scripts are designed to work with Python 3.6 only. - See the `Hitchhiker's Guide to Python installation instructions`_ to install - Python 3.6 on your operating system. - -.. _Hitchhiker's Guide to Python installation instructions: - http://docs.python-guide.org/en/latest/starting/installation/ + See the :doc:`Hitchhiker's Guide to Python installation instructions ` + to install Python 3.6 on your operating system. To build the guide, run the following bash command in the source folder: diff --git a/source/discussions/deploying-python-applications.rst b/source/discussions/deploying-python-applications.rst index d1bd91c05f..de781d9fd4 100644 --- a/source/discussions/deploying-python-applications.rst +++ b/source/discussions/deploying-python-applications.rst @@ -73,7 +73,7 @@ directory, independent of any other Python installation on the computer. A big advantage of Pynsist is that the Windows packages can be built on Linux. There are several examples for different kinds of programs (console, GUI) in -the `documentation `__. The tool is released +the `documentation `. The tool is released under the MIT-licence. Application bundles diff --git a/source/discussions/install-requires-vs-requirements.rst b/source/discussions/install-requires-vs-requirements.rst index 86bdf47813..95578bca86 100644 --- a/source/discussions/install-requires-vs-requirements.rst +++ b/source/discussions/install-requires-vs-requirements.rst @@ -88,4 +88,4 @@ installs them using ``python -m pip install -r``. ---- .. [1] For more on "Abstract" vs "Concrete" requirements, see - https://caremad.io/2013/07/setup-vs-requirement/. + https://caremad.io/posts/2013/07/setup-vs-requirement/. diff --git a/source/discussions/wheel-vs-egg.rst b/source/discussions/wheel-vs-egg.rst index a77657127f..8368fd2c02 100644 --- a/source/discussions/wheel-vs-egg.rst +++ b/source/discussions/wheel-vs-egg.rst @@ -39,7 +39,7 @@ Here's a breakdown of the important differences between :term:`Wheel` and :term: specification and the implementation that packaged it. * :term:`Wheel` is internally organized by `sysconfig path type - `_, + `_, therefore making it easier to convert to other formats. ---- diff --git a/source/glossary.rst b/source/glossary.rst index c4ac86c7a5..0d740bf390 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -128,7 +128,7 @@ Glossary PyPA is a working group that maintains many of the relevant projects in Python packaging. They maintain a site at - https://www.pypa.io, host projects on `GitHub + :doc:`pypa.io `, host projects on `GitHub `_ and `Bitbucket `_, and discuss issues on the `distutils-sig mailing list diff --git a/source/guides/analyzing-pypi-package-downloads.rst b/source/guides/analyzing-pypi-package-downloads.rst index f0b2c967dc..f66cd51322 100644 --- a/source/guides/analyzing-pypi-package-downloads.rst +++ b/source/guides/analyzing-pypi-package-downloads.rst @@ -53,7 +53,7 @@ In order to use `Google BigQuery`_ to query the `public PyPI download statistics dataset`_, you'll need a Google account and to enable the BigQuery API on a Google Cloud Platform project. You can run the up to 1TB of queries per month `using the BigQuery free tier without a credit card -`__ +`__ - Navigate to the `BigQuery web UI`_. - Create a new project. diff --git a/source/guides/creating-and-discovering-plugins.rst b/source/guides/creating-and-discovering-plugins.rst index 783f1a9ed1..2928d22e2f 100644 --- a/source/guides/creating-and-discovering-plugins.rst +++ b/source/guides/creating-and-discovering-plugins.rst @@ -120,7 +120,7 @@ a list of packages to :func:`setup`'s ``packages`` argument instead of using Using package metadata ====================== -`Setuptools`_ provides :doc:`special support +:doc:`Setuptools ` provides :doc:`special support ` for plugins. By providing the ``entry_points`` argument to :func:`setup` in :file:`setup.py` plugins can register themselves for discovery. @@ -171,5 +171,4 @@ Now the module of your choice can be imported by executing `, most packaging tools other than setuptools provide support for defining entry points. -.. _Setuptools: https://setuptools.readthedocs.io .. _backport: https://importlib-metadata.readthedocs.io/en/latest/ diff --git a/source/guides/distributing-packages-using-setuptools.rst b/source/guides/distributing-packages-using-setuptools.rst index b1c59ecd82..1253fcb937 100644 --- a/source/guides/distributing-packages-using-setuptools.rst +++ b/source/guides/distributing-packages-using-setuptools.rst @@ -57,7 +57,7 @@ setup.py The most important file is :file:`setup.py` which exists at the root of your project directory. For an example, see the `setup.py -`_ in the `PyPA +`_ in the `PyPA sample project `_. :file:`setup.py` serves two primary functions: @@ -78,7 +78,7 @@ setup.cfg :file:`setup.cfg` is an ini file that contains option defaults for :file:`setup.py` commands. For an example, see the `setup.cfg -`_ in the `PyPA +`_ in the `PyPA sample project `_. @@ -87,13 +87,13 @@ README.rst / README.md All projects should contain a readme file that covers the goal of the project. The most common format is `reStructuredText -`_ with an "rst" extension, although +`_ with an "rst" extension, although this is not a requirement; multiple variants of `Markdown `_ are supported as well (look at ``setup()``'s :ref:`long_description_content_type ` argument). For an example, see `README.md -`_ from the `PyPA +`_ from the `PyPA sample project `_. .. note:: Projects using :ref:`setuptools` 0.6.27+ have standard readme files @@ -113,7 +113,7 @@ writing a :file:`MANIFEST.in` file, including a list of what's included by default, see ":ref:`Using MANIFEST.in`". For an example, see the `MANIFEST.in -`_ from the `PyPA +`_ from the `PyPA sample project `_. .. note:: :file:`MANIFEST.in` does not affect binary distributions such as wheels. @@ -128,7 +128,7 @@ If you're unsure which license to choose, you can use resources such as `GitHub's Choose a License `_ or consult a lawyer. For an example, see the `LICENSE.txt -`_ from the `PyPA +`_ from the `PyPA sample project `_. @@ -139,7 +139,7 @@ Python modules and packages under a single top-level package that has the same :ref:`name ` as your project, or something very close. For an example, see the `sample -`_ package that's +`_ package that's included in the `PyPA sample project `_. @@ -154,7 +154,7 @@ specific details of your project are defined. The most relevant arguments are explained below. Most of the snippets given are taken from the `setup.py -`_ contained in the +`_ contained in the `PyPA sample project `_. @@ -237,7 +237,7 @@ A `content type can be specified with the ``long_description_content_type`` argument, which can be one of ``text/plain``, ``text/x-rst``, or ``text/markdown``, corresponding to no formatting, `reStructuredText (reST) -`_, +`_, and the Github-flavored Markdown dialect of `Markdown `_ respectively. @@ -476,8 +476,8 @@ and it is interpreted relative to the installation prefix Each file name in ``files`` is interpreted relative to the :file:`setup.py` script at the top of the project source distribution. -For more information see the distutils section on `Installing Additional Files -`_. +For more information see the distutils section on :ref:`Installing Additional Files +`. .. note:: @@ -490,8 +490,8 @@ For more information see the distutils section on `Installing Additional Files ``scripts`` ~~~~~~~~~~~ -Although ``setup()`` supports a `scripts -`_ +Although ``setup()`` supports a :ref:`scripts +` keyword for pointing to pre-made scripts to install, the recommended approach to achieve cross-platform compatibility is to use :ref:`console_scripts` entry points (see below). @@ -576,7 +576,7 @@ Semantic versioning (preferred) ******************************* For new projects, the recommended versioning scheme is based on `Semantic Versioning -`_, but adopts a different approach to handling pre-releases and +`_, but adopts a different approach to handling pre-releases and build metadata. The essence of semantic versioning is a 3-part MAJOR.MINOR.MAINTENANCE numbering scheme, @@ -592,7 +592,7 @@ Adopting this approach as a project author allows users to make use of :pep:`"co a matching MAJOR version. Python projects adopting semantic versioning should abide by clauses 1-8 of the -`Semantic Versioning 2.0.0 specification `_. +`Semantic Versioning 2.0.0 specification `_. Date based versioning ********************* diff --git a/source/guides/hosting-your-own-index.rst b/source/guides/hosting-your-own-index.rst index b0867aed37..a4ff2b35ca 100644 --- a/source/guides/hosting-your-own-index.rst +++ b/source/guides/hosting-your-own-index.rst @@ -6,7 +6,7 @@ Hosting your own simple repository If you wish to host your own simple repository [1]_, you can either use a -software package like `devpi`_ or you can use simply create the proper +software package like :doc:`devpi ` or you can use simply create the proper directory structure and use any web server that can serve static files and generate an autoindex. @@ -59,5 +59,4 @@ instruct users to add the URL to their installer's configuration. :pep:`503`. -.. _devpi: http://doc.devpi.net/latest/ .. _Twisted: https://twistedmatrix.com/ diff --git a/source/guides/index-mirrors-and-caches.rst b/source/guides/index-mirrors-and-caches.rst index d960e7bee5..18dc3463e5 100644 --- a/source/guides/index-mirrors-and-caches.rst +++ b/source/guides/index-mirrors-and-caches.rst @@ -48,7 +48,7 @@ devpi is a caching proxy server which you run on your laptop, or some other machine you know will always be available to you. See the `devpi documentation for getting started`__. -__ http://doc.devpi.net/latest/quickstart-pypimirror.html +__ https://devpi.net/docs/devpi/devpi/latest/+d/quickstart-pypimirror.html Complete mirror with bandersnatch diff --git a/source/guides/installing-scientific-packages.rst b/source/guides/installing-scientific-packages.rst index 0a81484df8..cd67eecc2f 100644 --- a/source/guides/installing-scientific-packages.rst +++ b/source/guides/installing-scientific-packages.rst @@ -13,9 +13,9 @@ it will often have multiple build options to take advantage of different kinds of hardware, or to interoperate with different pieces of external software. -In particular, `NumPy `__, which provides the basis -for most of the software in the `scientific Python stack -`__ can be configured +In particular, `NumPy `__, which provides the basis +for most of the software in the :doc:`scientific Python stack +` can be configured to interoperate with different FORTRAN libraries, and can take advantage of different levels of vectorised instructions available in modern CPUs. @@ -67,7 +67,7 @@ the CPython Windows installers published on python.org. For projects which don't provide their own Windows installers (and even some which do), Christoph Gohlke at the University of California provides a `collection of Windows installers -`__. Many Python users on +`__. Many Python users on Windows have reported a positive experience with these prebuilt versions. As with Linux system packages, the Windows installers will only install into a @@ -98,8 +98,8 @@ install the :ref:`scientific Python stack SciPy distributions ------------------- -The SciPy site lists `several distributions -`__ that provide the full SciPy stack to +The SciPy site lists :doc:`several distributions +` that provide the full SciPy stack to end users in an easy to use and update format. Some of these distributions may not be compatible with the standard ``pip`` @@ -107,7 +107,7 @@ and ``virtualenv`` based toolchain. Spack ------ -`Spack `_ is a flexible package manager +`Spack `_ is a flexible package manager designed to support multiple versions, configurations, platforms, and compilers. It was built to support the needs of large supercomputing centers and scientific application teams, who must often build software many different ways. @@ -127,7 +127,7 @@ be loaded and unloaded from the user's environment. The conda cross-platform package manager ---------------------------------------- -`Anaconda `_ is a Python distribution +`Anaconda `_ is a Python distribution published by Anaconda, Inc. It is a stable collection of Open Source packages for big data and scientific use. As of the 5.0 release of Anaconda, about 200 packages are installed by default, and a total of 400-500 can be diff --git a/source/guides/installing-using-linux-tools.rst b/source/guides/installing-using-linux-tools.rst index 75add0d375..c91ce79244 100644 --- a/source/guides/installing-using-linux-tools.rst +++ b/source/guides/installing-using-linux-tools.rst @@ -54,7 +54,7 @@ To install pip and wheel for the system Python, there are two options: 1. Enable the `EPEL repository `_ using `these instructions - `__. + `__. On EPEL 7, you can install pip and wheel like so: .. code-block:: bash @@ -66,8 +66,8 @@ To install pip and wheel for the system Python, there are two options: 2. Enable the `PyPA Copr Repo - `_ using `these instructions - `__ [1]_. You can install + `_ using `these instructions + `__ [1]_. You can install pip and wheel like so: .. code-block:: bash @@ -89,7 +89,7 @@ To install pip, wheel, and setuptools, in a parallel, non-system environment includes pip, setuptools, and wheel. * For Redhat, see here: - http://developers.redhat.com/products/softwarecollections/overview/ + https://developers.redhat.com/products/softwarecollections/overview * For CentOS, see here: https://www.softwarecollections.org/en/ Be aware that collections may not contain the most recent versions. diff --git a/source/guides/making-a-pypi-friendly-readme.rst b/source/guides/making-a-pypi-friendly-readme.rst index 0cba44c2ca..326c6b93cb 100644 --- a/source/guides/making-a-pypi-friendly-readme.rst +++ b/source/guides/making-a-pypi-friendly-readme.rst @@ -14,9 +14,9 @@ For your README to display properly on PyPI, choose a markup language supported Formats supported by `PyPI's README renderer `_ are: * plain text -* `reStructuredText `_ (without Sphinx extensions) +* `reStructuredText `_ (without Sphinx extensions) * Markdown (`GitHub Flavored Markdown `_ by default, - or `CommonMark `_) + or `CommonMark `_) It's customary to save your README file in the root of your project, in the same directory as your :file:`setup.py` file. @@ -97,7 +97,7 @@ If your README is written in reStructuredText, any invalid markup will prevent it from rendering, causing PyPI to instead just show the README's raw source. Note that Sphinx extensions used in docstrings, such as -`directives and roles `_ +:doc:`directives and roles ` (e.g., "``:py:func:`getattr```" or "``:ref:`my-reference-label```"), are not allowed here and will result in error messages like "``Error: Unknown interpreted text role "py:func".``". diff --git a/source/guides/packaging-binary-extensions.rst b/source/guides/packaging-binary-extensions.rst index 001787b974..6f9088333e 100644 --- a/source/guides/packaging-binary-extensions.rst +++ b/source/guides/packaging-binary-extensions.rst @@ -32,18 +32,18 @@ conventional categories: available on a given system. The CPython standard library makes extensive use of accelerator modules. *Example*: When importing ``datetime``, Python falls back to the - `datetime.py `_ + `datetime.py `_ module if the C implementation ( - `_datetimemodule.c `_) + `_datetimemodule.c `_) is not available. * **wrapper modules**: these modules are created to expose existing C interfaces to Python code. They may either expose the underlying C interface directly, or else expose a more "Pythonic" API that makes use of Python language features to make the API easier to use. The CPython standard library makes extensive use of wrapper modules. - *Example*: `functools.py `_ + *Example*: `functools.py `_ is a Python module wrapper for - `_functoolsmodule.c `_. + `_functoolsmodule.c `_. * **low-level system access**: these modules are created to access lower level features of the CPython runtime, the operating system, or the underlying hardware. Through platform specific code, extension modules may achieve @@ -51,7 +51,7 @@ conventional categories: standard library modules are written in C in order to access interpreter internals that aren't exposed at the language level. *Example*: ``sys``, which comes from - `sysmodule.c `_. + `sysmodule.c `_. One particularly notable feature of C extensions is that, when they don't need to call back into the interpreter runtime, they can release CPython's @@ -120,7 +120,7 @@ also be considered: need to create your own accelerator module. * for long running applications, the JIT compiled `PyPy interpreter - `__ may offer a suitable alternative to the standard + `__ may offer a suitable alternative to the standard CPython runtime. The main barrier to adopting PyPy is typically reliance on other binary extension modules - while PyPy does emulate the CPython C API, modules that rely on that cause problems for the PyPy JIT, and the @@ -129,7 +129,7 @@ also be considered: an object having one live reference instead of two often won't break anything, but no references instead of one is a major problem). -* `Cython `__ is a mature static compiler that can +* `Cython `__ is a mature static compiler that can compile most Python code to C extension modules. The initial compilation provides some speed increases (by bypassing the CPython interpreter layer), and Cython's optional static typing features can offer additional @@ -160,19 +160,19 @@ but they *can* significantly reduce the maintenance burden of keeping wrapper modules up to date. * In addition to being useful for the creation of accelerator modules, - `Cython `__ is also useful for creating wrapper + `Cython `__ is also useful for creating wrapper modules for C or C++. It still involves wrapping the interfaces by hand, however, and is very repetitive, so may not be a good choice for wrapping large APIs. -* `pybind11 `__ is a pure C++11 library +* :doc:`pybind11 ` is a pure C++11 library that provides a clean C++ interface to the CPython (and PyPy) C API. It does not require a pre-processing step; it is written entirely in templated C++. Helpers are included for Setuptools or CMake builds. It was based on `Boost.Python `__, but doesn't require the Boost libraries or BJam. -* `cffi `__ is a project created by some of the PyPy +* :doc:`cffi ` is a project created by some of the PyPy developers to make it straightforward for developers that already know both Python and C to expose their C modules to Python applications. It also makes it relatively straightforward to wrap a C module based on its @@ -259,7 +259,7 @@ Before it is possible to build a binary extension, it is necessary to ensure that you have a suitable compiler available. On Windows, Visual C is used to build the official CPython interpreter, and should be used to build compatible binary extensions. To set up a build environment for binary extensions, install -`Visual Studio Community Edition `__ +`Visual Studio Community Edition `__ - any recent version is fine. One caveat: if you use Visual Studio 2019 or later, your extension will depend @@ -304,7 +304,7 @@ Publishing binary extensions ============================ For interim guidance on this topic, see the discussion in -`this issue `_. +:issue:`this issue <284>`. :: diff --git a/source/guides/packaging-namespace-packages.rst b/source/guides/packaging-namespace-packages.rst index b0a30c3357..64bce312c9 100644 --- a/source/guides/packaging-namespace-packages.rst +++ b/source/guides/packaging-namespace-packages.rst @@ -169,7 +169,7 @@ in the `pkgutil namespace example project`_. pkg_resources-style namespace packages -------------------------------------- -`Setuptools`_ provides the `pkg_resources.declare_namespace`_ function and +:doc:`Setuptools ` provides the `pkg_resources.declare_namespace`_ function and the ``namespace_packages`` argument to :func:`~setuptools.setup`. Together these can be used to declare namespace packages. While this approach is no longer recommended, it is widely present in most existing namespace packages. @@ -236,7 +236,6 @@ to :func:`~setuptools.setup` in :file:`setup.py`. For example: A complete working example of two pkg_resources-style namespace packages can be found in the `pkg_resources namespace example project`_. -.. _setuptools: https://setuptools.readthedocs.io .. _pkg_resources.declare_namespace: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#namespace-package-support .. _pkg_resources namespace example project: diff --git a/source/guides/single-sourcing-package-version.rst b/source/guides/single-sourcing-package-version.rst index adbddb45a9..1f6caa70e1 100644 --- a/source/guides/single-sourcing-package-version.rst +++ b/source/guides/single-sourcing-package-version.rst @@ -9,7 +9,7 @@ There are many techniques to maintain a single source of truth for the version number of your project: #. Read the file in :file:`setup.py` and get the version. Example (from `pip setup.py - `_):: + `_):: import codecs import os.path @@ -135,7 +135,7 @@ number of your project: then ``setuptools`` must be added to the project's ``install_requires`` list. - Example using this technique: `setuptools `_. + Example using this technique: `setuptools `_. #. Set the value to ``__version__`` in ``sample/__init__.py`` and import @@ -160,4 +160,4 @@ number of your project: #. Keep the version number in the tags of a version control system (Git, Mercurial, etc) instead of in the code, and automatically extract it from there using - `setuptools_scm `_. + `setuptools_scm `_. diff --git a/source/guides/supporting-multiple-python-versions.rst b/source/guides/supporting-multiple-python-versions.rst index 324b4b9323..42d8efab1d 100644 --- a/source/guides/supporting-multiple-python-versions.rst +++ b/source/guides/supporting-multiple-python-versions.rst @@ -58,7 +58,7 @@ These services also offer facilities to run your project's test suite on will work, without the developer having to perform such tests themselves. Wikipedia has an extensive `comparison -`_ +`_ of many continuous-integration systems. There are two hosted services which when used in conjunction provide automated testing across Linux, Mac and Windows: @@ -66,7 +66,7 @@ Windows: - `Travis CI `_ provides both a Linux and a macOS environment. The Linux environment is Ubuntu 12.04 LTS Server Edition 64 bit while the macOS is 10.9.2 at the time of writing. - - `Appveyor `_ provides a Windows environment + - `Appveyor `_ provides a Windows environment (Windows Server 2012). :: @@ -78,7 +78,7 @@ Windows: document? Both `Travis CI`_ and Appveyor_ require a `YAML -`_-formatted file as specification for the instructions +`_-formatted file as specification for the instructions for testing. If any tests fail, the output log for that specific configuration can be inspected. diff --git a/source/guides/supporting-windows-using-appveyor.rst b/source/guides/supporting-windows-using-appveyor.rst index 09e3e8f65e..3a2d944a79 100644 --- a/source/guides/supporting-windows-using-appveyor.rst +++ b/source/guides/supporting-windows-using-appveyor.rst @@ -39,7 +39,7 @@ Setting up In order to use Appveyor to build Windows wheels for your project, you must have an account on the service. Instructions on setting up an account are given -in `the Appveyor documentation `__. The free tier +in `the Appveyor documentation `__. The free tier of account is perfectly adequate for open source projects. Appveyor provides integration with `Github`_ and `Bitbucket`_, so as long as @@ -237,8 +237,7 @@ For reference, the SDK setup support script is listed here: :language: bat :linenos: -.. _Appveyor: http://www.appveyor.com/ +.. _Appveyor: https://www.appveyor.com/ .. _Travis: https://travis-ci.org/ .. _Github: https://github.com .. _Bitbucket: https://bitbucket.org/ -.. _Tox: http://tox.testrun.org diff --git a/source/index.rst b/source/index.rst index 2ec3e2e551..20e74d9180 100644 --- a/source/index.rst +++ b/source/index.rst @@ -25,11 +25,10 @@ Welcome to the *Python Packaging User Guide*, a collection of tutorials and references to help you distribute and install Python packages with modern tools. -This guide is maintained on `GitHub`_ by the `Python Packaging Authority`_. We +This guide is maintained on `GitHub`_ by the :doc:`Python Packaging Authority `. We happily accept any :doc:`contributions and feedback `. 😊 -.. _GitHub: https://github.com/pypa/python-packaging-user-guide -.. _Python Packaging Authority: https://pypa.io +.. _GitHub: https://github.com/pypa/packaging.python.org Get started diff --git a/source/key_projects.rst b/source/key_projects.rst index 13f0b953cd..5ff9f01753 100644 --- a/source/key_projects.rst +++ b/source/key_projects.rst @@ -34,7 +34,7 @@ Content Delivery Network (CDN). build ===== -`Docs `__ | +`Docs ` | `Issues `__ | `GitHub `__ | `PyPI `__ @@ -63,7 +63,7 @@ platforms and Python versions on most CI systems. Also see :ref:`multibuild`. distlib ======= -`Docs `__ | +:doc:`Docs ` | `Issues `__ | `Bitbucket `__ | `PyPI `__ @@ -89,7 +89,7 @@ of packages that are incompatible with those standards. packaging ========= -`Docs `__ | +:doc:`Docs ` | `Issues `__ | `GitHub `__ | `PyPI `__ @@ -118,7 +118,7 @@ on error. pip === -`Docs `__ | +`Docs `__ | `Issues `__ | `GitHub `__ | `PyPI `__ @@ -136,7 +136,7 @@ command-line interface (CLI). Pipenv ====== -`Docs `__ | +:doc:`Docs ` | `Source `__ | `Issues `__ | `PyPI `__ @@ -180,9 +180,9 @@ causing dependency conflicts with other packages installed on the system. Python Packaging User Guide =========================== -`Docs `__ | -`Issues `__ | -`GitHub `__ +:doc:`Docs ` | +`Issues `__ | +`GitHub `__ This guide! @@ -192,7 +192,7 @@ readme_renderer =============== `GitHub and docs `__ | -`PyPI `__ +`PyPI `__ ``readme_renderer`` is a library that package developers use to render their user documentation (README) files into HTML from markup @@ -269,7 +269,7 @@ it's fast and secure, it's maintained, and it reliably works. virtualenv ========== -`Docs `__ | +:doc:`Docs ` | `Issues `__ | `GitHub `__ | `PyPI `__ @@ -342,12 +342,12 @@ lets you create a buildout configuration and reproduce the same software later. conda ===== -`Docs `__ +:doc:`Docs ` conda is the package management tool for `Anaconda `__ Python installations. Anaconda Python is a distribution from `Anaconda, Inc -`__ specifically aimed at the scientific +`__ specifically aimed at the scientific community, and in particular on Windows where the installation of binary extensions is often difficult. @@ -420,7 +420,7 @@ build system. Enscons helps you to build sdists that can be automatically built by :ref:`pip`, and wheels that are independent of enscons. -.. _SCons: http://scons.org/ +.. _SCons: https://scons.org/ .. _hashdist: @@ -502,7 +502,7 @@ piwheels ======== `Website `__ | -`Docs `__ | +:doc:`Docs ` | `GitHub `__ piwheels is a website, and software underpinning it, that fetches @@ -580,9 +580,9 @@ applications and command line tools fast & easy. Spack ===== -`Docs `__ | -`GitHub `__ | -`Paper `__ | +:doc:`Docs ` | +`GitHub `__ | +`Paper `__ | `Slides `__ A flexible package manager designed to support multiple versions, @@ -620,7 +620,7 @@ ensurepip ========= `Docs `__ | -`Issues `__ +`Issues `__ A package in the Python Standard Library that provides support for bootstrapping :ref:`pip` into an existing Python installation or virtual environment. In most @@ -634,7 +634,7 @@ distutils ========= `Docs `__ | -`Issues `__ +`Issues `__ The original Python packaging system, added to the standard library in Python 2.0. @@ -655,7 +655,7 @@ venv ==== `Docs `__ | -`Issues `__ +`Issues `__ A package in the Python Standard Library (starting with Python 3.3) for creating :term:`Virtual Environments `. For more diff --git a/source/overview.rst b/source/overview.rst index 63d194831a..d8878534c2 100644 --- a/source/overview.rst +++ b/source/overview.rst @@ -67,8 +67,8 @@ This is great for sharing simple scripts and snippets between people who both have compatible Python versions (such as via email, StackOverflow, or GitHub gists). There are even some entire Python libraries that offer this as an option, such as `bottle.py -`_ and `boltons -`_. +`_ and :doc:`boltons +`. However, this pattern won't scale for projects that consist of multiple files, need additional libraries, or need a specific version @@ -231,7 +231,7 @@ guides: * `Kivy `_ * `Beeware `_ * `Brython `_ -* `Flexx `_ +* `Flexx `_ If you are *not* interested in using a framework or platform, or just wonder about some of the technologies and techniques utilized by the @@ -279,12 +279,12 @@ developers is a package ecosystem called `Anaconda is built around Python and is increasingly common in academic, analytical, and other data-oriented environments, even making its way `into server-oriented environments -`_. +`_. Instructions on building and publishing for the Anaconda ecosystem: -* `Building libraries and applications with conda `_ -* `Transitioning a native Python package to Anaconda `_ +* `Building libraries and applications with conda `_ +* `Transitioning a native Python package to Anaconda `_ A similar model involves installing an alternative Python distribution, but does not support arbitrary operating system-level @@ -411,13 +411,12 @@ of the puzzle. virtualenv ^^^^^^^^^^ -`Virtualenvs -`_ have +:doc:`Virtualenvs ` have been an indispensable tool for multiple generations of Python developer, but are slowly fading from view, as they are being wrapped by higher-level tools. With packaging in particular, virtualenvs are -used as a primitive in `the dh-virtualenv tool -`_ and +used as a primitive in :doc:`the dh-virtualenv tool +` and `osnap `_, both of which wrap virtualenvs in a self-contained way. diff --git a/source/specifications/binary-distribution-format.rst b/source/specifications/binary-distribution-format.rst index 92079ce393..1bcd550100 100644 --- a/source/specifications/binary-distribution-format.rst +++ b/source/specifications/binary-distribution-format.rst @@ -311,10 +311,10 @@ checker only needs to establish that RECORD matches the signature. See -- http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html -- http://self-issued.info/docs/draft-jones-jose-jws-json-serialization.html -- http://self-issued.info/docs/draft-ietf-jose-json-web-key.html -- http://self-issued.info/docs/draft-jones-jose-json-private-key.html +- https://self-issued.info/docs/draft-ietf-jose-json-web-signature.html +- https://self-issued.info/docs/draft-jones-jose-jws-json-serialization.html +- https://self-issued.info/docs/draft-ietf-jose-json-web-key.html +- https://self-issued.info/docs/draft-jones-jose-json-private-key.html Comparison to .egg diff --git a/source/specifications/core-metadata.rst b/source/specifications/core-metadata.rst index 484960f22b..5a4d9b3548 100644 --- a/source/specifications/core-metadata.rst +++ b/source/specifications/core-metadata.rst @@ -237,11 +237,10 @@ A string stating the markup syntax (if any) used in the distribution's description, so that tools can intelligently render the description. Historically, PyPI supported descriptions in plain text and `reStructuredText -(reST) `_, +(reST) `_, and could render reST into HTML. However, it is common for distribution authors to write the description in `Markdown -`_ (`RFC 7763 -`_) as many code hosting sites render +`_ (:rfc:`7763`) as many code hosting sites render Markdown READMEs, and authors would reuse the file for the description. PyPI didn't recognize the format and so could not render the description correctly. This resulted in many packages on PyPI with poorly-rendered descriptions when @@ -275,10 +274,8 @@ Other parameters might be specific to the chosen subtype. For example, for the specifying the variant of Markdown in use (defaults to ``GFM`` if not specified). Currently, two variants are recognized: -- ``GFM`` for `Github-flavored Markdown - `_ -- ``CommonMark`` for `CommonMark - `_ +- ``GFM`` for :rfc:`Github-flavored Markdown <7764#section-3.2>` +- ``CommonMark`` for :rfc:`CommonMark <7764#section-3.5>` Example:: @@ -728,9 +725,9 @@ Examples:: ---- .. [1] reStructuredText markup: - http://docutils.sourceforge.net/ + https://docutils.sourceforge.io/ -.. _`Python Package Index`: http://pypi.org/ +.. _`Python Package Index`: https://pypi.org/ .. [2] RFC 822 Long Header Fields: - http://www.freesoft.org/CIE/RFC/822/7.htm + :rfc:`822#section-3.1.1` diff --git a/source/specifications/declaring-project-metadata.rst b/source/specifications/declaring-project-metadata.rst index 2a54f1640f..ccd058ad10 100644 --- a/source/specifications/declaring-project-metadata.rst +++ b/source/specifications/declaring-project-metadata.rst @@ -157,7 +157,7 @@ meaning is open to interpretation. These fields accept an array of tables with 2 keys: ``name`` and ``email``. Both values must be strings. The ``name`` value MUST be a valid email name (i.e. whatever can be put as a name, before an email, -in `RFC 822`_) and not contain commas. The ``email`` value MUST be a +in :rfc:`822`) and not contain commas. The ``email`` value MUST be a valid email address. Both keys are optional. Using the data to fill in :ref:`core metadata ` is as @@ -303,5 +303,4 @@ provided via tooling later on. value, is acceptable). -.. _RFC 822: https://tools.ietf.org/html/rfc822 -.. _TOML: https://toml.io/ +.. _TOML: https://toml.io diff --git a/source/specifications/direct-url.rst b/source/specifications/direct-url.rst index 6a75181a4a..9b8180c47a 100644 --- a/source/specifications/direct-url.rst +++ b/source/specifications/direct-url.rst @@ -23,8 +23,7 @@ specifying a direct URL reference (including a VCS URL). This file MUST NOT be created when installing a distribution from an other type of requirement (i.e. name plus version specifier). -This JSON file MUST be a dictionary, compliant with `RFC 8259 -`_ and UTF-8 encoded. +This JSON file MUST be a dictionary, compliant with :rfc:`8259` and UTF-8 encoded. If present, it MUST contain at least two fields. The first one is ``url``, with type ``string``. Depending on what ``url`` refers to, the second field MUST be @@ -82,7 +81,7 @@ present as a dictionary with the following key: in editable mode, ``false`` otherwise. If absent, default to ``false``. When ``url`` refers to a local directory, it MUST have the ``file`` sheme and -be compliant with `RFC 8089 `_. In +be compliant with :rfc:`8089`. In particular, the path component must be absolute. Symbolic links SHOULD be preserved when making relative paths absolute. @@ -178,7 +177,7 @@ Bazaar Home page - https://bazaar.canonical.com/ + https://bazaar.canonical.com vcs command diff --git a/source/tutorials/creating-documentation.rst b/source/tutorials/creating-documentation.rst index 392220f313..de47c70139 100644 --- a/source/tutorials/creating-documentation.rst +++ b/source/tutorials/creating-documentation.rst @@ -4,9 +4,10 @@ Creating Documentation ====================== -This section covers the basics of how to create documentation using `Sphinx`_ and host the documentation for free in `Read The Docs`_. +This section covers the basics of how to create documentation using `Sphinx`_ and +host the documentation for free in `Read The Docs`_. -.. _Sphinx: http://sphinx-doc.org/ +.. _Sphinx: https://www.sphinx-doc.org .. _Read The Docs: https://readthedocs.org/ Installing Sphinx @@ -25,9 +26,8 @@ Use ``pip`` to install Sphinx: py -m pip install -U sphinx -For other installation methods, see this `installation guide`_ by Sphinx. +For other installation methods, see this :doc:`installation guide ` by Sphinx. -.. _installation guide: http://www.sphinx-doc.org/en/master/usage/installation.html Getting Started With Sphinx --------------------------- diff --git a/source/tutorials/installing-packages.rst b/source/tutorials/installing-packages.rst index d9a873f85a..c68ea6c187 100644 --- a/source/tutorials/installing-packages.rst +++ b/source/tutorials/installing-packages.rst @@ -52,7 +52,7 @@ version is available from your command line. You can check this by running: You should get some output like ``Python 3.6.3``. If you do not have Python, please install the latest 3.x version from `python.org`_ or refer to the -`Installing Python`_ section of the Hitchhiker's Guide to Python. +:ref:`Installing Python ` section of the Hitchhiker's Guide to Python. .. Note:: If you're a newcomer and you get an error like this: @@ -93,7 +93,7 @@ please install the latest 3.x version from `python.org`_ or refer to the set one up, and then continue with the tutorial as written. .. _getting started tutorial: https://opentechschool.github.io/python-beginners/en/getting_started.html#what-is-python-exactly -.. _python.org: https://python.org +.. _python.org: https://www.python.org Ensure you can run pip from the command line -------------------------------------------- @@ -119,7 +119,6 @@ using your OS package manager, you may have to install pip separately, see :doc:`/guides/installing-using-linux-tools`. .. _Homebrew: https://brew.sh -.. _Installing Python: http://docs.python-guide.org/en/latest/starting/installation/ If ``pip`` isn't already installed, then first try to bootstrap it from the standard library: @@ -271,7 +270,7 @@ Using :ref:`virtualenv`: \Scripts\activate For more information, see the :doc:`venv ` docs or -the `virtualenv `_ docs. +the :doc:`virtualenv ` docs. The use of :command:`source` under Unix shells ensures that the virtual environment's variables are set within the current @@ -432,7 +431,7 @@ current user, use the ``--user`` flag: py -m pip install --user SomeProject For more information see the `User Installs -`_ section +`_ section from the pip docs. Note that the ``--user`` flag has no effect when inside a virtual environment @@ -463,7 +462,7 @@ directory to your :envvar:`PATH`: .. _user base: https://docs.python.org/3/library/site.html#site.USER_BASE .. _modifying ~/.profile: https://stackoverflow.com/a/14638025 -.. _Control Panel: https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx +.. _Control Panel: https://docs.microsoft.com/en-us/windows/win32/shell/user-environment-variables?redirectedfrom=MSDN Requirements files ================== diff --git a/source/tutorials/managing-dependencies.rst b/source/tutorials/managing-dependencies.rst index 6eb94b1b6d..ac85354105 100644 --- a/source/tutorials/managing-dependencies.rst +++ b/source/tutorials/managing-dependencies.rst @@ -58,7 +58,7 @@ Use ``pip`` to install Pipenv: See :ref:`Installing to the User Site` for more information. .. _npm: https://www.npmjs.com/ -.. _bundler: http://bundler.io/ +.. _bundler: https://bundler.io/ .. _user installation: https://pip.pypa.io/en/stable/user_guide/#user-installs Installing packages for your project