Skip to content

Commit

Permalink
Use standalone extra files (#2849)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Dec 31, 2022
1 parent a0b06c2 commit 25c95e9
Show file tree
Hide file tree
Showing 12 changed files with 263 additions and 228 deletions.
8 changes: 8 additions & 0 deletions .config/requirements-docs.txt
@@ -0,0 +1,8 @@
myst-parser >= 0.16.1
pipdeptree >= 2.2.1
sphinx >= 4.4.0
sphinx-ansible-theme >= 0.9.1
sphinx-rtd-theme >= 1.0.0, < 2.0.0 # 1.0.0 broke rendering
sphinxcontrib-apidoc >= 0.3.0
sphinxcontrib-programoutput2 >= 2.0a1

39 changes: 39 additions & 0 deletions .config/requirements-lock.txt
@@ -0,0 +1,39 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --no-annotate --output-file=.config/requirements-lock.txt --resolver=backtracking --strip-extras pyproject.toml
#
ansible-compat==2.2.7
ansible-core==2.14.1 ; python_version >= "3.9"
attrs==22.2.0
black==22.12.0
bracex==2.3.post1
cffi==1.15.1
click==8.1.3
commonmark==0.9.1
cryptography==38.0.4
filelock==3.9.0
jinja2==3.1.2
jsonschema==4.17.3
markupsafe==2.1.1
mypy-extensions==0.4.3
packaging==22.0
pathspec==0.10.3
platformdirs==2.6.2
pycparser==2.21
pygments==2.13.0
pyrsistent==0.19.3
pyyaml==6.0
resolvelib==0.8.1
rich==13.0.0
ruamel-yaml==0.17.21
ruamel-yaml-clib==0.2.7
subprocess-tee==0.4.1
tomli==2.0.1
typing-extensions==4.4.0
wcmatch==8.4.1
yamllint==1.28.0

# The following packages are considered to be unsafe in a requirements file:
# setuptools
12 changes: 12 additions & 0 deletions .config/requirements-test.txt
@@ -0,0 +1,12 @@
coverage-enable-subprocess # see https://github.com/nedbat/coveragepy/issues/1341#issuecomment-1228942657
coverage[toml] >= 6.4.4
pytest >= 7.2.0
pytest-mock
pytest-plus >= 0.2 # for PYTEST_REQPASS
pytest-xdist >= 2.1.0
psutil # soft-dep of pytest-xdist
black # IDE support
mypy # IDE support
pylint # IDE support
flake8 # IDE support
flake8-future-annotations # IDE support
15 changes: 15 additions & 0 deletions .config/requirements.in
@@ -0,0 +1,15 @@
# Special order section for helping pip:
will-not-work-on-windows-try-from-wsl-instead; platform_system=='Windows'
ansible-core>=2.12.0,<2.14.0; python_version<'3.9' # GPLv3
ansible-core>=2.12.0; python_version>='3.9' # GPLv3
ansible-compat>=2.2.7 # GPLv3
# alphabetically sorted:
black>=22.8.0 # MIT
filelock>=3.3.0 # The Unlicense
jsonschema>=4.10.0 # MIT, version needed for improved errors
packaging>=21.3 # Apache-2.0,BSD-2-Clause
pyyaml>=5.4.1 # MIT (centos 9 has 5.3.1)
rich>=12.0.0 # MIT
ruamel.yaml>=0.17.21,<0.18 # MIT, next version is planned to have breaking changes
yamllint >= 1.26.3 # GPLv3
wcmatch>=8.1.2 # MIT
30 changes: 15 additions & 15 deletions requirements.txt → .config/requirements.txt
Expand Up @@ -2,13 +2,13 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --extra=docs --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras --unsafe-package=ansible-core pyproject.toml
# pip-compile --extra=docs --extra=lock --extra=test --no-annotate --output-file=.config/requirements.txt --resolver=backtracking --strip-extras --unsafe-package=ansible-core pyproject.toml
#
alabaster==0.7.12
ansible-compat==2.2.7
ansible-pygments==0.1.1
astroid==2.12.13
attrs==22.1.0
attrs==22.2.0
babel==2.11.0
black==22.12.0
bracex==2.3.post1
Expand All @@ -17,21 +17,21 @@ cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
commonmark==0.9.1
coverage==6.5.0
coverage==7.0.1
coverage-enable-subprocess==1.0
cryptography==38.0.4
dill==0.3.6
docutils==0.17.1
exceptiongroup==1.0.4
exceptiongroup==1.1.0
execnet==1.9.0
filelock==3.8.2
filelock==3.9.0
flake8==6.0.0
flake8-future-annotations==1.0.0
idna==3.4
imagesize==1.4.1
importlib-metadata==5.1.0
importlib-metadata==5.2.0
iniconfig==1.1.1
isort==5.10.1
isort==5.11.4
jinja2==3.1.2
jsonschema==4.17.3
lazy-object-proxy==1.8.0
Expand All @@ -40,34 +40,34 @@ markupsafe==2.1.1
mccabe==0.7.0
mdit-py-plugins==0.3.3
mdurl==0.1.2
more-itertools==9.0.0
mypy==0.991
mypy-extensions==0.4.3
myst-parser==0.18.1
packaging==22.0
pathspec==0.10.3
pbr==5.11.0
pipdeptree==2.3.3
platformdirs==2.6.0
platformdirs==2.6.2
pluggy==1.0.0
psutil==5.9.4
pycodestyle==2.10.0
pycparser==2.21
pyflakes==3.0.1
pygments==2.13.0
pylint==2.15.8
pyrsistent==0.19.2
pylint==2.15.9
pyrsistent==0.19.3
pytest==7.2.0
pytest-mock==3.10.0
pytest-plus==0.2
pytest-plus==0.4.0
pytest-xdist==3.1.0
pytz==2022.6
pytz==2022.7
pyyaml==6.0
requests==2.28.1
resolvelib==0.8.1
rich==12.6.0
rich==13.0.0
ruamel-yaml==0.17.21
ruamel-yaml-clib==0.2.7
setuptools==65.6.3
snowballstemmer==2.2.0
sphinx==5.3.0
sphinx-ansible-theme==0.10.1
Expand All @@ -80,7 +80,7 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-programoutput2==2.0a1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
subprocess-tee==0.4.0
subprocess-tee==0.4.1
tomli==2.0.1
tomlkit==0.11.6
typing-extensions==4.4.0
Expand Down
37 changes: 26 additions & 11 deletions .pre-commit-config.yaml
Expand Up @@ -13,6 +13,7 @@ ci:
- schemas
exclude: >
(?x)^(
.config/requirements.*|
.vscode/extensions.json|
.vscode/settings.json|
examples/broken/encoding.j2|
Expand Down Expand Up @@ -55,7 +56,7 @@ repos:
- prettier-plugin-toml
- prettier-plugin-sort-json
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.16.0
rev: v6.17.1
hooks:
- id: cspell
# entry: codespell --relative
Expand Down Expand Up @@ -107,7 +108,7 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/PyCQA/doc8
rev: v1.0.0
rev: v1.1.1
hooks:
- id: doc8
- repo: https://github.com/adrienverge/yamllint.git
Expand All @@ -126,14 +127,14 @@ repos:
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
args:
# https://github.com/pre-commit/mirrors-isort/issues/9#issuecomment-624404082
- --filter-files
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
language_version: python3
Expand All @@ -150,7 +151,7 @@ repos:
- flake8-future-annotations>=0.0.3
- repo: https://github.com/asottile/pyupgrade
# keep it after flake8
rev: v3.3.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]
Expand Down Expand Up @@ -183,7 +184,7 @@ repos:
plugins/.*
)$
- repo: https://github.com/pycqa/pylint
rev: v2.15.8
rev: v2.15.9
hooks:
- id: pylint
args:
Expand All @@ -204,20 +205,34 @@ repos:
- wcmatch
- yamllint
- repo: https://github.com/jazzband/pip-tools
rev: 6.11.0
rev: 6.12.1
hooks:
- id: pip-compile
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ansible-core
name: lock
always_run: true
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras
language: python
files: ^(requirements\.txt|pyproject\.toml)$
files: ^.config\/requirements.*$
alias: lock
stages: [manual]
language_version: "3.9" # minimal we support officially
additional_dependencies:
- pip>=22.3.1
- id: pip-compile
name: deps
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test --extra lock --strip-extras --unsafe-package ansible-core
language: python
files: ^.config\/requirements.*$
alias: deps
language_version: "3.9" # minimal we support officially
always_run: true
additional_dependencies:
- pip>=22.3.1
- id: pip-compile
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ansible-core --upgrade
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ansible-core --upgrade
language: python
files: ^(requirements\.txt|pyproject\.toml)$
always_run: true
files: ^.config\/requirements.*$
alias: up
stages: [manual]
language_version: "3.9" # minimal we support officially
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Expand Up @@ -42,7 +42,7 @@ build:
# version: "3.9"
# install:
# # On https://readthedocs.org/dashboard/ansible-lint/environmentvariables/ we
# # do have PIP_CONSTRAINTS=requirements.txt which ensures we install only
# # do have PIP_CONSTRAINTS=.config/requirements.txt which ensures we install only
# # pinned requirements that that we know to be working.
# - method: pip
# path: .
Expand Down
2 changes: 1 addition & 1 deletion cspell.config.yaml
Expand Up @@ -12,7 +12,7 @@ dictionaries:
ignorePaths:
- cspell.config.yaml
# The requirements file
- requirements.txt
- .config/requirements.txt
- docs/requirements.txt
- docs/requirements.in
# Test fixtures generated from outside
Expand Down
52 changes: 7 additions & 45 deletions pyproject.toml
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.8"
dynamic = ["version"]
dynamic = ["version", "dependencies", "optional-dependencies"]
name = "ansible-lint"
description = "Checks playbooks for practices and behavior that could potentially be improved"
readme = "README.md"
Expand Down Expand Up @@ -39,57 +39,13 @@ classifiers = [
"Topic :: Utilities",
]
keywords = ["ansible", "lint"]
dependencies = [
# Special order section for helping pip:
"will-not-work-on-windows-try-from-wsl-instead; platform_system=='Windows'",
"ansible-core>=2.12.0,<2.14.0; python_version<'3.9'", # GPLv3
"ansible-core>=2.12.0; python_version>='3.9'", # GPLv3
"ansible-compat>=2.2.7", # GPLv3
# alphabetically sorted:
"black>=22.8.0", # MIT
"filelock>=3.3.0", # The Unlicense
"jsonschema>=4.10.0", # MIT, version needed for improved errors
"packaging>=21.3", # Apache-2.0,BSD-2-Clause
"pyyaml>=5.4.1", # MIT (centos 9 has 5.3.1)
"rich>=12.0.0", # MIT
"ruamel.yaml>=0.17.21,<0.18", # MIT, next version is planned to have breaking changes
"yamllint >= 1.26.3", # GPLv3
"wcmatch>=8.1.2", # MIT

]

[project.urls]
homepage = "https://github.com/ansible/ansible-lint"
documentation = "https://ansible-lint.readthedocs.io/"
repository = "https://github.com/ansible/ansible-lint"
changelog = "https://github.com/ansible/ansible-lint/releases"

[project.optional-dependencies]
docs = [
"myst-parser >= 0.16.1",
"pipdeptree >= 2.2.1",
"sphinx >= 4.4.0",
"sphinx-ansible-theme >= 0.9.1",
"sphinx-rtd-theme >= 1.0.0, < 2.0.0", # 1.0.0 broke rendering
"sphinxcontrib-apidoc >= 0.3.0",
"sphinxcontrib-programoutput2 >= 2.0a1",
]
test = [
"coverage-enable-subprocess", # see https://github.com/nedbat/coveragepy/issues/1341#issuecomment-1228942657
"coverage[toml] >= 6.4.4",
"pytest >= 7.2.0",
"pytest-mock",
"pytest-plus >= 0.2", # for PYTEST_REQPASS
"pytest-xdist >= 2.1.0",
"psutil", # soft-dep of pytest-xdist
"black", # IDE support
"mypy", # IDE support
"pylint", # IDE support
"flake8", # IDE support
"flake8-future-annotations", # IDE support

]

[project.scripts]
ansible-lint = "ansiblelint.__main__:_run_cli_entrypoint"

Expand Down Expand Up @@ -245,6 +201,12 @@ markers = [
"formatting_fixtures: Test that regenerates and tests formatting fixtures (requires prettier on PATH)"
]

[tool.setuptools.dynamic]
optional-dependencies.docs = { file = [".config/requirements-docs.txt"] }
optional-dependencies.test = { file = [".config/requirements-test.txt"] }
optional-dependencies.lock = { file = [".config/requirements-lock.txt"] }
dependencies = { file = [".config/requirements.in"] }

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/ansiblelint/_version.py"

0 comments on commit 25c95e9

Please sign in to comment.