From 3cdf11523876039ee1d41839f84529136e2f1545 Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:59:06 -0500 Subject: [PATCH 1/6] Add tox to test optional dependencies --- .config/requirements-test.in | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/requirements-test.in b/.config/requirements-test.in index 996b300864..87b4dc0865 100644 --- a/.config/requirements-test.in +++ b/.config/requirements-test.in @@ -13,5 +13,6 @@ pytest-plus >= 0.6 # for PYTEST_REQPASS pytest-xdist >= 2.1.0 ruamel.yaml>=0.17.31 ruamel-yaml-clib # needed for mypy +tox >= 4.0.0 types-jsonschema # IDE support types-pyyaml # IDE support From def4e8ec947eb917d30f527901ca9042cc01bac2 Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:01:18 -0500 Subject: [PATCH 2/6] Enhance contributing docs for pip installs / tox --- docs/contributing.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index 3e8e41d50f..fc7cd15cb9 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -8,8 +8,13 @@ After [creating your fork on GitHub], you can do: ```shell-session $ git clone --recursive git@github.com:your-name/ansible-lint $ cd ansible-lint +$ # Recommended: Initialize and activate a Python virtual environment +$ pip install --upgrade pip +$ pip install -e .[test] # Install testing dependencies +$ tox run -e lint,pkg,docs,py # Ensure subset of tox tests work in clean checkout $ git checkout -b your-branch-name # DO SOME CODING HERE +$ tox run -e lint,pkg,docs,py # Ensure subset of tox tests work with your changes $ git add your new files $ git commit -v $ git push origin your-branch-name @@ -31,8 +36,6 @@ released. Automated tests will be run against all PRs, to run checks locally before pushing commits, just use [tox](https://tox.wiki/en/latest/). -% DO-NOT-REMOVE-deps-snippet-PLACEHOLDER - ## Talk to us Use Github [discussions] forum or for a live chat experience try From a2fa079fd3db84fe796ff2dad6dad2a2759e784f Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:06:43 -0500 Subject: [PATCH 3/6] Update gitignore for venv paths --- .gitignore | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6d650766bd..ccfa853eae 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ __pycache__ # Packages .Python -env/ build/ develop-eggs/ dist/ @@ -20,7 +19,6 @@ parts/ pip-wheel-metadata sdist/ var/ -venv/ *.egg-info/ .installed.cfg *.egg @@ -37,6 +35,12 @@ pip-log.txt # pyenv .python-version +# Environments +.env +.venv +env/ +venv/ + # Coverage artifacts .coverage* coverage*.xml From 6acf06656a210f09fa44c1f5bff9b4dd2d1332b5 Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:09:34 -0500 Subject: [PATCH 4/6] Clean-up tox list output --- tox.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 96497527a7..bbc0dba800 100644 --- a/tox.ini +++ b/tox.ini @@ -20,9 +20,9 @@ requires = [testenv] description = - Run the tests under {basepython} and - devel: ansible devel branch - pre: Enables --pre when installing dependencies, testing prereleases + Run the tests under {basepython} + devel: and ansible devel branch + pre: and enable --pre when installing dependencies, testing prereleases deps = devel: ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+ devel: ansible-compat @ git+https://github.com/ansible/ansible-compat.git # GPLv3+ @@ -172,7 +172,7 @@ description = Rebuild and test JSON Schemas deps = check-jsonschema>=0.26.3 setenv = - # without his upgrade would likely not do anything + # without this upgrade would likely not do anything PIP_CONSTRAINT = /dev/null skip_install = true changedir = test/schemas From 682ad98bca66a7c259a57e4eb728b1f2cb735cae Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:15:53 -0500 Subject: [PATCH 5/6] Clean-up git init warning in test-hook.sh --- tools/test-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test-hook.sh b/tools/test-hook.sh index 85d2d2786d..d83918ef8e 100755 --- a/tools/test-hook.sh +++ b/tools/test-hook.sh @@ -12,7 +12,7 @@ set -euo pipefail rm -rf .tox/x mkdir -p .tox/x cd .tox/x -git init +git init --initial-branch=main # we add a file to the repo to avoid error due to no file to to lint touch foo.yml git add foo.yml From 9c5837f2f1ac983e1ab16fa1859426237cbaab4e Mon Sep 17 00:00:00 2001 From: H Dub <14808878+hdub-tech@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:48:00 -0500 Subject: [PATCH 6/6] Updated json schemas --- .config/constraints.txt | 6 ++++++ src/ansiblelint/schemas/__store__.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/constraints.txt b/.config/constraints.txt index 3c4ba9ed92..1cb1e4d5e8 100644 --- a/.config/constraints.txt +++ b/.config/constraints.txt @@ -13,10 +13,12 @@ beautifulsoup4==4.12.3 black==24.4.2 boolean-py==4.0 bracex==2.4 +cachetools==5.3.3 cairocffi==1.7.0 cairosvg==2.7.1 certifi==2024.6.2 cffi==1.16.0 +chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 @@ -27,6 +29,7 @@ csscompressor==0.9.5 cssselect2==0.7.0 defusedxml==0.7.1 dill==0.3.8 +distlib==0.3.8 dnspython==2.6.1 exceptiongroup==1.2.1 execnet==2.1.1 @@ -82,6 +85,7 @@ pycparser==2.22 pygments==2.18.0 pylint==3.2.2 pymdown-extensions==10.8.1 +pyproject-api==1.6.1 pytest==8.2.1 pytest-mock==3.14.0 pytest-plus==0.7.0 @@ -104,10 +108,12 @@ text-unidecode==1.3 tinycss2==1.3.0 tomli==2.0.1 tomlkit==0.12.5 +tox==4.15.0 types-jsonschema==4.22.0.20240501 types-pyyaml==6.0.12.20240311 typing-extensions==4.12.1 urllib3==2.2.1 +virtualenv==20.26.2 watchdog==4.0.1 webencodings==0.5.1 yamllint==1.35.1 diff --git a/src/ansiblelint/schemas/__store__.json b/src/ansiblelint/schemas/__store__.json index 414085dc6d..d66d6759ce 100644 --- a/src/ansiblelint/schemas/__store__.json +++ b/src/ansiblelint/schemas/__store__.json @@ -1,6 +1,6 @@ { "ansible-lint-config": { - "etag": "616457d973f4b221d85910086ce1fab520d8a363b1e1e62a62e4d8b57a824976", + "etag": "a0bb8004fad70bab34fad94a45b2698125127142ec6b2c8900976aa2bd96a86c", "url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json" }, "ansible-navigator-config": {