-
Notifications
You must be signed in to change notification settings - Fork 972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add discussion How to modernize a setup.py project #1341
Add discussion How to modernize a setup.py project #1341
Conversation
77f99bc
to
6752487
Compare
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done :)
6752487
to
be97842
Compare
======================================== | ||
|
||
Yes. This is strongly recommended. | ||
The presence of a ``pyproject.toml`` file itself does not bring much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the :file:
role for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done :)
How to handle packaging metadata? | ||
================================= | ||
|
||
All static metadata can be moved to a ``[project]`` table in the ``pyproject.toml`` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe link to the Declaring project metdata spec here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done :)
@@ -0,0 +1,221 @@ | |||
============================================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
============================================== | |
.. _`modernize setup.py project`: | |
============================================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done :)
be97842
to
12c7a24
Compare
.. todo:: | ||
|
||
Add note that the presence of pyproject.toml changes the default behavior of pip | ||
to use build isolation? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This todo is done now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
removed
12c7a24
to
ef508ed
Compare
Now at #1371 |
GitHub: refs #1334
Preview: https://python-packaging-user-guide--1341.org.readthedocs.build/en/1341/discussions/modernize-setup-py-project/