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/557pull/219/merge
parent
16eae28a50
commit
15eafeb80a
@ -0,0 +1,4 @@
|
|||||||
|
[flake8]
|
||||||
|
import-order-style = pep8
|
||||||
|
application-import-names = yamllint
|
||||||
|
ignore = W503,W504
|
@ -1,4 +0,0 @@
|
|||||||
include LICENSE
|
|
||||||
include README.rst
|
|
||||||
include docs/*
|
|
||||||
include tests/*.py tests/rules/*.py tests/yaml-1.2-spec-examples/*
|
|
@ -0,0 +1,54 @@
|
|||||||
|
[project]
|
||||||
|
name = "yamllint"
|
||||||
|
description = "A linter for YAML files."
|
||||||
|
readme = {file = "README.rst", content-type = "text/x-rst"}
|
||||||
|
requires-python = ">=3.7"
|
||||||
|
license = {text = "GPL-3.0-only"}
|
||||||
|
authors = [{name = "Adrien Vergé"}]
|
||||||
|
keywords = ["yaml", "lint", "linter", "syntax", "checker"]
|
||||||
|
classifiers = [
|
||||||
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
"Environment :: Console",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Topic :: Software Development",
|
||||||
|
"Topic :: Software Development :: Debuggers",
|
||||||
|
"Topic :: Software Development :: Quality Assurance",
|
||||||
|
"Topic :: Software Development :: Testing",
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
"pathspec >= 0.5.3",
|
||||||
|
"pyyaml",
|
||||||
|
]
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = [
|
||||||
|
"doc8",
|
||||||
|
"flake8",
|
||||||
|
"flake8-import-order",
|
||||||
|
"rstcheck[sphinx]",
|
||||||
|
"sphinx",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
yamllint = "yamllint.cli:run"
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
homepage = "https://github.com/adrienverge/yamllint"
|
||||||
|
repository = "https://github.com/adrienverge/yamllint"
|
||||||
|
documentation = "https://yamllint.readthedocs.io"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
requires = ["setuptools >= 61"]
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = ["yamllint", "yamllint.conf", "yamllint.rules"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
yamllint = ["conf/*.yaml"]
|
||||||
|
|
||||||
|
[tool.setuptools.dynamic]
|
||||||
|
version = {attr = "yamllint.__version__"}
|
@ -1,63 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
import-order-style = pep8
|
|
||||||
application-import-names = yamllint
|
|
||||||
ignore = W503,W504
|
|
||||||
|
|
||||||
[metadata]
|
|
||||||
keywords =
|
|
||||||
yaml
|
|
||||||
lint
|
|
||||||
linter
|
|
||||||
syntax
|
|
||||||
checker
|
|
||||||
|
|
||||||
url = https://github.com/adrienverge/yamllint
|
|
||||||
classifiers =
|
|
||||||
Development Status :: 5 - Production/Stable
|
|
||||||
Environment :: Console
|
|
||||||
Intended Audience :: Developers
|
|
||||||
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
||||||
Programming Language :: Python :: 3
|
|
||||||
Programming Language :: Python :: 3.7
|
|
||||||
Programming Language :: Python :: 3.8
|
|
||||||
Programming Language :: Python :: 3.9
|
|
||||||
Programming Language :: Python :: 3.10
|
|
||||||
Programming Language :: Python :: 3.11
|
|
||||||
Topic :: Software Development
|
|
||||||
Topic :: Software Development :: Debuggers
|
|
||||||
Topic :: Software Development :: Quality Assurance
|
|
||||||
Topic :: Software Development :: Testing
|
|
||||||
|
|
||||||
project_urls =
|
|
||||||
Documentation = https://yamllint.readthedocs.io
|
|
||||||
Download = https://pypi.org/project/yamllint/#files
|
|
||||||
Bug Tracker = https://github.com/adrienverge/yamllint/issues
|
|
||||||
Source Code = https://github.com/adrienverge/yamllint
|
|
||||||
|
|
||||||
[options]
|
|
||||||
packages = find:
|
|
||||||
|
|
||||||
python_requires = >=3.7
|
|
||||||
|
|
||||||
include_package_data = True
|
|
||||||
install_requires =
|
|
||||||
pathspec >= 0.5.3
|
|
||||||
pyyaml
|
|
||||||
setuptools
|
|
||||||
|
|
||||||
test_suite = tests
|
|
||||||
|
|
||||||
[options.packages.find]
|
|
||||||
exclude =
|
|
||||||
tests
|
|
||||||
tests.*
|
|
||||||
|
|
||||||
[options.package_data]
|
|
||||||
yamllint = conf/*.yaml
|
|
||||||
|
|
||||||
[options.entry_points]
|
|
||||||
console_scripts =
|
|
||||||
yamllint = yamllint.cli:run
|
|
||||||
|
|
||||||
[coverage:run]
|
|
||||||
relative_files = True
|
|
Loading…
Reference in New Issue