diff --git a/requirements.txt b/requirements.txt index 2af52ed4e..c415c5a61 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ sphinx==9.2.0 sphinx-autobuild==2025.8.25 sphinx-inline-tabs==2025.12.21.14 sphinx-copybutton==0.5.2 +sphinx-issues==6.0.0 sphinx-toolbox==4.3.1 sphinx-jsonschema==1.20.1 sphinx-notfound-page==1.1.0 diff --git a/source/conf.py b/source/conf.py index e2ed462c8..24f7a5b7b 100644 --- a/source/conf.py +++ b/source/conf.py @@ -31,6 +31,7 @@ extensions = [ "pug_sphinx_extensions", + "sphinx_issues", "sphinx.ext.extlinks", "sphinx.ext.intersphinx", "sphinx.ext.todo", @@ -201,18 +202,15 @@ github_repo_org = "pypa" github_repo_name = "packaging.python.org" github_repo_slug = f"{github_repo_org}/{github_repo_name}" -github_repo_url = f"{github_url}/{github_repo_slug}" -github_repo_issues_url = f"{github_url}/{github_repo_slug}/issues" -github_sponsors_url = f"{github_url}/sponsors" extlinks = { - "issue": (f"{github_repo_issues_url}/%s", "#%s"), - "pr": (f"{github_repo_url}/pull/%s", "PR #%s"), - "commit": (f"{github_repo_url}/commit/%s", "%s"), "gh": (f"{github_url}/%s", "GitHub: %s"), - "user": (f"{github_sponsors_url}/%s", "@%s"), } +# -- Options for sphinx_issues -------------------------------------------------------- + +issues_default_group_project = github_repo_slug + # -- Options for intersphinx ---------------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration diff --git a/source/discussions/deploying-python-applications.rst b/source/discussions/deploying-python-applications.rst index 59856c4a4..8e3e5d66e 100644 --- a/source/discussions/deploying-python-applications.rst +++ b/source/discussions/deploying-python-applications.rst @@ -57,7 +57,7 @@ Windows Pynsist ^^^^^^^ -`Pynsist `__ is a tool that bundles Python +:pypi:`Pynsist ` is a tool that bundles Python programs together with the Python-interpreter into a single installer based on NSIS. In most cases, packaging only requires the user to choose a version of the Python-interpreter and declare the dependencies of the program. The tool @@ -88,7 +88,7 @@ Windows py2exe ^^^^^^ -`py2exe `__ is a distutils extension which +:pypi:`py2exe` is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scripts. Python versions included in the official development cycle are supported (refers to `Status of Python branches`__). py2exe can @@ -105,7 +105,7 @@ macOS py2app ^^^^^^ -`py2app `__ is a Python setuptools +:pypi:`py2app` is a Python setuptools command which will allow you to make standalone macOS application bundles and plugins from Python scripts. Note that py2app MUST be used on macOS to build applications, it cannot create Mac applications on other @@ -117,7 +117,7 @@ Unix (including Linux and macOS) pex ^^^ -`pex `__ is a library for generating .pex +:pypi:`pex` is a library for generating .pex (Python EXecutable) files which are executable Python environments in the spirit of virtualenvs. pex is an expansion upon the ideas outlined in :pep:`441` and makes the deployment of Python applications as simple as cp. pex files may diff --git a/source/discussions/distribution-package-vs-import-package.rst b/source/discussions/distribution-package-vs-import-package.rst index 65e7019c6..7a5e1e7a9 100644 --- a/source/discussions/distribution-package-vs-import-package.rst +++ b/source/discussions/distribution-package-vs-import-package.rst @@ -57,7 +57,7 @@ install the PyPI package ``foo`` if you see ``import foo``; this may install an unintended, and potentially even malicious package.) A distribution package could provide an import package with a different -name. An example of this is the popular Pillow_ library for image +name. An example of this is the popular :pypi:`Pillow` library for image processing. Its distribution package name is ``Pillow``, but it provides the import package ``PIL``. This is for historical reasons: Pillow started as a fork of the PIL library, thus it kept the import name @@ -72,7 +72,7 @@ Import packages with the same name can be provided by several distribution packages. Again, forks are a common reason for this. Conversely, a distribution package can provide several import packages, -although this is less common. An example is the attrs_ distribution +although this is less common. An example is the :pypi:`attrs` distribution package, which provides both an ``attrs`` import package with a newer API, and an ``attr`` import package with an older but supported API. @@ -106,5 +106,3 @@ precise rules are given in the :ref:`name normalization specification .. _distro: https://en.wikipedia.org/wiki/Linux_distribution .. _PyPI: https://pypi.org -.. _Pillow: https://pypi.org/project/Pillow -.. _attrs: https://pypi.org/project/attrs diff --git a/source/discussions/downstream-packaging.rst b/source/discussions/downstream-packaging.rst index 05991daf3..18b02c232 100644 --- a/source/discussions/downstream-packaging.rst +++ b/source/discussions/downstream-packaging.rst @@ -126,8 +126,8 @@ in their installed packages. This has the added advantage of permitting users to run tests after installing them, for example to check for regressions after upgrading a dependency. Yet another approach is to split tests or test data into a separate Python package. Such an approach was taken by -the cryptography_ project, with the large test vectors being split -to cryptography-vectors_ package. +the :pypi:`cryptography` project, with the large test vectors being split +to :pypi:`cryptography-vectors` package. A good idea is to use your source distribution in the release workflow. For example, the :ref:`build` tool does exactly that — it first builds a source @@ -351,9 +351,9 @@ Some specific suggestions are: of the installed package! - Make the test suite work offline. Mock network interactions, using - packages such as responses_ or vcrpy_. If that is not possible, make it + packages such as :pypi:`responses` or :pypi:`vcrpy`. If that is not possible, make it possible to easily disable the tests using Internet access, e.g. via a pytest_ - marker. Use pytest-socket_ to verify that your tests work offline. This + marker. Use :pypi:`pytest-socket` to verify that your tests work offline. This often makes your own test workflows faster and more reliable as well. - Make your tests work without a specialized setup, or perform the necessary @@ -389,14 +389,14 @@ Some specific suggestions are: - If your test suite takes significant time to run, support testing in parallel. Downstreams often maintain a large number of packages, - and testing them all takes a lot of time. Using pytest-xdist_ can help them + and testing them all takes a lot of time. Using :pypi:`pytest-xdist` can help them avoid bottlenecks. - Ideally, support running your test suite via ``pytest``. pytest_ has many command-line arguments that are truly helpful to downstreams, such as the ability to conveniently deselect tests, rerun flaky tests - (via pytest-rerunfailures_), add a timeout to prevent tests from hanging - (via pytest-timeout_) or run tests in parallel (via pytest-xdist_). + (via :pypi:`pytest-rerunfailures`), add a timeout to prevent tests from hanging + (via :pypi:`pytest-timeout`) or run tests in parallel (via :pypi:`pytest-xdist`). Note that test suites don't need to be *written* with ``pytest`` to be *executed* with ``pytest``: ``pytest`` is able to find and execute almost all test cases that are compatible with the standard library's ``unittest`` @@ -468,14 +468,6 @@ as well. Some specific suggestions are: to make it easier to cherry-pick changes to earlier releases when necessary. -.. _responses: https://pypi.org/project/responses/ -.. _vcrpy: https://pypi.org/project/vcrpy/ -.. _pytest-socket: https://pypi.org/project/pytest-socket/ -.. _pytest-xdist: https://pypi.org/project/pytest-xdist/ .. _pytest: https://pytest.org/ -.. _pytest-rerunfailures: https://pypi.org/project/pytest-rerunfailures/ -.. _pytest-timeout: https://pypi.org/project/pytest-timeout/ .. _Django: https://www.djangoproject.com/ .. _NumPy: https://numpy.org/ -.. _cryptography: https://pypi.org/project/cryptography/ -.. _cryptography-vectors: https://pypi.org/project/cryptography-vectors/ diff --git a/source/flow.rst b/source/flow.rst index 947c399db..a815d34a0 100644 --- a/source/flow.rst +++ b/source/flow.rst @@ -68,12 +68,9 @@ format`_. At a minimum, the :file:`pyproject.toml` file needs a ``[build-system]`` table specifying your build tool. There are many build tools available, including but not limited to :ref:`flit`, :ref:`hatch`, :ref:`pdm`, :ref:`poetry`, -:ref:`setuptools`, `trampolim`_, and `whey`_. Each tool's documentation will +:ref:`setuptools`, :pypi:`trampolim`, and :pypi:`whey`. Each tool's documentation will show what to put in the ``[build-system]`` table. -.. _trampolim: https://pypi.org/project/trampolim/ -.. _whey: https://pypi.org/project/whey/ - For example, here is a table for using :ref:`hatch`: .. code-block:: toml diff --git a/source/guides/creating-and-discovering-plugins.rst b/source/guides/creating-and-discovering-plugins.rst index fdf93aabd..e8eed66e1 100644 --- a/source/guides/creating-and-discovering-plugins.rst +++ b/source/guides/creating-and-discovering-plugins.rst @@ -19,7 +19,7 @@ Using naming convention If all of the plugins for your application follow the same naming convention, you can use :func:`pkgutil.iter_modules` to discover all of the top-level -modules that match the naming convention. For example, `Flask`_ uses the +modules that match the naming convention. For example, :pypi:`Flask` uses the naming convention ``flask_{plugin_name}``. If you wanted to automatically discover all of the Flask plugins installed: @@ -35,7 +35,7 @@ discover all of the Flask plugins installed: if name.startswith('flask_') } -If you had both the `Flask-SQLAlchemy`_ and `Flask-Talisman`_ plugins installed +If you had both the :pypi:`Flask-SQLAlchemy` and :pypi:`Flask-Talisman ` plugins installed then ``discovered_plugins`` would be: .. code-block:: python @@ -49,11 +49,6 @@ Using naming convention for plugins also allows you to query the Python Package Index's :ref:`simple repository API ` for all packages that conform to your naming convention. -.. _Flask: https://pypi.org/project/Flask/ -.. _Flask-SQLAlchemy: https://pypi.org/project/Flask-SQLAlchemy/ -.. _Flask-Talisman: https://pypi.org/project/flask-talisman - - Using namespace packages ======================== diff --git a/source/guides/dropping-older-python-versions.rst b/source/guides/dropping-older-python-versions.rst index f50928049..5ce0416c9 100644 --- a/source/guides/dropping-older-python-versions.rst +++ b/source/guides/dropping-older-python-versions.rst @@ -129,10 +129,9 @@ Each version compatibility change should have its own release. .. tip:: - When dropping a Python version, it might also be rewarding to upgrade the project's code syntax generally, apart from updating the versions used in visible places (like the testing environment). Tools like pyupgrade_ or `ruff `_ can automate some of this work. + When dropping a Python version, it might also be rewarding to upgrade the project's code syntax generally, apart from updating the versions used in visible places (like the testing environment). Tools like :pypi:`pyupgrade` or `ruff `_ can automate some of this work. .. _discourse-discussion: https://discuss.python.org/t/requires-python-upper-limits/12663 -.. _pyupgrade: https://pypi.org/project/pyupgrade/ .. _dependency-management: https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#python-requirement .. [#] Support for the Metadata 1.2 specification has been added in Pip 9.0. diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index 22d1840cc..9d0cc6196 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -201,7 +201,7 @@ Install a package ~~~~~~~~~~~~~~~~~ For example, let's install the -`Requests`_ library from the :term:`Python Package Index (PyPI)`: +:pypi:`Requests ` library from the :term:`Python Package Index (PyPI)`: .. tab:: Unix/macOS @@ -232,9 +232,6 @@ pip should download requests and all of its dependencies and install them: Installing collected packages: chardet, urllib3, certifi, idna, requests Successfully installed certifi-2017.7.27.1 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22 -.. _Requests: https://pypi.org/project/requests/ - - Install a specific package version ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/guides/tool-recommendations.rst b/source/guides/tool-recommendations.rst index 5fee0a98b..061c6f2ff 100644 --- a/source/guides/tool-recommendations.rst +++ b/source/guides/tool-recommendations.rst @@ -72,11 +72,11 @@ in alphabetical order: - :doc:`Flit-core ` -- developed with but separate from :ref:`Flit`. A minimal and opinionated build backend. It does not support plugins. -- Hatchling_ -- developed with but separate from :ref:`Hatch`. Supports plugins. +- :pypi:`Hatchling ` -- developed with but separate from :ref:`Hatch`. Supports plugins. - PDM-backend_ -- developed with but separate from :ref:`PDM`. Supports plugins. -- Poetry-core_ -- developed with but separate from :ref:`Poetry`. Supports +- :pypi:`Poetry-core ` -- developed with but separate from :ref:`Poetry`. Supports plugins. Unlike other backends on this list, Poetry-core does not support the standard @@ -182,6 +182,4 @@ alphabetical order: - :doc:`tox `. -.. _hatchling: https://pypi.org/project/hatchling/ .. _pdm-backend: https://backend.pdm-project.org -.. _poetry-core: https://pypi.org/project/poetry-core/ diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index 652ab50a8..a983f6a35 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -292,7 +292,7 @@ an email address. --------------- This should be a one-line description of your project, to show as the "headline" -of your project page on PyPI (`example `_), and other places such as +of your project page on PyPI (:pypi:`example `), and other places such as lists of search results (`example `_). .. code-block:: toml @@ -624,7 +624,6 @@ A full example .. _gfm: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax .. _setuptools: https://setuptools.pypa.io .. _poetry: https://python-poetry.org -.. _pypi-pip: https://pypi.org/project/pip .. _pypi-search-pip: https://pypi.org/search/?q=pip .. _classifier-list: https://pypi.org/classifiers .. _requires-python-blog-post: https://iscinumpy.dev/post/bound-version-constraints/#pinning-the-python-version-is-special diff --git a/source/key_projects.rst b/source/key_projects.rst index 08b80b9f7..f6e282f77 100644 --- a/source/key_projects.rst +++ b/source/key_projects.rst @@ -21,7 +21,7 @@ bandersnatch `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` ``bandersnatch`` is a PyPI mirroring client designed to efficiently create a complete mirror of the contents of PyPI. Organizations thus @@ -39,7 +39,7 @@ build :any:`Docs ` | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` ``build`` is a :pep:`517` compatible Python package builder. It provides a CLI to build packages, as well as a Python API. @@ -53,7 +53,7 @@ cibuildwheel `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ | +:pypi:`PyPI ` | `Discussions `__ | `Discord #cibuildwheel `__ @@ -68,7 +68,7 @@ distlib :doc:`Docs ` | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` ``distlib`` is a library which implements low-level functions that relate to packaging and distribution of Python software. ``distlib`` @@ -117,7 +117,7 @@ flit `Docs `__ | `Issues `__ | -`PyPI `__ +:pypi:`PyPI ` Flit provides a simple way to create and upload pure Python packages and modules to PyPI. It focuses on `making the easy things easy `_ @@ -143,7 +143,7 @@ hatch `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Hatch is a unified command-line tool meant to conveniently manage dependencies and environment isolation for Python developers. Python @@ -159,7 +159,7 @@ packaging :doc:`Docs ` | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Core utilities for Python packaging used by :ref:`pip` and :ref:`setuptools`. @@ -188,7 +188,7 @@ pip `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` The most popular tool for installing Python packages, and the one included with modern versions of Python. @@ -206,7 +206,7 @@ Pipenv :doc:`Docs ` | `Source `__ | `Issues `__ | -`PyPI `__ +:pypi:`PyPI ` Pipenv is a project that aims to bring the best of all packaging worlds to the Python world. It harnesses `Pipfile`_, :ref:`pip`, and :ref:`virtualenv` @@ -228,7 +228,7 @@ pipx `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` pipx is a tool to install and run Python command-line applications without causing dependency conflicts with other packages installed on the system. @@ -249,7 +249,7 @@ readme_renderer =============== `GitHub and docs `__ | -`PyPI `__ +:pypi:`PyPI ` ``readme_renderer`` is a library that package developers use to render their user documentation (README) files into HTML from markup @@ -266,7 +266,7 @@ Setuptools `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Setuptools is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python @@ -279,8 +279,7 @@ trove-classifiers ================= `Issues `__ | `GitHub -`__ | `PyPI -`__ +`__ | :pypi:`PyPI ` trove-classifiers is the canonical source for `classifiers on PyPI `_, which project maintainers use to @@ -306,7 +305,7 @@ twine `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Twine is the primary tool developers use to upload packages to the Python Package Index or other Python package indexes. It is a @@ -323,7 +322,7 @@ virtualenv `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` virtualenv is a tool for creating isolated Python :term:`Virtual Environments `, like :ref:`venv`. Unlike :ref:`venv`, virtualenv can @@ -356,7 +355,7 @@ wheel `Docs `__ | `Issues `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Primarily, the wheel project offers the ``bdist_wheel`` :ref:`setuptools` extension for creating :term:`wheel distributions `. Additionally, it offers its own @@ -380,7 +379,7 @@ buildout `Docs `__ | `Issues `__ | -`PyPI `__ | +:pypi:`PyPI ` | `GitHub `__ Buildout is a Python-based build system for creating, assembling and deploying @@ -426,7 +425,7 @@ devpi `Docs `__ | :gh:`Issues ` | -`PyPI `__ +:pypi:`PyPI ` devpi features a powerful PyPI-compatible server and PyPI proxy cache with a complementary command line tool to drive packaging, testing and @@ -442,7 +441,7 @@ dumb-pypi ========= `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` dumb-pypi is a simple :term:`package index ` static file site generator, which then must be hosted by a static file webserver to become the @@ -455,7 +454,7 @@ enscons :gh:`Source ` | :gh:`Issues ` | -`PyPI `__ +:pypi:`PyPI ` Enscons is a Python packaging tool based on `SCons`_. It builds :ref:`pip`-compatible source distributions and wheels without using @@ -514,7 +513,7 @@ pdm `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` PDM is a modern Python package manager. It uses :term:`pyproject.toml` to store project metadata as defined in :pep:`621`. @@ -526,7 +525,7 @@ pex `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Pex is a tool for generating :file:`.pex` (Python EXecutable) files, standalone Python environments in the spirit of :ref:`virtualenv`. @@ -544,7 +543,7 @@ pip-tools `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` pip-tools is a suite of tools meant for Python system administrators and release managers who particularly want to keep their builds @@ -577,7 +576,7 @@ poetry `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` poetry is a command-line tool to handle dependency installation and isolation as well as building and packaging of Python packages. It @@ -592,7 +591,7 @@ proxpi ====== :gh:`GitHub ` | -`PyPI `__ +:pypi:`PyPI ` proxpi is a simple :term:`package index ` which proxies PyPI and other indexes with caching. @@ -604,7 +603,7 @@ Pulp-python `Docs `__ | :gh:`GitHub ` | -`PyPI `__ +:pypi:`PyPI ` Pulp-python is the Python :term:`package index ` plugin for `Pulp `_. Pulp-python supports mirrors backed by @@ -617,7 +616,7 @@ pypiserver ========== `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` pypiserver is a minimalist application that serves as a private Python :term:`package index ` (from a local directory) within @@ -634,7 +633,7 @@ PyScaffold `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` PyScaffold is a project generator for bootstrapping Python packages, ready to be shared on PyPI and installable via :ref:`pip`. @@ -651,15 +650,15 @@ scikit-build `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Scikit-build is a :ref:`setuptools` wrapper for CPython that builds C/C++/Fortran/Cython extensions It uses -`cmake `__ (available on PyPI) to provide +:pypi:`cmake` (available on PyPI) to provide better support for additional compilers, build systems, cross compilation, and locating dependencies and their associated build requirements. To speed up and -parallelize the build of large projects, the user can install `ninja -`__ (also available on PyPI). +parallelize the build of large projects, the user can install :pypi:`ninja` +(also available on PyPI). .. _scikit-build-core: @@ -668,11 +667,11 @@ scikit-build-core `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` Scikit-build-core is a build backend for CPython C/C++/Fortran/Cython -extensions. It enables users to write extensions with `cmake -`__ (available on PyPI) to provide better +extensions. It enables users to write extensions with :pypi:`cmake` +(available on PyPI) to provide better support for additional compilers, build systems, cross compilation, and locating dependencies and their associated build requirements. CMake/Ninja are automatically downloaded from PyPI if not available on the system. @@ -684,7 +683,7 @@ shiv `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` shiv is a command line utility for building fully self contained Python zipapps as outlined in :pep:`441`, but with all their @@ -697,7 +696,7 @@ simpleindex =========== :gh:`GitHub ` | -`PyPI `__ +:pypi:`PyPI ` simpleindex is a :term:`package index ` which routes URLs to multiple package indexes (including PyPI), serves local (or cloud-hosted, @@ -732,7 +731,7 @@ uv `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` A Python package and project manager, written in Rust for high performance. It supports creating and managing virtual environments, installing packages, @@ -745,7 +744,7 @@ zest.releaser `Docs `__ | `GitHub `__ | -`PyPI `__ +:pypi:`PyPI ` ``zest.releaser`` is a Python package release tool providing an abstraction layer on top of :ref:`twine`. Python developers use diff --git a/source/overview.rst b/source/overview.rst index 81a101736..ad921e1ab 100644 --- a/source/overview.rst +++ b/source/overview.rst @@ -96,16 +96,15 @@ go to the :ref:`source-distribution-format` specification to learn more. If you rely on any non-Python code, or non-Python packages (such as `libxml2 `_ in the case of -`lxml `_, or BLAS libraries in the -case of `numpy `_), you will need to +:pypi:`lxml`, or BLAS libraries in the +case of :pypi:`numpy`), you will need to use the format detailed in the next section, which also has many advantages for pure-Python libraries. .. note:: Python and PyPI support multiple distributions providing different implementations of the same package. For instance the - unmaintained-but-seminal `PIL distribution - `_ provides the PIL package, and so - does `Pillow `_, an + unmaintained-but-seminal :pypi:`PIL distribution ` provides the PIL package, and so + does :pypi:`Pillow`, an actively-maintained fork of PIL! This Python packaging superpower makes it possible for Pillow to be @@ -311,7 +310,7 @@ A selection of Python freezers: * `py2exe `_ - Windows only * `py2app `_ - Mac only * `osnap `_ - Windows and Mac -* `pynsist `_ - Windows only +* :pypi:`pynsist` - Windows only Most of the above imply single-user deployments. For multi-component server applications, see :gh:`Chef Omnibus diff --git a/source/specifications/dependency-specifiers.rst b/source/specifications/dependency-specifiers.rst index 964d81aa7..1e930f352 100644 --- a/source/specifications/dependency-specifiers.rst +++ b/source/specifications/dependency-specifiers.rst @@ -718,8 +718,7 @@ References .. [#pip] pip, the recommended installer for Python packages (http://pip.readthedocs.org/en/stable/) -.. [#parsley] The parsley PEG library. - (https://pypi.org/project/Parsley/) +.. [#parsley] The :pypi:`parsley PEG library `. .. [#future_versions] Future Python versions might be problematic with the definition of Environment Marker Variable ``python_version`` diff --git a/source/specifications/pylock-toml.rst b/source/specifications/pylock-toml.rst index 6c1493d67..e3708952d 100644 --- a/source/specifications/pylock-toml.rst +++ b/source/specifications/pylock-toml.rst @@ -82,7 +82,7 @@ consistent order. Usage of inline tables SHOULD also be kept consistent. - **Type**: Array of strings - **Required?**: no -- **Inspiration**: uv_ +- **Inspiration**: :pypi:`uv` - A list of :ref:`dependency-specifiers-environment-markers` for which the lock file is considered compatible with. - Tools SHOULD write exclusive/non-overlapping environment markers to ease in @@ -96,7 +96,7 @@ consistent order. Usage of inline tables SHOULD also be kept consistent. - **Type**: string - **Required?**: no -- **Inspiration**: PDM_, Poetry_, uv_ +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv` - Specifies the :ref:`core-metadata-requires-python` for the minimum Python version compatible for any environment supported by the lock file (i.e. the minimum viable Python version for the lock file). @@ -153,7 +153,7 @@ consistent order. Usage of inline tables SHOULD also be kept consistent. - **Type**: Array of strings - **Required?**: no; defaults to ``[]`` -- **Inspiration**: Poetry_, PDM_ +- **Inspiration**: :pypi:`Poetry `, :pypi:`PDM ` - The name of synthetic dependency groups to represent what should be installed by default (e.g. what :ref:`[project.dependencies] ` implicitly @@ -187,7 +187,7 @@ consistent order. Usage of inline tables SHOULD also be kept consistent. - **Type**: array of tables - **Required?**: yes -- **Inspiration**: PDM_, Poetry_, uv_ +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv` - An array containing all packages that *may* be installed. - Packages MAY be listed multiple times with varying data, but all packages to be installed MUST narrow down to a single entry at install time. @@ -228,7 +228,7 @@ consistent order. Usage of inline tables SHOULD also be kept consistent. - **Type**: string - **Required?**: no -- **Inspiration**: PDM_ +- **Inspiration**: :pypi:`PDM ` - The :ref:`environment marker ` which specify when the package should be installed. @@ -253,7 +253,7 @@ consistent order. Usage of inline tables SHOULD also be kept consistent. - **Type**: array of tables - **Required?**: no -- **Inspiration**: PDM_, Poetry_, uv_ +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv` - Records the other entries in :ref:`pylock-packages` which are direct dependencies of this package. - Each entry is a table which contains the minimum information required to tell @@ -478,7 +478,7 @@ See :ref:`pylock-packages-vcs-subdirectory`. - **Type**: integer - **Required?**: no -- **Inspiration**: uv_, :ref:`simple-repository-api` +- **Inspiration**: :pypi:`uv`, :ref:`simple-repository-api` - The size of the archive file. - Tools SHOULD provide the file size when reasonably possible (e.g. the file size is available via the Content-Length_ header from a HEAD_ HTTP request). @@ -503,7 +503,7 @@ See :ref:`pylock-packages-vcs-subdirectory`. - **Type**: Table of strings - **Required?**: yes -- **Inspiration**: PDM_, Poetry_, uv_, :ref:`simple-repository-api` +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv`, :ref:`simple-repository-api` - A table listing known hash values of the file where the key is the hash algorithm and the value is the hash value. - The table MUST contain at least one entry. @@ -528,7 +528,7 @@ See :ref:`pylock-packages-vcs-subdirectory`. - **Type**: string - **Required?**: no -- **Inspiration**: uv_ +- **Inspiration**: :pypi:`uv` - The base URL for the package index from :ref:`simple-repository-api` where the sdist and/or wheels were found (e.g. ``https://pypi.org/simple/``). - When possible, this SHOULD be specified to assist with generating @@ -546,7 +546,7 @@ See :ref:`pylock-packages-vcs-subdirectory`. - **Type**: table - **Required?**: no; mutually-exclusive with :ref:`pylock-packages-vcs`, :ref:`pylock-packages-directory`, and :ref:`pylock-packages-archive` -- **Inspiration**: uv_ +- **Inspiration**: :pypi:`uv` - Details of a :ref:`source-distribution-format-sdist` for the package. - Tools MAY choose to not support sdist files, both from a locking @@ -563,7 +563,7 @@ See :ref:`pylock-packages-vcs-subdirectory`. - **Required?**: no, not when the last component of :ref:`pylock-packages-sdist-path`/ :ref:`pylock-packages-sdist-url` would be the same value -- **Inspiration**: PDM_, Poetry_, uv_ +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv` - The file name of the :ref:`source-distribution-format-sdist` file. - If specified, this key's value takes precedence over the file name found in either :ref:`pylock-packages-sdist-url` or :ref:`pylock-packages-sdist-path`. @@ -618,7 +618,7 @@ See :ref:`pylock-packages-archive-hashes`. - **Type**: array of tables - **Required?**: no; mutually-exclusive with :ref:`pylock-packages-vcs`, :ref:`pylock-packages-directory`, and :ref:`pylock-packages-archive` -- **Inspiration**: PDM_, Poetry_, uv_ +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv` - For recording the wheel files as specified by :ref:`binary-distribution-format` for the package. - Tools MUST support wheel files, both from a locking and installation @@ -634,7 +634,7 @@ See :ref:`pylock-packages-archive-hashes`. - **Required?**: no, not when the last component of :ref:`pylock-packages-wheels-path`/ :ref:`pylock-packages-wheels-url` would be the same value -- **Inspiration**: PDM_, Poetry_, uv_ +- **Inspiration**: :pypi:`PDM `, :pypi:`Poetry `, :pypi:`uv` - The file name of the :ref:`binary-distribution-format` file. - If specified, this key's value takes precedence over the file name found in either :ref:`pylock-packages-wheels-url` or :ref:`pylock-packages-wheels-path`. @@ -847,12 +847,8 @@ History .. _Content-Length: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Length .. _Dependabot: https://docs.github.com/en/code-security/dependabot .. _HEAD: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/HEAD -.. _PDM: https://pypi.org/project/pdm/ -.. _pip-tools: https://pypi.org/project/pip-tools/ -.. _Poetry: https://pypi.org/project/poetry/ .. _requirements file: .. _requirements files: https://pip.pypa.io/en/stable/reference/requirements-file-format/ .. _software bill of materials: https://www.cisa.gov/sbom .. _TOML: https://toml.io/ -.. _uv: https://pypi.org/project/uv/ .. _URL: https://url.spec.whatwg.org/ diff --git a/source/specifications/pypirc.rst b/source/specifications/pypirc.rst index b937a1d62..e85152074 100644 --- a/source/specifications/pypirc.rst +++ b/source/specifications/pypirc.rst @@ -46,7 +46,7 @@ Each section describing a repository defines three fields: .. warning:: Be aware that this stores your password in plain text. For better security, - consider an alternative like `keyring`_, setting environment variables, or + consider an alternative like :pypi:`keyring`, setting environment variables, or providing the password on the command line. Otherwise, set the permissions on :file:`.pypirc` so that only you can view @@ -56,8 +56,6 @@ Each section describing a repository defines three fields: chmod 600 ~/.pypirc -.. _keyring: https://pypi.org/project/keyring/ - Common configurations ===================== @@ -134,7 +132,7 @@ example of a :file:`$HOME/.pypirc` for PyPI, TestPyPI, and a private repository: .. warning:: Instead of using the ``password`` field, consider saving your API tokens - and passwords securely using `keyring`_ (which is installed by Twine): + and passwords securely using :pypi:`keyring` (which is installed by Twine): .. code-block:: bash diff --git a/source/specifications/pyproject-toml.rst b/source/specifications/pyproject-toml.rst index 43fdb4b84..ac4f10edc 100644 --- a/source/specifications/pyproject-toml.rst +++ b/source/specifications/pyproject-toml.rst @@ -685,7 +685,7 @@ Arbitrary tool configuration: the ``[tool]`` table The ``[tool]`` table is where any tool related to your Python project, not just build tools, can have users specify configuration data as long as they use a sub-table within ``[tool]``, e.g. the -`flit `_ tool would store its +:pypi:`flit` tool would store its configuration in ``[tool.flit]``. A mechanism is needed to allocate names within the ``tool.*`` diff --git a/source/tutorials/managing-dependencies.rst b/source/tutorials/managing-dependencies.rst index 10df7791a..ae600030b 100644 --- a/source/tutorials/managing-dependencies.rst +++ b/source/tutorials/managing-dependencies.rst @@ -70,7 +70,7 @@ tutorial) and run: cd myproject pipenv install requests -Pipenv will install the `Requests`_ library and create a ``Pipfile`` +Pipenv will install the :pypi:`Requests ` library and create a ``Pipfile`` for you in your project's directory. The `Pipfile `__ is used to track which dependencies your project needs in case you need to re-install them, such as @@ -103,7 +103,6 @@ when you share your project with others. You should get output similar to this Adding requests to Pipfile's [packages]... -.. _Requests: https://pypi.org/project/requests/ Using installed packages