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 [^1]).

This commit proposes to use setuptools to achieve that, because
setuptools is already used by yamllint, is standard and referenced by
the official Python packaging documentation [^2], and seems to be the
most lightweight solution. An alternative could have been to use Poetry,
see the dedicated pull request and discussion [^3].

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

Closes https://github.com/adrienverge/yamllint/issues/509.

[^1]: https://peps.python.org/pep-0517/
[^2]: https://packaging.python.org/en/latest/tutorials/installing-packages/
[^3]: https://github.com/adrienverge/yamllint/pull/557
This commit is contained in:
Adrien Vergé
2023-04-14 16:40:01 +02:00
parent 16eae28a50
commit 15eafeb80a
7 changed files with 68 additions and 85 deletions

4
.flake8 Normal file
View File

@@ -0,0 +1,4 @@
[flake8]
import-order-style = pep8
application-import-names = yamllint
ignore = W503,W504