Skip to content

Commit 9bc34d0

Browse files
authored
Refactor dependency locks (#3879)
Fixes: #3702
1 parent 3867004 commit 9bc34d0

13 files changed

+153
-137
lines changed

.config/requirements-docs.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mkdocs-ansible[lock]>=0.1.4
2+
pipdeptree>=2.4.0

.config/requirements-lock.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 --unsafe-package=ruamel-yaml-clib pyproject.toml
6+
#
7+
ansible-compat==3.0.2
8+
ansible-core==2.14.4
9+
arrow==1.2.3
10+
attrs==23.1.0
11+
binaryornot==0.4.4
12+
certifi==2022.12.7
13+
cffi==1.15.1
14+
chardet==5.1.0
15+
charset-normalizer==3.1.0
16+
click==8.1.3
17+
click-help-colors==0.9.1
18+
cookiecutter==2.1.1
19+
cryptography==40.0.2
20+
enrich==1.2.7
21+
idna==3.4
22+
jinja2==3.1.2
23+
jinja2-time==0.2.0
24+
jsonschema==4.17.3
25+
markdown-it-py==2.2.0
26+
markupsafe==2.1.2
27+
mdurl==0.1.2
28+
packaging==23.1
29+
pluggy==1.0.0
30+
pycparser==2.21
31+
pygments==2.15.1
32+
pyrsistent==0.19.3
33+
python-dateutil==2.8.2
34+
python-slugify==8.0.1
35+
pyyaml==6.0
36+
requests==2.28.2
37+
resolvelib==0.8.1
38+
rich==13.3.4
39+
six==1.16.0
40+
subprocess-tee==0.4.1
41+
text-unidecode==1.3
42+
urllib3==1.26.15

.config/requirements-test.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Do not include ansible or any package that would drag ansible in here
2+
# We want to assure test extra provides tools to test molecule and its
3+
# related tools/plugins but w/o ansible, which can be installed separated.
4+
ansible-lint >= 6.12.1
5+
ansi2html >= 1.8.0
6+
coverage >= 7.0.3
7+
filelock >= 3.9.0
8+
pexpect >= 4.8.0, < 5
9+
pytest-mock >= 3.10.0
10+
pytest-plus >= 0.4.0
11+
pytest-testinfra >= 7.0.0
12+
pytest-xdist >= 3.1.0
13+
pytest >= 7.2.0
14+
check-jsonschema

.config/requirements.in

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ansible-compat >= 2.2.0
2+
ansible-core >= 2.12.10
3+
click >= 8.0, < 9
4+
click-help-colors >= 0.9
5+
cookiecutter >= 1.7.3 # dependency issues in older versions
6+
enrich >= 1.2.7
7+
jsonschema >= 4.9.1
8+
Jinja2 >= 2.11.3
9+
packaging
10+
pluggy >= 0.7.1, < 2.0
11+
PyYAML >= 5.1
12+
rich >= 9.5.1

requirements.txt .config/requirements.txt

+20-30
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
5-
# pip-compile --extra=docs --extra=lint --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras pyproject.toml tools/opts.txt
5+
# pip-compile --extra=docs --extra=test --no-annotate --output-file=.config/requirements.txt --resolver=backtracking --strip-extras pyproject.toml
66
#
77
ansi2html==1.8.0
88
ansible-compat==3.0.2
99
ansible-core==2.14.4
1010
ansible-lint==6.14.6
11-
argparse-manpage==4.1
1211
arrow==1.2.3
13-
asyncio==3.4.3
1412
attrs==23.1.0
15-
babel==2.12.1
13+
beautifulsoup4==4.12.1
1614
binaryornot==0.4.4
1715
black==23.3.0
1816
bracex==2.3.post1
19-
cairocffi==1.5.1
17+
cairocffi==1.5.0
2018
cairosvg==2.7.0
2119
certifi==2022.12.7
2220
cffi==1.15.1
23-
cfgv==3.3.1
2421
chardet==5.1.0
2522
charset-normalizer==3.1.0
2623
check-jsonschema==0.22.0
@@ -30,57 +27,53 @@ colorama==0.4.6
3027
cookiecutter==2.1.1
3128
coverage==7.2.3
3229
cryptography==40.0.2
30+
csscompressor==0.9.5
3331
cssselect2==0.7.0
34-
dacite==1.8.0
3532
defusedxml==0.7.1
36-
distlib==0.3.6
37-
distro==1.8.0
3833
enrich==1.2.7
3934
exceptiongroup==1.1.1
4035
execnet==1.9.0
4136
filelock==3.12.0
42-
flake8==6.0.0
4337
ghp-import==2.1.0
44-
gitdb==4.0.10
45-
gitpython==3.1.31
46-
griffe==0.27.1
47-
identify==2.5.22
38+
griffe==0.26.0
39+
htmlmin2==0.1.13
4840
idna==3.4
49-
importlib-metadata==6.5.0
41+
importlib-metadata==6.1.0
5042
iniconfig==2.0.0
5143
jinja2==3.1.2
5244
jinja2-time==0.2.0
45+
jsmin==3.0.1
5346
jsonschema==4.17.3
5447
markdown==3.3.7
48+
markdown-exec==1.4.0
5549
markdown-include==0.8.1
5650
markdown-it-py==2.2.0
5751
markupsafe==2.1.2
58-
mccabe==0.7.0
5952
mdurl==0.1.2
6053
mergedeep==1.3.4
6154
mkdocs==1.4.2
55+
mkdocs-ansible==0.1.4
6256
mkdocs-autorefs==0.4.1
63-
mkdocs-git-revision-date-localized-plugin==1.2.0
64-
mkdocs-material==9.1.6
57+
mkdocs-gen-files==0.4.0
58+
mkdocs-htmlproofer-plugin==0.11.0
59+
mkdocs-material==9.1.5
6560
mkdocs-material-extensions==1.1.1
66-
mkdocs-multirepo-plugin==0.6.1
61+
mkdocs-minify-plugin==0.6.4
62+
mkdocs-monorepo-plugin==1.0.4
6763
mkdocstrings==0.21.2
6864
mkdocstrings-python==0.9.0
6965
mypy-extensions==1.0.0
70-
nodeenv==1.7.0
71-
packaging==23.1
66+
packaging==23.0
7267
pathspec==0.11.1
7368
pexpect==4.8.0
7469
pillow==9.5.0
70+
pipdeptree==2.7.0
7571
platformdirs==3.2.0
7672
pluggy==1.0.0
77-
pre-commit==3.2.2
7873
ptyprocess==0.7.0
79-
pycodestyle==2.10.0
8074
pycparser==2.21
81-
pyflakes==3.0.1
82-
pygments==2.15.1
83-
pymdown-extensions==9.11
75+
pygments==2.14.0
76+
pymdown-extensions==9.10
8477
pyrsistent==0.19.3
8578
pytest==7.3.1
8679
pytest-mock==3.10.0
@@ -89,7 +82,6 @@ pytest-testinfra==7.0.0
8982
pytest-xdist==3.2.1
9083
python-dateutil==2.8.2
9184
python-slugify==8.0.1
92-
pytz==2023.3
9385
pyyaml==6.0
9486
pyyaml-env-tag==0.1
9587
regex==2023.3.23
@@ -99,15 +91,13 @@ rich==13.3.4
9991
ruamel-yaml==0.17.21
10092
ruamel-yaml-clib==0.2.7
10193
six==1.16.0
102-
smmap==5.0.0
94+
soupsieve==2.4
10395
subprocess-tee==0.4.1
10496
text-unidecode==1.3
10597
tinycss2==1.2.1
10698
tomli==2.0.1
10799
typing-extensions==4.5.0
108-
typing-inspect==0.8.0
109100
urllib3==1.26.15
110-
virtualenv==20.21.0
111101
watchdog==3.0.0
112102
wcmatch==8.4.1
113103
webencodings==0.5.1

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ molecule/**
2626
tools/test-schema/node_modules
2727
site
2828
.DS_Store
29+
src/molecule/_version.py

.pre-commit-config.yaml

+18-9
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ repos:
2020
additional_dependencies:
2121
- prettier
2222
- prettier-plugin-toml
23-
- repo: https://github.com/PyCQA/doc8
24-
rev: "v1.1.1"
25-
hooks:
26-
- id: doc8
2723
- repo: https://github.com/codespell-project/codespell
2824
rev: v2.2.4
2925
hooks:
@@ -57,7 +53,7 @@ repos:
5753
types: [file, yaml]
5854
entry: yamllint --strict
5955
- repo: https://github.com/charliermarsh/ruff-pre-commit
60-
rev: "v0.0.261"
56+
rev: "v0.0.262"
6157
hooks:
6258
- id: ruff
6359
args: [--fix, --exit-non-zero-on-fix]
@@ -102,10 +98,23 @@ repos:
10298
rev: 6.13.0
10399
hooks:
104100
- id: pip-compile
105-
entry: pip-compile -q --resolver=backtracking --strip-extras --no-annotate --output-file=requirements.txt tools/opts.txt pyproject.toml --extra docs --extra test --extra lint
106-
files: ^(pyproject\.toml|requirements.txt|constraints\.txt)$
101+
entry: pip-compile -q --resolver=backtracking --strip-extras --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test
102+
files: ^(pyproject\.toml|\.config\/.*)$
107103
- id: pip-compile
108104
name: pip-compile-upgrade
109-
entry: pip-compile -q --resolver=backtracking --strip-extras -q --upgrade --no-annotate --output-file=requirements.txt tools/opts.txt pyproject.toml --extra docs --extra test --extra lint
110-
files: ^(pyproject\.toml|requirements.txt|constraints\.txt)$
105+
alias: up
106+
entry: pip-compile -q --resolver=backtracking --strip-extras -q --upgrade --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test
107+
files: ^(pyproject\.toml|\.config\/.*)$
111108
stages: [manual]
109+
- id: pip-compile
110+
name: lock
111+
alias: lock
112+
always_run: true
113+
entry: pip-compile --upgrade --resolver=backtracking --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras --unsafe-package ruamel-yaml-clib
114+
files: ^.config\/requirements.*$
115+
language: python
116+
language_version: "3.9" # minimal we support officially
117+
pass_filenames: false
118+
stages: [manual]
119+
additional_dependencies:
120+
- pip>=22.3.1

pyproject.toml

+13-67
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 61.0", # PEP-621
4-
"setuptools_scm[toml] >= 7.0.0",
3+
"setuptools >= 63.0.0", # required by pyproject+setuptools_scm integration
4+
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme
5+
56
]
67
build-backend = "setuptools.build_meta"
78

89
[project]
910
# https://peps.python.org/pep-0621/#readme
1011
requires-python = ">=3.9"
11-
dynamic = ["version"]
12+
dynamic = ["version", "dependencies", "optional-dependencies"]
1213
name = "molecule"
1314
description = "Molecule aids in the development and testing of Ansible roles"
1415
readme = "README.md"
@@ -22,7 +23,8 @@ classifiers = [
2223
"Intended Audience :: Information Technology",
2324
"Intended Audience :: System Administrators",
2425
"License :: OSI Approved :: MIT License",
25-
"Operating System :: OS Independent",
26+
"Operating System :: MacOS",
27+
"Operating System :: POSIX",
2628
"Programming Language :: Python :: 3",
2729
"Programming Language :: Python :: 3.9",
2830
"Programming Language :: Python :: 3.10",
@@ -35,64 +37,13 @@ classifiers = [
3537
"Topic :: Utilities",
3638
]
3739
keywords = ["ansible", "roles", "testing", "molecule"]
38-
dependencies = [
39-
"ansible-compat >= 2.2.0",
40-
"ansible-core >= 2.12.10",
41-
"click >= 8.0, < 9",
42-
"click-help-colors >= 0.9",
43-
"cookiecutter >= 1.7.3", # dependency issues in older versions
44-
"enrich >= 1.2.7",
45-
"jsonschema >= 4.9.1",
46-
"Jinja2 >= 2.11.3",
47-
"packaging",
48-
"pluggy >= 0.7.1, < 2.0",
49-
"PyYAML >= 5.1",
50-
"rich >= 9.5.1",
51-
]
5240

5341
[project.urls]
5442
homepage = "https://github.com/ansible-community/molecule"
5543
documentation = "https://molecule.readthedocs.io/"
5644
repository = "https://github.com/ansible-community/molecule"
5745
changelog = "https://github.com/ansible-community/molecule/releases"
5846

59-
[project.optional-dependencies]
60-
docs = [
61-
"argparse-manpage",
62-
"cairosvg",
63-
"markdown-include",
64-
"mkdocs",
65-
"mkdocs-git-revision-date-localized-plugin",
66-
"mkdocs-material",
67-
"mkdocs-material-extensions",
68-
"mkdocs-multirepo-plugin",
69-
"mkdocstrings[python]",
70-
"pillow",
71-
"pymdown-extensions",
72-
]
73-
lint = [
74-
"check-jsonschema >= 0.20.0",
75-
"flake8 >= 6.0.0",
76-
"jsonschema >= 4.17.3",
77-
"pre-commit >= 2.21.0",
78-
"yamllint >= 1.28.0",
79-
]
80-
test = [
81-
# Do not include ansible or any package that would drag ansible in here
82-
# We want to assure test extra provides tools to test molecule and its
83-
# related tools/plugins but w/o ansible, which can be installed separated.
84-
"ansible-lint >= 6.12.1",
85-
"ansi2html >= 1.8.0",
86-
"coverage >= 7.0.3",
87-
"filelock >= 3.9.0",
88-
"pexpect >= 4.8.0, < 5",
89-
"pytest-mock >= 3.10.0",
90-
"pytest-plus >= 0.4.0",
91-
"pytest-testinfra >= 7.0.0",
92-
"pytest-xdist >= 3.1.0",
93-
"pytest >= 7.2.0",
94-
]
95-
9647
[project.scripts]
9748
molecule = "molecule.__main__:main"
9849

@@ -117,18 +68,6 @@ omit = ["test/*"]
11768
fail_under = 88
11869
skip_covered = true
11970

120-
# skip_empty = true
121-
[tool.doc8]
122-
# see https://github.com/PyCQA/doc8/issues/75
123-
ignore-path = [
124-
".eggs",
125-
".tox",
126-
"requirements.txt",
127-
"build",
128-
"molecule.egg-info",
129-
"src/molecule.egg-info",
130-
]
131-
13271
[tool.black]
13372
skip-string-normalization = false
13473

@@ -264,5 +203,12 @@ parametrize-values-type = "tuple"
264203
[tool.ruff.isort]
265204
known-first-party = ["molecule"]
266205

206+
[tool.setuptools.dynamic]
207+
optional-dependencies.docs = { file = [".config/requirements-docs.txt"] }
208+
optional-dependencies.test = { file = [".config/requirements-test.txt"] }
209+
optional-dependencies.lock = { file = [".config/requirements-lock.txt"] }
210+
dependencies = { file = [".config/requirements.in"] }
211+
267212
[tool.setuptools_scm]
268213
local_scheme = "no-local-version"
214+
write_to = "src/molecule/_version.py"

src/molecule/__init__.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2020
# DEALINGS IN THE SOFTWARE.
2121
"""Molecule version information."""
22+
try:
23+
from ._version import __version__, version # type: ignore
24+
except ImportError: # pragma: no cover
25+
__version__ = "0.1.dev1"
26+
version = __version__
2227

23-
24-
from importlib.metadata import version
25-
26-
__version__ = version("molecule")
28+
__all__ = ("__version__", "version")

0 commit comments

Comments
 (0)