Skip to content

Commit aa34420

Browse files
authored
Update Contributing docs and add tox as test optional-dependency (#4209)
1 parent 2d9f1ed commit aa34420

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

.config/constraints.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ beautifulsoup4==4.12.3
1313
black==24.4.2
1414
boolean-py==4.0
1515
bracex==2.4
16+
cachetools==5.3.3
1617
cairocffi==1.7.0
1718
cairosvg==2.7.1
1819
certifi==2024.6.2
1920
cffi==1.16.0
21+
chardet==5.2.0
2022
charset-normalizer==3.3.2
2123
click==8.1.7
2224
colorama==0.4.6
@@ -27,6 +29,7 @@ csscompressor==0.9.5
2729
cssselect2==0.7.0
2830
defusedxml==0.7.1
2931
dill==0.3.8
32+
distlib==0.3.8
3033
dnspython==2.6.1
3134
exceptiongroup==1.2.1
3235
execnet==2.1.1
@@ -82,6 +85,7 @@ pycparser==2.22
8285
pygments==2.18.0
8386
pylint==3.2.2
8487
pymdown-extensions==10.8.1
88+
pyproject-api==1.6.1
8589
pytest==8.2.1
8690
pytest-mock==3.14.0
8791
pytest-plus==0.7.0
@@ -104,10 +108,12 @@ text-unidecode==1.3
104108
tinycss2==1.3.0
105109
tomli==2.0.1
106110
tomlkit==0.12.5
111+
tox==4.15.0
107112
types-jsonschema==4.22.0.20240501
108113
types-pyyaml==6.0.12.20240311
109114
typing-extensions==4.12.1
110115
urllib3==2.2.1
116+
virtualenv==20.26.2
111117
watchdog==4.0.1
112118
webencodings==0.5.1
113119
yamllint==1.35.1

.config/requirements-test.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ pytest-plus >= 0.6 # for PYTEST_REQPASS
1313
pytest-xdist >= 2.1.0
1414
ruamel.yaml>=0.17.31
1515
ruamel-yaml-clib # needed for mypy
16+
tox >= 4.0.0
1617
types-jsonschema # IDE support
1718
types-pyyaml # IDE support

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ __pycache__
88

99
# Packages
1010
.Python
11-
env/
1211
build/
1312
develop-eggs/
1413
dist/
@@ -20,7 +19,6 @@ parts/
2019
pip-wheel-metadata
2120
sdist/
2221
var/
23-
venv/
2422
*.egg-info/
2523
.installed.cfg
2624
*.egg
@@ -37,6 +35,12 @@ pip-log.txt
3735
# pyenv
3836
.python-version
3937

38+
# Environments
39+
.env
40+
.venv
41+
env/
42+
venv/
43+
4044
# Coverage artifacts
4145
.coverage*
4246
coverage*.xml

docs/contributing.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ After [creating your fork on GitHub], you can do:
88
```shell-session
99
$ git clone --recursive [email protected]:your-name/ansible-lint
1010
$ cd ansible-lint
11+
$ # Recommended: Initialize and activate a Python virtual environment
12+
$ pip install --upgrade pip
13+
$ pip install -e .[test] # Install testing dependencies
14+
$ tox run -e lint,pkg,docs,py # Ensure subset of tox tests work in clean checkout
1115
$ git checkout -b your-branch-name
1216
# DO SOME CODING HERE
17+
$ tox run -e lint,pkg,docs,py # Ensure subset of tox tests work with your changes
1318
$ git add your new files
1419
$ git commit -v
1520
$ git push origin your-branch-name
@@ -31,8 +36,6 @@ released.
3136
Automated tests will be run against all PRs, to run checks locally before
3237
pushing commits, just use [tox](https://tox.wiki/en/latest/).
3338

34-
% DO-NOT-REMOVE-deps-snippet-PLACEHOLDER
35-
3639
## Talk to us
3740

3841
Use Github [discussions] forum or for a live chat experience try

src/ansiblelint/schemas/__store__.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"ansible-lint-config": {
3-
"etag": "616457d973f4b221d85910086ce1fab520d8a363b1e1e62a62e4d8b57a824976",
3+
"etag": "a0bb8004fad70bab34fad94a45b2698125127142ec6b2c8900976aa2bd96a86c",
44
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json"
55
},
66
"ansible-navigator-config": {

tools/test-hook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -euo pipefail
1212
rm -rf .tox/x
1313
mkdir -p .tox/x
1414
cd .tox/x
15-
git init
15+
git init --initial-branch=main
1616
# we add a file to the repo to avoid error due to no file to to lint
1717
touch foo.yml
1818
git add foo.yml

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ requires =
2020

2121
[testenv]
2222
description =
23-
Run the tests under {basepython} and
24-
devel: ansible devel branch
25-
pre: Enables --pre when installing dependencies, testing prereleases
23+
Run the tests under {basepython}
24+
devel: and ansible devel branch
25+
pre: and enable --pre when installing dependencies, testing prereleases
2626
deps =
2727
devel: ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+
2828
devel: ansible-compat @ git+https://github.com/ansible/ansible-compat.git # GPLv3+
@@ -172,7 +172,7 @@ description = Rebuild and test JSON Schemas
172172
deps =
173173
check-jsonschema>=0.26.3
174174
setenv =
175-
# without his upgrade would likely not do anything
175+
# without this upgrade would likely not do anything
176176
PIP_CONSTRAINT = /dev/null
177177
skip_install = true
178178
changedir = test/schemas

0 commit comments

Comments
 (0)