Skip to content
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

RFC: Switch build backend to hatchling and use pyproject.toml #3924

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

PaulYuuu
Copy link
Contributor

@PaulYuuu PaulYuuu commented Jun 5, 2024

Modernize a setup.py based project by adding pyproject.toml, move
package configuration to pyproject.toml, and also switch to hatchling as the build backend.

Refs: https://packaging.python.org/en/latest/guides/modernize-setup-py-project
Signed-off-by: Yihuang Yu [email protected]

@PaulYuuu PaulYuuu changed the title RFC: Use modern pyproject.toml and deprecate some "python setup.py" operations RFC: Use pyproject.toml and deprecate some "python setup.py" operations Jun 5, 2024
@PaulYuuu PaulYuuu force-pushed the pyproject branch 6 times, most recently from cef6d5e to 2084547 Compare June 7, 2024 06:17
@PaulYuuu PaulYuuu changed the title RFC: Use pyproject.toml and deprecate some "python setup.py" operations RFC: Switch build backend to hatchling and use pyproject.toml Jun 7, 2024
@PaulYuuu PaulYuuu force-pushed the pyproject branch 3 times, most recently from 60f8949 to c0dd58a Compare June 11, 2024 02:10
@PaulYuuu
Copy link
Contributor Author

Hello @luckyh @clebergnu @richtja, as I can see directly invoke python setup.py is deprecated, and of course pip install . can be used. However, besides this, SetuptoolsDeprecationWarning during installation, so I sent this PR and plan to move the backend to hatchling, and use modern pyproject.toml, it supports more features.

@clebergnu I also saw the avocado issue avocado-framework/avocado#5754, as VT is a plugin of avocado, so I am happy to listen to your voice, not sure what's the plan for avocado. I also tried to migrate avocado to hatch, but the setup.py has some complex custom targets, so I only modified some basic settings.

Modernize a setup.py based project by adding pyproject.toml, move
package configuration to pyproject.toml, and use hatchling as the
builder instead of setuptools.

Refs: https://packaging.python.org/en/latest/guides/modernize-setup-py-project
Refs: https://hatch.pypa.io/latest/why
Signed-off-by: Yihuang Yu <[email protected]>
Config file of black, isort and pylint can be pyproject.toml, so add
some basic settings in pyproject.toml, so users can use the simple
command to format.

Signed-off-by: Yihuang Yu <[email protected]>
VT currently supports from python3.8, but centos 8 uses python3.6, so
remove it.

Signed-off-by: Yihuang Yu <[email protected]>
Migrate deprecated "setup.py install/develop" with "pip install", also
some "setup.py build" to "python -m build". For the custom clean target,
convert it to shell in the Makefile.

Also use the hatch cli as the entry to run formatter and linter.

Refs: https://packaging.python.org/en/latest/discussions/setup-py-deprecated
Signed-off-by: Yihuang Yu <[email protected]>
egg had been replaced with wheel format, and should not be used anymore.

Refs: https://packaging.python.org/en/latest/discussions/package-formats/#what-about-eggs
Signed-off-by: Yihuang Yu <[email protected]>
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.

1 participant