Contributions are welcome. Please open an issue and submit a PR.
The file requirements-dev.txt has the required packages to contribute:
lazydocs
is used by the script generate-functions-documentation.py to generate the functions documentation in markdown format from the functions docstringpytest
is required to test the package antapytest-cov
is used to produce code coverage reportspylint
is a linter for pythonyamllint
is a linter for YAML files
Run the command yamllint -c .yamllint.yml .
Run the command pylint $(git ls-files '-.py')
To test the Python module tests of the package anta, run the following commands from the tests
directory:
py.test --cov=anta -vv
py.test units/antatests_test.py -vv --cov=anta.tests
To generate from the docstring the documentation in markdown format in the directory api, run these commands from the root of the repository:
python documentation/generate-functions-documentation.py
ls docs/api
pip install pre-commit
pre-commit install
When running a commit or a pre-commit check:
❯ echo "import foobaz" > test.py && git add test.py
❯ pre-commit
pylint...................................................................Failed
- hook id: pylint
- exit code: 22
************* Module test
test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:1:0: E0401: Unable to import 'foobaz' (import-error)
test.py:1:0: W0611: Unused import foobaz (unused-import)
GitHub actions is used to test git pushes and pull requests. The workflows are defined in this directory. We can view the result here