Add discussion How to modernize a setup.py project - #1341
Closed
sinoroc wants to merge 1 commit into
Closed
Conversation
sinoroc
force-pushed
the
add-discussion-modernize-setup-py-project
branch
3 times, most recently
from
November 4, 2023 19:23
77f99bc to
6752487
Compare
Comment on lines
+46
to
+58
| Where to start? | ||
| =============== | ||
|
|
||
| The :term:`project` must contain a ``pyproject.toml`` file at the root of its source tree | ||
| that contains a ``[build-system]`` table like so: | ||
|
|
||
| .. code:: toml | ||
|
|
||
| [build-system] | ||
| requires = ["setuptools"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
|
|
||
| This is the standardized method of letting :term:`build frontends <Build Frontend>` know | ||
| that :ref:`setuptools` is the :term:`build backend <Build Backend>` for this project. |
There was a problem hiding this comment.
I would note here that adding this enables built-time isolation by default which naturally leads into the next section (build-time dependencies).
Somewhere lower down there could be a section specifically about build isolation and how to disable it when using pip or build. That section could also say why you might want to disable build isolation e.g. to pin the versions of build requirements.
sinoroc
force-pushed
the
add-discussion-modernize-setup-py-project
branch
from
November 5, 2023 18:43
6752487 to
be97842
Compare
chrysle
reviewed
Nov 6, 2023
| ======================================== | ||
|
|
||
| Yes. This is strongly recommended. | ||
| The presence of a ``pyproject.toml`` file itself does not bring much. |
Contributor
There was a problem hiding this comment.
Could you use the :file: role for these?
| How to handle packaging metadata? | ||
| ================================= | ||
|
|
||
| All static metadata can be moved to a ``[project]`` table in the ``pyproject.toml`` file. |
Contributor
There was a problem hiding this comment.
Maybe link to the Declaring project metdata spec here?
| @@ -0,0 +1,221 @@ | |||
| ============================================== | |||
Contributor
There was a problem hiding this comment.
Suggested change
| ============================================== | |
| .. _`modernize setup.py project`: | |
| ============================================== |
sinoroc
force-pushed
the
add-discussion-modernize-setup-py-project
branch
from
November 6, 2023 20:56
be97842 to
12c7a24
Compare
Comment on lines
+17
to
+20
| .. todo:: | ||
|
|
||
| Add note that the presence of pyproject.toml changes the default behavior of pip | ||
| to use build isolation? |
sinoroc
force-pushed
the
add-discussion-modernize-setup-py-project
branch
from
November 6, 2023 22:18
12c7a24 to
ef508ed
Compare
Contributor
Author
|
Now at #1371 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub: refs #1334
Preview: https://python-packaging-user-guide--1341.org.readthedocs.build/en/1341/discussions/modernize-setup-py-project/