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: add PEP-517 build config with Poetry #557

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
import-order-style = pep8
application-import-names = yamllint
ignore = W503,W504
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Append GitHub Actions system path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: pip install coveralls
- run: pip install coverage[toml]
- run: pip install .
- run: coverage run --source=yamllint -m unittest discover
# https://github.com/AndreMiras/coveralls-python-action/issues/18
- run: echo -e "[run]\nrelative_files = True" > .coveragerc
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

sys.path.insert(0, os.path.abspath('..'))

from yamllint import __copyright__, APP_NAME, APP_VERSION # noqa
from yamllint import __copyright__, APP_NAME, __version__ # noqa

# -- General configuration ------------------------------------------------

Expand All @@ -22,8 +22,8 @@
project = APP_NAME
copyright = __copyright__.lstrip('Copyright ')

version = APP_VERSION
release = APP_VERSION
version = __version__
release = __version__

pygments_style = 'sphinx'

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If you prefer installing from source, you can run, from the source directory:

.. code:: bash

python setup.py sdist
poetry build
pip install --user dist/yamllint-*.tar.gz

Running yamllint
Expand Down
170 changes: 170 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[tool.poetry]
name = "yamllint"
version = "1.30.0"
description = ""
authors = ["Adrien Vergé"]
license = "GPLv3"
readme = "README.rst"
homepage = "https://github.com/adrienverge/yamllint"
repository = "https://github.com/adrienverge/yamllint"
documentation = "https://yamllint.readthedocs.io"
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 :: 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",
]
include = ["docs/*", "tests/*.py", "tests/rules/*.py", "tests/yaml-1.2-spec-examples/*"]

[tool.poetry.urls]
Download = "https://pypi.org/project/yamllint/#files"

[tool.poetry.dependencies]
python = ">=3.7"
pathspec = ">=0.5.3"
pyyaml = ">=6.0"
importlib-metadata = { version = ">=4.10.0", python = "<3.8" }

[tool.poetry.group.dev.dependencies]
flake8 = {version = ">=6.0.0", python = ">=3.8.1"}

[tool.poetry.scripts]
yamllint = "yamllint.cli:run"

[tool.coverage.run]
relative_files = true

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
63 changes: 0 additions & 63 deletions setup.cfg

This file was deleted.

29 changes: 0 additions & 29 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions yamllint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
repetition and cosmetic problems such as lines length, trailing spaces,
indentation, etc."""

from importlib import metadata

APP_NAME = 'yamllint'
APP_VERSION = '1.30.0'
APP_DESCRIPTION = __doc__

__author__ = 'Adrien Vergé'
__copyright__ = 'Copyright 2022, Adrien Vergé'
__license__ = 'GPLv3'
__version__ = APP_VERSION
__version__ = metadata.version('yamllint')
4 changes: 2 additions & 2 deletions yamllint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import platform
import sys

from yamllint import APP_DESCRIPTION, APP_NAME, APP_VERSION
from yamllint import APP_DESCRIPTION, APP_NAME, __version__
from yamllint import linter
from yamllint.config import YamlLintConfig, YamlLintConfigError
from yamllint.linter import PROBLEM_LEVELS
Expand Down Expand Up @@ -171,7 +171,7 @@ def run(argv=None):
action='store_true',
help='output only error level problems')
parser.add_argument('-v', '--version', action='version',
version='{} {}'.format(APP_NAME, APP_VERSION))
version='{} {}'.format(APP_NAME, __version__))

args = parser.parse_args(argv)

Expand Down