Skip to content

Commit 25c95e9

Browse files
authored
Use standalone extra files (#2849)
1 parent a0b06c2 commit 25c95e9

File tree

12 files changed

+263
-228
lines changed

12 files changed

+263
-228
lines changed

.config/requirements-docs.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
myst-parser >= 0.16.1
2+
pipdeptree >= 2.2.1
3+
sphinx >= 4.4.0
4+
sphinx-ansible-theme >= 0.9.1
5+
sphinx-rtd-theme >= 1.0.0, < 2.0.0 # 1.0.0 broke rendering
6+
sphinxcontrib-apidoc >= 0.3.0
7+
sphinxcontrib-programoutput2 >= 2.0a1
8+

.config/requirements-lock.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --no-annotate --output-file=.config/requirements-lock.txt --resolver=backtracking --strip-extras pyproject.toml
6+
#
7+
ansible-compat==2.2.7
8+
ansible-core==2.14.1 ; python_version >= "3.9"
9+
attrs==22.2.0
10+
black==22.12.0
11+
bracex==2.3.post1
12+
cffi==1.15.1
13+
click==8.1.3
14+
commonmark==0.9.1
15+
cryptography==38.0.4
16+
filelock==3.9.0
17+
jinja2==3.1.2
18+
jsonschema==4.17.3
19+
markupsafe==2.1.1
20+
mypy-extensions==0.4.3
21+
packaging==22.0
22+
pathspec==0.10.3
23+
platformdirs==2.6.2
24+
pycparser==2.21
25+
pygments==2.13.0
26+
pyrsistent==0.19.3
27+
pyyaml==6.0
28+
resolvelib==0.8.1
29+
rich==13.0.0
30+
ruamel-yaml==0.17.21
31+
ruamel-yaml-clib==0.2.7
32+
subprocess-tee==0.4.1
33+
tomli==2.0.1
34+
typing-extensions==4.4.0
35+
wcmatch==8.4.1
36+
yamllint==1.28.0
37+
38+
# The following packages are considered to be unsafe in a requirements file:
39+
# setuptools

.config/requirements-test.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
coverage-enable-subprocess # see https://github.com/nedbat/coveragepy/issues/1341#issuecomment-1228942657
2+
coverage[toml] >= 6.4.4
3+
pytest >= 7.2.0
4+
pytest-mock
5+
pytest-plus >= 0.2 # for PYTEST_REQPASS
6+
pytest-xdist >= 2.1.0
7+
psutil # soft-dep of pytest-xdist
8+
black # IDE support
9+
mypy # IDE support
10+
pylint # IDE support
11+
flake8 # IDE support
12+
flake8-future-annotations # IDE support

.config/requirements.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Special order section for helping pip:
2+
will-not-work-on-windows-try-from-wsl-instead; platform_system=='Windows'
3+
ansible-core>=2.12.0,<2.14.0; python_version<'3.9' # GPLv3
4+
ansible-core>=2.12.0; python_version>='3.9' # GPLv3
5+
ansible-compat>=2.2.7 # GPLv3
6+
# alphabetically sorted:
7+
black>=22.8.0 # MIT
8+
filelock>=3.3.0 # The Unlicense
9+
jsonschema>=4.10.0 # MIT, version needed for improved errors
10+
packaging>=21.3 # Apache-2.0,BSD-2-Clause
11+
pyyaml>=5.4.1 # MIT (centos 9 has 5.3.1)
12+
rich>=12.0.0 # MIT
13+
ruamel.yaml>=0.17.21,<0.18 # MIT, next version is planned to have breaking changes
14+
yamllint >= 1.26.3 # GPLv3
15+
wcmatch>=8.1.2 # MIT
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
5-
# pip-compile --extra=docs --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras --unsafe-package=ansible-core pyproject.toml
5+
# 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
66
#
77
alabaster==0.7.12
88
ansible-compat==2.2.7
99
ansible-pygments==0.1.1
1010
astroid==2.12.13
11-
attrs==22.1.0
11+
attrs==22.2.0
1212
babel==2.11.0
1313
black==22.12.0
1414
bracex==2.3.post1
@@ -17,21 +17,21 @@ cffi==1.15.1
1717
charset-normalizer==2.1.1
1818
click==8.1.3
1919
commonmark==0.9.1
20-
coverage==6.5.0
20+
coverage==7.0.1
2121
coverage-enable-subprocess==1.0
2222
cryptography==38.0.4
2323
dill==0.3.6
2424
docutils==0.17.1
25-
exceptiongroup==1.0.4
25+
exceptiongroup==1.1.0
2626
execnet==1.9.0
27-
filelock==3.8.2
27+
filelock==3.9.0
2828
flake8==6.0.0
2929
flake8-future-annotations==1.0.0
3030
idna==3.4
3131
imagesize==1.4.1
32-
importlib-metadata==5.1.0
32+
importlib-metadata==5.2.0
3333
iniconfig==1.1.1
34-
isort==5.10.1
34+
isort==5.11.4
3535
jinja2==3.1.2
3636
jsonschema==4.17.3
3737
lazy-object-proxy==1.8.0
@@ -40,34 +40,34 @@ markupsafe==2.1.1
4040
mccabe==0.7.0
4141
mdit-py-plugins==0.3.3
4242
mdurl==0.1.2
43-
more-itertools==9.0.0
4443
mypy==0.991
4544
mypy-extensions==0.4.3
4645
myst-parser==0.18.1
4746
packaging==22.0
4847
pathspec==0.10.3
4948
pbr==5.11.0
5049
pipdeptree==2.3.3
51-
platformdirs==2.6.0
50+
platformdirs==2.6.2
5251
pluggy==1.0.0
5352
psutil==5.9.4
5453
pycodestyle==2.10.0
5554
pycparser==2.21
5655
pyflakes==3.0.1
5756
pygments==2.13.0
58-
pylint==2.15.8
59-
pyrsistent==0.19.2
57+
pylint==2.15.9
58+
pyrsistent==0.19.3
6059
pytest==7.2.0
6160
pytest-mock==3.10.0
62-
pytest-plus==0.2
61+
pytest-plus==0.4.0
6362
pytest-xdist==3.1.0
64-
pytz==2022.6
63+
pytz==2022.7
6564
pyyaml==6.0
6665
requests==2.28.1
6766
resolvelib==0.8.1
68-
rich==12.6.0
67+
rich==13.0.0
6968
ruamel-yaml==0.17.21
7069
ruamel-yaml-clib==0.2.7
70+
setuptools==65.6.3
7171
snowballstemmer==2.2.0
7272
sphinx==5.3.0
7373
sphinx-ansible-theme==0.10.1
@@ -80,7 +80,7 @@ sphinxcontrib-jsmath==1.0.1
8080
sphinxcontrib-programoutput2==2.0a1
8181
sphinxcontrib-qthelp==1.0.3
8282
sphinxcontrib-serializinghtml==1.1.5
83-
subprocess-tee==0.4.0
83+
subprocess-tee==0.4.1
8484
tomli==2.0.1
8585
tomlkit==0.11.6
8686
typing-extensions==4.4.0

.pre-commit-config.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ci:
1313
- schemas
1414
exclude: >
1515
(?x)^(
16+
.config/requirements.*|
1617
.vscode/extensions.json|
1718
.vscode/settings.json|
1819
examples/broken/encoding.j2|
@@ -55,7 +56,7 @@ repos:
5556
- prettier-plugin-toml
5657
- prettier-plugin-sort-json
5758
- repo: https://github.com/streetsidesoftware/cspell-cli
58-
rev: v6.16.0
59+
rev: v6.17.1
5960
hooks:
6061
- id: cspell
6162
# entry: codespell --relative
@@ -107,7 +108,7 @@ repos:
107108
additional_dependencies:
108109
- tomli
109110
- repo: https://github.com/PyCQA/doc8
110-
rev: v1.0.0
111+
rev: v1.1.1
111112
hooks:
112113
- id: doc8
113114
- repo: https://github.com/adrienverge/yamllint.git
@@ -126,14 +127,14 @@ repos:
126127
types: [file, yaml]
127128
entry: yamllint --strict
128129
- repo: https://github.com/PyCQA/isort
129-
rev: 5.10.1
130+
rev: 5.11.4
130131
hooks:
131132
- id: isort
132133
args:
133134
# https://github.com/pre-commit/mirrors-isort/issues/9#issuecomment-624404082
134135
- --filter-files
135136
- repo: https://github.com/psf/black
136-
rev: 22.10.0
137+
rev: 22.12.0
137138
hooks:
138139
- id: black
139140
language_version: python3
@@ -150,7 +151,7 @@ repos:
150151
- flake8-future-annotations>=0.0.3
151152
- repo: https://github.com/asottile/pyupgrade
152153
# keep it after flake8
153-
rev: v3.3.0
154+
rev: v3.3.1
154155
hooks:
155156
- id: pyupgrade
156157
args: ["--py38-plus"]
@@ -183,7 +184,7 @@ repos:
183184
plugins/.*
184185
)$
185186
- repo: https://github.com/pycqa/pylint
186-
rev: v2.15.8
187+
rev: v2.15.9
187188
hooks:
188189
- id: pylint
189190
args:
@@ -204,20 +205,34 @@ repos:
204205
- wcmatch
205206
- yamllint
206207
- repo: https://github.com/jazzband/pip-tools
207-
rev: 6.11.0
208+
rev: 6.12.1
208209
hooks:
209210
- id: pip-compile
210-
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=requirements.txt pyproject.toml --extra docs --extra test --strip-extras --unsafe-package ansible-core
211+
name: lock
212+
always_run: true
213+
entry: pip-compile --resolver=backtracking -q --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras
211214
language: python
212-
files: ^(requirements\.txt|pyproject\.toml)$
215+
files: ^.config\/requirements.*$
216+
alias: lock
217+
stages: [manual]
218+
language_version: "3.9" # minimal we support officially
219+
additional_dependencies:
220+
- pip>=22.3.1
221+
- id: pip-compile
222+
name: deps
223+
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
224+
language: python
225+
files: ^.config\/requirements.*$
213226
alias: deps
214227
language_version: "3.9" # minimal we support officially
228+
always_run: true
215229
additional_dependencies:
216230
- pip>=22.3.1
217231
- id: pip-compile
218-
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
232+
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
219233
language: python
220-
files: ^(requirements\.txt|pyproject\.toml)$
234+
always_run: true
235+
files: ^.config\/requirements.*$
221236
alias: up
222237
stages: [manual]
223238
language_version: "3.9" # minimal we support officially

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ build:
4242
# version: "3.9"
4343
# install:
4444
# # On https://readthedocs.org/dashboard/ansible-lint/environmentvariables/ we
45-
# # do have PIP_CONSTRAINTS=requirements.txt which ensures we install only
45+
# # do have PIP_CONSTRAINTS=.config/requirements.txt which ensures we install only
4646
# # pinned requirements that that we know to be working.
4747
# - method: pip
4848
# path: .

cspell.config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dictionaries:
1212
ignorePaths:
1313
- cspell.config.yaml
1414
# The requirements file
15-
- requirements.txt
15+
- .config/requirements.txt
1616
- docs/requirements.txt
1717
- docs/requirements.in
1818
# Test fixtures generated from outside

pyproject.toml

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
# https://peps.python.org/pep-0621/#readme
1111
requires-python = ">=3.8"
12-
dynamic = ["version"]
12+
dynamic = ["version", "dependencies", "optional-dependencies"]
1313
name = "ansible-lint"
1414
description = "Checks playbooks for practices and behavior that could potentially be improved"
1515
readme = "README.md"
@@ -39,57 +39,13 @@ classifiers = [
3939
"Topic :: Utilities",
4040
]
4141
keywords = ["ansible", "lint"]
42-
dependencies = [
43-
# Special order section for helping pip:
44-
"will-not-work-on-windows-try-from-wsl-instead; platform_system=='Windows'",
45-
"ansible-core>=2.12.0,<2.14.0; python_version<'3.9'", # GPLv3
46-
"ansible-core>=2.12.0; python_version>='3.9'", # GPLv3
47-
"ansible-compat>=2.2.7", # GPLv3
48-
# alphabetically sorted:
49-
"black>=22.8.0", # MIT
50-
"filelock>=3.3.0", # The Unlicense
51-
"jsonschema>=4.10.0", # MIT, version needed for improved errors
52-
"packaging>=21.3", # Apache-2.0,BSD-2-Clause
53-
"pyyaml>=5.4.1", # MIT (centos 9 has 5.3.1)
54-
"rich>=12.0.0", # MIT
55-
"ruamel.yaml>=0.17.21,<0.18", # MIT, next version is planned to have breaking changes
56-
"yamllint >= 1.26.3", # GPLv3
57-
"wcmatch>=8.1.2", # MIT
58-
59-
]
6042

6143
[project.urls]
6244
homepage = "https://github.com/ansible/ansible-lint"
6345
documentation = "https://ansible-lint.readthedocs.io/"
6446
repository = "https://github.com/ansible/ansible-lint"
6547
changelog = "https://github.com/ansible/ansible-lint/releases"
6648

67-
[project.optional-dependencies]
68-
docs = [
69-
"myst-parser >= 0.16.1",
70-
"pipdeptree >= 2.2.1",
71-
"sphinx >= 4.4.0",
72-
"sphinx-ansible-theme >= 0.9.1",
73-
"sphinx-rtd-theme >= 1.0.0, < 2.0.0", # 1.0.0 broke rendering
74-
"sphinxcontrib-apidoc >= 0.3.0",
75-
"sphinxcontrib-programoutput2 >= 2.0a1",
76-
]
77-
test = [
78-
"coverage-enable-subprocess", # see https://github.com/nedbat/coveragepy/issues/1341#issuecomment-1228942657
79-
"coverage[toml] >= 6.4.4",
80-
"pytest >= 7.2.0",
81-
"pytest-mock",
82-
"pytest-plus >= 0.2", # for PYTEST_REQPASS
83-
"pytest-xdist >= 2.1.0",
84-
"psutil", # soft-dep of pytest-xdist
85-
"black", # IDE support
86-
"mypy", # IDE support
87-
"pylint", # IDE support
88-
"flake8", # IDE support
89-
"flake8-future-annotations", # IDE support
90-
91-
]
92-
9349
[project.scripts]
9450
ansible-lint = "ansiblelint.__main__:_run_cli_entrypoint"
9551

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

204+
[tool.setuptools.dynamic]
205+
optional-dependencies.docs = { file = [".config/requirements-docs.txt"] }
206+
optional-dependencies.test = { file = [".config/requirements-test.txt"] }
207+
optional-dependencies.lock = { file = [".config/requirements-lock.txt"] }
208+
dependencies = { file = [".config/requirements.in"] }
209+
248210
[tool.setuptools_scm]
249211
local_scheme = "no-local-version"
250212
write_to = "src/ansiblelint/_version.py"

0 commit comments

Comments
 (0)