Skip to content

Commit

Permalink
Refactor dependency locks (#3879)
Browse files Browse the repository at this point in the history
Fixes: #3702
  • Loading branch information
ssbarnea authored Apr 20, 2023
1 parent 3867004 commit 9bc34d0
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 137 deletions.
2 changes: 2 additions & 0 deletions .config/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs-ansible[lock]>=0.1.4
pipdeptree>=2.4.0
42 changes: 42 additions & 0 deletions .config/requirements-lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# 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 --unsafe-package=ruamel-yaml-clib pyproject.toml
#
ansible-compat==3.0.2
ansible-core==2.14.4
arrow==1.2.3
attrs==23.1.0
binaryornot==0.4.4
certifi==2022.12.7
cffi==1.15.1
chardet==5.1.0
charset-normalizer==3.1.0
click==8.1.3
click-help-colors==0.9.1
cookiecutter==2.1.1
cryptography==40.0.2
enrich==1.2.7
idna==3.4
jinja2==3.1.2
jinja2-time==0.2.0
jsonschema==4.17.3
markdown-it-py==2.2.0
markupsafe==2.1.2
mdurl==0.1.2
packaging==23.1
pluggy==1.0.0
pycparser==2.21
pygments==2.15.1
pyrsistent==0.19.3
python-dateutil==2.8.2
python-slugify==8.0.1
pyyaml==6.0
requests==2.28.2
resolvelib==0.8.1
rich==13.3.4
six==1.16.0
subprocess-tee==0.4.1
text-unidecode==1.3
urllib3==1.26.15
14 changes: 14 additions & 0 deletions .config/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Do not include ansible or any package that would drag ansible in here
# We want to assure test extra provides tools to test molecule and its
# related tools/plugins but w/o ansible, which can be installed separated.
ansible-lint >= 6.12.1
ansi2html >= 1.8.0
coverage >= 7.0.3
filelock >= 3.9.0
pexpect >= 4.8.0, < 5
pytest-mock >= 3.10.0
pytest-plus >= 0.4.0
pytest-testinfra >= 7.0.0
pytest-xdist >= 3.1.0
pytest >= 7.2.0
check-jsonschema
12 changes: 12 additions & 0 deletions .config/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ansible-compat >= 2.2.0
ansible-core >= 2.12.10
click >= 8.0, < 9
click-help-colors >= 0.9
cookiecutter >= 1.7.3 # dependency issues in older versions
enrich >= 1.2.7
jsonschema >= 4.9.1
Jinja2 >= 2.11.3
packaging
pluggy >= 0.7.1, < 2.0
PyYAML >= 5.1
rich >= 9.5.1
50 changes: 20 additions & 30 deletions requirements.txt → .config/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --extra=docs --extra=lint --extra=test --no-annotate --output-file=requirements.txt --resolver=backtracking --strip-extras pyproject.toml tools/opts.txt
# pip-compile --extra=docs --extra=test --no-annotate --output-file=.config/requirements.txt --resolver=backtracking --strip-extras pyproject.toml
#
ansi2html==1.8.0
ansible-compat==3.0.2
ansible-core==2.14.4
ansible-lint==6.14.6
argparse-manpage==4.1
arrow==1.2.3
asyncio==3.4.3
attrs==23.1.0
babel==2.12.1
beautifulsoup4==4.12.1
binaryornot==0.4.4
black==23.3.0
bracex==2.3.post1
cairocffi==1.5.1
cairocffi==1.5.0
cairosvg==2.7.0
certifi==2022.12.7
cffi==1.15.1
cfgv==3.3.1
chardet==5.1.0
charset-normalizer==3.1.0
check-jsonschema==0.22.0
Expand All @@ -30,57 +27,53 @@ colorama==0.4.6
cookiecutter==2.1.1
coverage==7.2.3
cryptography==40.0.2
csscompressor==0.9.5
cssselect2==0.7.0
dacite==1.8.0
defusedxml==0.7.1
distlib==0.3.6
distro==1.8.0
enrich==1.2.7
exceptiongroup==1.1.1
execnet==1.9.0
filelock==3.12.0
flake8==6.0.0
ghp-import==2.1.0
gitdb==4.0.10
gitpython==3.1.31
griffe==0.27.1
identify==2.5.22
griffe==0.26.0
htmlmin2==0.1.13
idna==3.4
importlib-metadata==6.5.0
importlib-metadata==6.1.0
iniconfig==2.0.0
jinja2==3.1.2
jinja2-time==0.2.0
jsmin==3.0.1
jsonschema==4.17.3
markdown==3.3.7
markdown-exec==1.4.0
markdown-include==0.8.1
markdown-it-py==2.2.0
markupsafe==2.1.2
mccabe==0.7.0
mdurl==0.1.2
mergedeep==1.3.4
mkdocs==1.4.2
mkdocs-ansible==0.1.4
mkdocs-autorefs==0.4.1
mkdocs-git-revision-date-localized-plugin==1.2.0
mkdocs-material==9.1.6
mkdocs-gen-files==0.4.0
mkdocs-htmlproofer-plugin==0.11.0
mkdocs-material==9.1.5
mkdocs-material-extensions==1.1.1
mkdocs-multirepo-plugin==0.6.1
mkdocs-minify-plugin==0.6.4
mkdocs-monorepo-plugin==1.0.4
mkdocstrings==0.21.2
mkdocstrings-python==0.9.0
mypy-extensions==1.0.0
nodeenv==1.7.0
packaging==23.1
packaging==23.0
pathspec==0.11.1
pexpect==4.8.0
pillow==9.5.0
pipdeptree==2.7.0
platformdirs==3.2.0
pluggy==1.0.0
pre-commit==3.2.2
ptyprocess==0.7.0
pycodestyle==2.10.0
pycparser==2.21
pyflakes==3.0.1
pygments==2.15.1
pymdown-extensions==9.11
pygments==2.14.0
pymdown-extensions==9.10
pyrsistent==0.19.3
pytest==7.3.1
pytest-mock==3.10.0
Expand All @@ -89,7 +82,6 @@ pytest-testinfra==7.0.0
pytest-xdist==3.2.1
python-dateutil==2.8.2
python-slugify==8.0.1
pytz==2023.3
pyyaml==6.0
pyyaml-env-tag==0.1
regex==2023.3.23
Expand All @@ -99,15 +91,13 @@ rich==13.3.4
ruamel-yaml==0.17.21
ruamel-yaml-clib==0.2.7
six==1.16.0
smmap==5.0.0
soupsieve==2.4
subprocess-tee==0.4.1
text-unidecode==1.3
tinycss2==1.2.1
tomli==2.0.1
typing-extensions==4.5.0
typing-inspect==0.8.0
urllib3==1.26.15
virtualenv==20.21.0
watchdog==3.0.0
wcmatch==8.4.1
webencodings==0.5.1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ molecule/**
tools/test-schema/node_modules
site
.DS_Store
src/molecule/_version.py
27 changes: 18 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ repos:
additional_dependencies:
- prettier
- prettier-plugin-toml
- repo: https://github.com/PyCQA/doc8
rev: "v1.1.1"
hooks:
- id: doc8
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
Expand Down Expand Up @@ -57,7 +53,7 @@ repos:
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.261"
rev: "v0.0.262"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -102,10 +98,23 @@ repos:
rev: 6.13.0
hooks:
- id: pip-compile
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
files: ^(pyproject\.toml|requirements.txt|constraints\.txt)$
entry: pip-compile -q --resolver=backtracking --strip-extras --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test
files: ^(pyproject\.toml|\.config\/.*)$
- id: pip-compile
name: pip-compile-upgrade
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
files: ^(pyproject\.toml|requirements.txt|constraints\.txt)$
alias: up
entry: pip-compile -q --resolver=backtracking --strip-extras -q --upgrade --no-annotate --output-file=.config/requirements.txt pyproject.toml --extra docs --extra test
files: ^(pyproject\.toml|\.config\/.*)$
stages: [manual]
- id: pip-compile
name: lock
alias: lock
always_run: true
entry: pip-compile --upgrade --resolver=backtracking --no-annotate --output-file=.config/requirements-lock.txt pyproject.toml --strip-extras --unsafe-package ruamel-yaml-clib
files: ^.config\/requirements.*$
language: python
language_version: "3.9" # minimal we support officially
pass_filenames: false
stages: [manual]
additional_dependencies:
- pip>=22.3.1
80 changes: 13 additions & 67 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[build-system]
requires = [
"setuptools >= 61.0", # PEP-621
"setuptools_scm[toml] >= 7.0.0",
"setuptools >= 63.0.0", # required by pyproject+setuptools_scm integration
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme

]
build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.9"
dynamic = ["version"]
dynamic = ["version", "dependencies", "optional-dependencies"]
name = "molecule"
description = "Molecule aids in the development and testing of Ansible roles"
readme = "README.md"
Expand All @@ -22,7 +23,8 @@ classifiers = [
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -35,64 +37,13 @@ classifiers = [
"Topic :: Utilities",
]
keywords = ["ansible", "roles", "testing", "molecule"]
dependencies = [
"ansible-compat >= 2.2.0",
"ansible-core >= 2.12.10",
"click >= 8.0, < 9",
"click-help-colors >= 0.9",
"cookiecutter >= 1.7.3", # dependency issues in older versions
"enrich >= 1.2.7",
"jsonschema >= 4.9.1",
"Jinja2 >= 2.11.3",
"packaging",
"pluggy >= 0.7.1, < 2.0",
"PyYAML >= 5.1",
"rich >= 9.5.1",
]

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

[project.optional-dependencies]
docs = [
"argparse-manpage",
"cairosvg",
"markdown-include",
"mkdocs",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-material",
"mkdocs-material-extensions",
"mkdocs-multirepo-plugin",
"mkdocstrings[python]",
"pillow",
"pymdown-extensions",
]
lint = [
"check-jsonschema >= 0.20.0",
"flake8 >= 6.0.0",
"jsonschema >= 4.17.3",
"pre-commit >= 2.21.0",
"yamllint >= 1.28.0",
]
test = [
# Do not include ansible or any package that would drag ansible in here
# We want to assure test extra provides tools to test molecule and its
# related tools/plugins but w/o ansible, which can be installed separated.
"ansible-lint >= 6.12.1",
"ansi2html >= 1.8.0",
"coverage >= 7.0.3",
"filelock >= 3.9.0",
"pexpect >= 4.8.0, < 5",
"pytest-mock >= 3.10.0",
"pytest-plus >= 0.4.0",
"pytest-testinfra >= 7.0.0",
"pytest-xdist >= 3.1.0",
"pytest >= 7.2.0",
]

[project.scripts]
molecule = "molecule.__main__:main"

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

# skip_empty = true
[tool.doc8]
# see https://github.com/PyCQA/doc8/issues/75
ignore-path = [
".eggs",
".tox",
"requirements.txt",
"build",
"molecule.egg-info",
"src/molecule.egg-info",
]

[tool.black]
skip-string-normalization = false

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

[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/molecule/_version.py"
10 changes: 6 additions & 4 deletions src/molecule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
"""Molecule version information."""
try:
from ._version import __version__, version # type: ignore
except ImportError: # pragma: no cover
__version__ = "0.1.dev1"
version = __version__


from importlib.metadata import version

__version__ = version("molecule")
__all__ = ("__version__", "version")
Loading

0 comments on commit 9bc34d0

Please sign in to comment.