Skip to content

Add discussion How to modernize a setup.py project - #1341

Closed
sinoroc wants to merge 1 commit into
pypa:mainfrom
sinoroc:add-discussion-modernize-setup-py-project
Closed

Add discussion How to modernize a setup.py project#1341
sinoroc wants to merge 1 commit into
pypa:mainfrom
sinoroc:add-discussion-modernize-setup-py-project

Conversation

@sinoroc

@sinoroc sinoroc commented Nov 4, 2023

Copy link
Copy Markdown
Contributor

@sinoroc
sinoroc force-pushed the add-discussion-modernize-setup-py-project branch 3 times, most recently from 77f99bc to 6752487 Compare November 4, 2023 19:23
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.

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done :)

@sinoroc
sinoroc force-pushed the add-discussion-modernize-setup-py-project branch from 6752487 to be97842 Compare November 5, 2023 18:43
========================================

Yes. This is strongly recommended.
The presence of a ``pyproject.toml`` file itself does not bring much.

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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 @@
==============================================

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==============================================
.. _`modernize setup.py project`:
==============================================

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done :)

@sinoroc
sinoroc force-pushed the add-discussion-modernize-setup-py-project branch from be97842 to 12c7a24 Compare November 6, 2023 20:56
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?

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
removed

@sinoroc
sinoroc force-pushed the add-discussion-modernize-setup-py-project branch from 12c7a24 to ef508ed Compare November 6, 2023 22:18
@sinoroc sinoroc closed this Nov 8, 2023
@sinoroc
sinoroc deleted the add-discussion-modernize-setup-py-project branch November 8, 2023 21:08
@sinoroc

sinoroc commented Nov 8, 2023

Copy link
Copy Markdown
Contributor Author

Now at #1371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants