Skip to content

Commit 9409cac

Browse files
Doc updates for pyproject.toml and instructions for pypi (#480)
* Adding docs for pyproject.toml, and some additional instructions for trusted publishing via pypi. * Update docs/practices/customizing_project.rst Co-authored-by: Melissa DeLucchi <[email protected]> * Apply suggestions from code review * Update docs/practices/customizing_project.rst --------- Co-authored-by: Melissa DeLucchi <[email protected]>
1 parent 70ce81d commit 9409cac

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ please :doc:`/source/contact`
5151
practices/issue_pr_templating
5252
practices/sphinx
5353
practices/publishing_package
54+
practices/customizing_project
5455

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Configuration with pyproject.toml
2+
===============================================================================
3+
4+
What is it? Why do it?
5+
-------------------------------------------------------------------------------
6+
7+
The ``pyproject.toml`` file is used to define many different project configurations.
8+
It replaces the need for setup.py, requirements.txt, and other configuration files.
9+
10+
A fundamental use for ``pyproject.toml`` is to define dependencies. You should
11+
make an effort to add all the required dependencies to the ``[dependencies]``
12+
section of the file. The template also creates a section for dependencies used only in development: ``[project.optional-dependencies][dev]``. You can add additional sets of optional dependencies here, e.g. for extended feature sets.
13+
14+
In addition to dependencies, ``pyproject.toml`` centralizes the project's
15+
configuration and makes it easier to manage. If you examine your ``pyproject.toml``
16+
file, you'll see sections with titles like ``[tool.<blah>]``. These sections are
17+
used to configure tools that are used in the project that would otherwise require
18+
their own configuration files.
19+
20+
A ``pyproject.toml`` file provides a vast number of customization options well
21+
beyond what can be covered here. For an in-depth look at how the file can be used
22+
and how it compares to the older ``setup.py`` checkout the
23+
`Python Packaging User Guide <https://packaging.python.org/en/latest/guides/writing-pyproject-toml/>`_.

docs/practices/pypi.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ To support this, you'll need to configure your repository.
2626

2727
* For previously unpublished packages: https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/
2828
* For existing published packaged: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
29-
30-
* When configuring your trusted publisher, the value to use for the "Workflow name" is "publish-to-pypi.yml".
29+
30+
* When configuring your trusted publisher
31+
32+
* Set the value of "Workflow name" to "publish-to-pypi.yml".
33+
* Leave the value of "Environment name" blank.
3134

3235

3336
Releasing new versions

0 commit comments

Comments
 (0)