* Add yamllint check for RST code listings.
* Address review comments.
* Sort languages and remove no longer needed duplicates.
* Enable warnings, but disable all failing rules.
* Improve formulation.
Co-authored-by: Don Naro <dnaro@redhat.com>
* Show allowed languages when no or invalid language is supplied. Improve line lengths.
* Make sure that 'yamllint .' passes.
* Fix indentation issues introduced in #2095.
---------
Co-authored-by: Don Naro <dnaro@redhat.com>
* tests: switch to uv pip-compile for lockfiles
This switches the nox pip-compile session and lockfiles to use uv pip
compile (written in Rust and much faster) instead of pip-compile from
pip-tools for our dependency update jobs.
As a side effect, this addresses the issue brought up in
https://github.com/ansible/ansible-documentation/pull/1950#issuecomment-2443965477,
as we're no longer using pip-compile that can break anytime pip changes
the private/internal APIs that pip-tools relies on.
I re-generated the lockfiles with `--no-upgrade` to avoid extraneous
changes in this PR.
The only additions are the formatting of comments in the lockfile and
colorama.
colorama was added as a result of `uv pip-compile`'s `--universal` flag
which creates "universal" lockfiles that include dependencies of other
platforms, architectures, and Python versions than those of the system
used to generate the lockfile.
`--universal` should create more consistent results for contributors who
use other systems
(e.g., Mac OS or a newer Python version than the one used in CI).
Fixes: https://github.com/ansible/ansible-documentation/issues/1755
* nox pip_compile: improve code comments
Suggested-by: Don Naro <dnaro@redhat.com>
* nox pip-compile: support check mode
Support a custom --check flag to fail if pip-compile made any changes so
we can check that that lockfiles are in sync with the input (.in) files.
* ci: remove push trigger for pip-compile workflows
Now that we have the pip-compile-check job, this is redundant. PR checks
will fail if lockfiles are out-of-sync, so there's no need to run the
complete pip-compile workflow that performs a full update of the
dependencies. Complete updates are still performed on a weekly basis.
This PR integrates [actionlint](https://github.com/rhysd/actionlint)
into our CI pipeline to check our Github Actions for best practices and
common errors.
This commit reorganizes the issue/PR triager script and updates the
workflow to run more efficiently.
- Make the script a proper Python package instead of an unwieldy single
file
- Use locked dependencies and UV to decrease workflow runtime to under
10 seconds.
Nox now has a separate venv backend that uses the Rust-based pip
replacement, uv. Let's add support for this to our install function so
that the constraints are respected when using the uv backend.
* WIP tagger session for nox
* First pass tagging nox session
* Formatting fixup
* Adding removal of tmpdir as per discussion
* tag session checks for, and uses, existing ansible checkout if it exists, removes tmpdir if it created one.
* isort fixup
* Working out suggested changes.
* Linting cleanup on changes
* Different approach to noted chagnes
* Reducing tagging session to a bare bones wrapper around the script, leaving all repo management alone
* Staging deletion per discussion
* Adding tag session to dependency update job
* after removing hacking/tagger/requirements.txt moved "gitpython" here for the typing test session requiremnts.
* Adding that here didd not accomplish what I'd expected. Removing it and revisiting how to do that.
* I think this is where the call needed added to get the tags dependencies automatically updated
* remove gitpython, add tag.txt, add blank line
* Comment cleanup per OraNod
* doc README: document nox tag session instead of manual mode
* Update tests/typing.in
Per suggestion from @webnjaz
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
---------
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Previously, the clone-core session ran in the global environment
(`venv_backend="none"`) and instead of provisioning a venv. I did this
to save time, as the clone-core session needs no other dependencies
besides a python interpreter. This turned out to be shortsighted. It's
better to just create an empty venv that we know we can call `python` in
as opposed to relying on whatever `python` may or may not be on `$PATH`.
Some systems may only have `python3` or have `python` pointing to the
wrong thing.
Fixes: https://github.com/ansible/ansible-documentation/issues/1054
* nox pip-compile: allow passing --no-upgrade flag
This allows running `nox -e pip-compile -- --no-upgrade` to make sure
that the requirements.txt files are in sync with the .in files but not
updating any other transitive dependency.
* README: make "## Updating dependencies" more concise
Co-authored-by: Don Naro <dnaro@redhat.com>
---------
Co-authored-by: Don Naro <dnaro@redhat.com>
I know calling make via nox is a bit weird, but I think allowing to run
the Makefile in an isolated environment without having to manually
manage venvs and making it easy to choose between relaxed and stable
dependencies is quite useful.
We should eventually move away from the Makefile, but I think some level
of integration is better than nothing.
Translating the Makefile syntax and constructs into nox's Python syntax
and untangling all of the different Python scripts that preprocess the
documentation is a longer term project.
This adds a checkers session to the noxfile to run docs checkers in
tests/checkers.py.
`nox -e checkers` runs all the docs checkers.
`nox -e 'checkers(rstcheck)'` and `nox -e 'checkers(docs-build)'` can
also be used to call individual checkers.
Simply executing `nox` will clone ansible-core, run the Python linters,
and the docs checkers (docs build test, rstcheck).
This makes it a lot easier for contributors,
as they can just run one command to make sure there changes will pass CI
before submitting a PR
and don't need to muck around with virtual environments and
dependencies.
* Add docs spelling check
* Add codespell config to noxfile and ci
* Update README with details on spelling checks
Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>
This adds a clone-core session to the noxfile that can be run with `nox
-e clone-core`.
The session is added to the default sessions in `nox.options.sessions`
so executing `nox` automatically clones core and runs all of the lint
sessions.