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

build: Migrate from setup.py to pyproject.toml #222

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

adrienverge
Copy link
Owner

docs: Remove specificity of commands pip3 and python3

Python 2 has been sunset since 2020 1, and localstripe never
supported it.

This commit updates documentation to use python and pip instead of
python3 and pip3.


Remove UTF-8 headers in Python files

The # -*- coding: utf-8 -*- headers are useful for Python 2, but
aren't needed for Python 3 which is the only supported version. Let's
drop these headers.


build: Migrate from setup.py to pyproject.toml

Using setup.py is deprecated and the new recommanded way is to declare
a pyproject.toml file (see PEP 517 2).

This commit proposes to use setuptools to achieve that, because
setuptools is already used by localstripe, is standard and referenced by
the official Python packaging documentation 3, and seems to be the
most lightweight solution.

For some period, the setup.py file will be kept (although almost
empty), to allow old tools versions to keep working.

I have done the same migration for yamllint 7 months ago 4 and it
appeared to work well.

Footnotes

  1. https://www.python.org/doc/sunset-python-2/

  2. https://peps.python.org/pep-0517/

  3. https://packaging.python.org/en/latest/tutorials/installing-packages/

  4. https://github.com/adrienverge/yamllint/pull/566

@adrienverge adrienverge force-pushed the feat/pyproject.toml branch 3 times, most recently from 41090a6 to 98e89b2 Compare November 30, 2023 10:08
Python 2 has been sunset since 2020 [^1], and localstripe never
supported it.

This commit updates documentation to use `python` and `pip` instead of
`python3` and `pip3`.

[^1]: https://www.python.org/doc/sunset-python-2/
The `# -*- coding: utf-8 -*-` headers are useful for Python 2, but
aren't needed for Python 3 which is the only supported version. Let's
drop these headers.
Using `setup.py` is deprecated and the new recommanded way is to declare
a `pyproject.toml` file (see PEP 517 [^1]).

This commit proposes to use setuptools to achieve that, because
setuptools is already used by localstripe, is standard and referenced by
the official Python packaging documentation [^2], and seems to be the
most lightweight solution.

For some period, the `setup.py` file will be kept (although almost
empty), to allow old tools versions to keep working.

I have done the same migration for yamllint 7 months ago [^3] and it
appeared to work well.

[^1]: https://peps.python.org/pep-0517/
[^2]: https://packaging.python.org/en/latest/tutorials/installing-packages/
[^3]: adrienverge/yamllint#566
@adrienverge adrienverge merged commit 3916ea1 into master Dec 1, 2023
12 checks passed
@adrienverge adrienverge deleted the feat/pyproject.toml branch December 1, 2023 11:10
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