Python Enhancement Proposals
Go to file
Stephen Rosen 2ec2140ec8
PEP 735: expand "How to Teach This" (#3945)
With the addition of `project.dependencies` includes from Dependency
Groups, additions are warranted in the "How to Teach This" section of
the PEP.

Firstly, it is now useful to mention the similarity between a
dependency group and an old-style `setup.py` which reads either as

    setup(install_requires=_read_helper("requirements.txt"), ...)

or else as

    requirements = ["foo", ...]
    ...
    setup(install_requires=requirements, ...)

Secondly, discussion of the interfaces for Dependency Groups adds a
dimension to the document. For tool authors, this clarifies that
allowing `project.dependencies` to use includes is necessary for
build backends to declare support, but that there are no other formal
requirements for tools. They will have to decide on interfaces -- and
therefore what it means to support Dependency Groups -- for
themselves. The spec provides only for the data. Additionally, the
consequences for users, and the fact that this allows tools to define
and enforce additional rules (which they must document) are called out
explicitly.

Implicitly, this hints that it is possible for tools to have
conflicting requirements, so that it may become possible for toolA and
toolB to have incompatible or at least orthogonal needs. Due to the
relatively low risk of outright conflicts, and the ability of
responsible tool maintainers to work through such cases if they do
arise, this is not addressed at length.
2024-09-04 16:11:28 -07:00
.codespell Fix typos in PEPs using codespell (#3909) 2024-08-20 13:29:32 +03:00
.github PEP 752: Package repository namespaces (#3903) 2024-08-18 12:07:11 -07:00
docs Infra: Refactor Makefile (#3514) 2023-11-03 01:24:48 -06:00
infra PEP 1 and 12: Document Topic header (#2995) 2023-02-03 21:34:17 +02:00
pep_sphinx_extensions Meta: Document the PEPs API (#3864) 2024-07-16 23:04:03 -06:00
peps PEP 735: expand "How to Teach This" (#3945) 2024-09-04 16:11:28 -07:00
.codespellrc Fix typos in PEPs using codespell (#3909) 2024-08-20 13:29:32 +03:00
.gitattributes Meta: Instruct linguist to include PEPs in the statistics (#3430) 2023-09-09 19:58:51 +01:00
.gitignore Add sphinx-warnings.txt to .gitignore 2023-10-09 15:05:31 +02:00
.pre-commit-config.yaml Meta: Document the PEPs API (#3864) 2024-07-16 23:04:03 -06:00
.readthedocs.yaml Infra: makefile/RTD: Use uv if installed (#3791) 2024-05-29 17:35:25 +03:00
.ruff.toml Meta: Update config (#3645) 2024-02-08 18:43:54 +02:00
CONTRIBUTING.rst Meta: Update pre-commit to fix Sphinx Lint (#3585) 2023-12-12 17:06:18 +00:00
Makefile Infra: Remove GNU make-specific directive from Makefile (#3891) 2024-08-04 16:31:04 +01:00
README.rst Update Read the Docs name and URL (#3588) 2023-12-14 21:37:56 +00:00
build.py All PEPs: Move to ``peps/`` folder (#3418) 2023-09-09 18:39:29 +01:00
check-peps.py Infra: Make check-peps’ _validate_post_history crash less (#3511) 2023-10-28 16:23:55 -07:00
pytest.ini Lint: Add ``check-peps.py`` (#3275) 2023-09-05 04:44:46 +01:00
requirements.txt Infra: Only install sphinx-autobuild for `make htmllive` (#3796) 2024-05-27 22:47:37 -07:00
tox.ini Meta: Update config (#3645) 2024-02-08 18:43:54 +02:00

README.rst

Python Enhancement Proposals
============================

.. image:: https://github.com/python/peps/actions/workflows/render.yml/badge.svg
    :target: https://github.com/python/peps/actions

The PEPs in this repo are published automatically on the web at
https://peps.python.org/. To learn more about the purpose of PEPs and how to go
about writing one, please start reading at :pep:`1`. Note that the PEP Index
(:pep:`0`) is automatically generated based on the metadata headers in other PEPs.


Canonical links
===============

The canonical form of PEP links are zero-padded, such as
``https://peps.python.org/pep-0008/``.

Shortcut redirects are also available.
For example, ``https://peps.python.org/8`` redirects to the canonical link.


Contributing to PEPs
====================

See the `Contributing Guidelines <./CONTRIBUTING.rst>`_.


Checking PEP formatting and rendering
=====================================

Please don't commit changes with reStructuredText syntax errors that cause PEP
generation to fail, or result in major rendering defects relative to what you
intend.


Browse the "Read the Docs" preview
----------------------------------

For every PR, we automatically create a preview of the rendered PEPs using
`Read the Docs <https://about.readthedocs.com>`_.
You can find it in the merge box at the bottom of the PR page:

1. Click "Show all checks" to expand the checks section
2. Find the line for ``docs/readthedocs.org:pep-previews``
3. Click on "Details" to the right


Render PEPs locally
-------------------

See the `build documentation <./docs/build.rst>`__ for full
instructions on how to render PEPs locally.
In summary, run the following in a fresh, activated virtual environment:

.. code-block:: bash

    # Install requirements
    python -m pip install -U -r requirements.txt

    # Build the PEPs
    make html

    # Or, if you don't have 'make':
    python build.py

The output HTML is found under the ``build`` directory.


Check and lint PEPs
-------------------

You can check for and fix common linting and spelling issues,
either on-demand or automatically as you commit, with our pre-commit suite.
See the `Contributing Guide <./CONTRIBUTING.rst>`_ for details.