Commit Graph

32 Commits

Author SHA1 Message Date
patchback[bot]
1707e62ef4 add py312 as target version for black formatting (#3517) (#3518)
(cherry picked from commit d924d1ab5f)

Co-authored-by: Don Naro <dnaro@redhat.com>
2026-03-10 19:04:08 +00:00
Don Naro
a079fc9333 pin click in pip-compile session (#3085) 2025-09-30 19:46:48 +01:00
Don Naro
362e85d653 remove tag session from noxfile (#2368)
Follows on from 932e5d67e3 to drop the tag
session from the noxfile.
2025-01-20 17:43:51 +00:00
Don Naro
a1e4190664 [stable 2.18] remove the relaxed reqs (#2361)
* rm relaxed reqs and base constraints

* move pins and requirements out of relaxed

* sync requirements lock file

* update noxfile to rm relaxed reqs

* update docs
2025-01-17 17:15:58 +00:00
Don Naro
76096d0cb3 fixes #2177 for stable-2.18 (#2262) 2024-12-11 11:53:12 +00:00
patchback[bot]
91dbfc9084 nox pip-compile: temporarily pin pip version (#2085) (#2088)
Relates: https://github.com/ansible/ansible-documentation/pull/1950#issuecomment-2443949725
Relates: https://github.com/jazzband/pip-tools/issues/2131
(cherry picked from commit ef750f6dcf)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
2024-10-29 14:15:37 -04:00
Maxwell G
2592aaba35 [stable-2.18] support pip-compile check mode and remove pip-compile workflows from stable branch (#1946)
* 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.

(cherry picked from commit cb295b1f78)

* ci: remove pip-compile workflows from stable branch

We don't need these on stable branches, as they can be triggered from
the devel branch with a custom base-branch input.
They were also missing backports of various fixes from the devel branch.
Rather than trying to backport all the changes, let's just remove it
from stable branches and make sure we do so after each branching.
2024-10-15 19:08:03 +01:00
Don Naro
932e5d67e3 Remove tagger script from stable (#1933)
* remove tagger script from stable

* rm tagger from lint tuple

* rm tagger requirements files

* rm tagger from typing reqs input

* update typing lockfile

* rm tag workflow
2024-10-04 16:57:15 -05:00
Maxwell G
b5e957a567 lint actionlint: enable shellcheck integration 2024-09-17 14:55:12 -05:00
Maxwell G
107a3c4383 nox: add actionlint to lint Github Actions workflows
This PR integrates [actionlint](https://github.com/rhysd/actionlint)
into our CI pipeline to check our Github Actions for best practices and
common errors.
2024-09-17 14:55:12 -05:00
Maxwell G
7138e42716 pr_labeler: re-architect triager script (#1882)
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.
2024-09-17 14:07:31 -05:00
Maxwell G
de21da12e1 nox clone-core: allow passing extra args to script 2024-09-12 13:43:35 -05:00
Maxwell G
a74da7db41 nox: support nox uv backend (#1757)
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.
2024-08-26 10:48:45 -05:00
Maxwell G
0d35022030 ci: ensure ansible-core files exist before running docs build (#1756)
Also, make KEEP_DIRS and KEEP_FILES constants to make the main function
cleaner.

Fixes: https://github.com/ansible/ansible-documentation/issues/1056
2024-08-21 10:32:05 +01:00
Maxwell G
e38e2c5cd4 dev pip-compile: switch devel branch pip-compile to 3.11 (#1616)
* dev pip-compile: switch devel branch pip-compile to 3.11

This adjusts the devel branch to use Python 3.11 to generate
dependencies with pip-compile. This also adjusts the pip-compile-dev
workflow to run separate jobs for the stable branches, which will still
use Python 3.10 for requirements files.

Fixes: https://github.com/ansible/ansible-documentation/issues/1614
Fixes: https://github.com/ansible/ansible-documentation/issues/1450

* ci pip-compile-docs.yml: wrap line with `>-`

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>

---------

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-08-20 17:45:51 -05:00
Lyle McKarns
be4c7259aa Issue #1633 nox session for tagging (#1649)
* 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>
2024-07-23 15:15:34 -05:00
Maxwell G
38c01a2065 hacking: add script to create git tags for new Core releases (#1084)
Relates: https://github.com/ansible/ansible-documentation/issues/66
2024-03-17 22:50:30 -05:00
Don Naro
4fbf8cc2e3 use ruff check <path> syntax in noxfile 2024-03-12 09:57:16 +00:00
Maxwell G
d6468625fa nox: run clone-core session in a venv as well (#1055)
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
2024-01-24 11:18:20 -06:00
Maxwell G
e952dd4365 nox pip-compile: allow passing --no-upgrade flag (#883)
* 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>
2023-12-04 13:05:59 -06:00
Maxwell G
352c8e9e47 improve nox make session docs
Co-authored-by: Don Naro <dnaro@redhat.com>
2023-12-04 14:38:55 +00:00
Maxwell G
08f2665f86 nox make: run make clean coredocs by default
This way, `nox -s make` works by default without requiring developers to
pass extra arguments.
2023-12-01 17:37:31 +00:00
Maxwell G
e818e693ad nox: add make session
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.
2023-12-01 17:37:31 +00:00
Maxwell G
54b7657e0a noxfile install(): log PIP_CONSTRAINT value
When pinned dependencies are enabled (the default), this will log the
value of the PIP_CONSTRAINT env var.
2023-10-26 02:54:09 +00:00
Maxwell G
cb83448bcb Run docs checkers in the noxfile
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.
2023-10-26 02:12:35 +00:00
Don Naro
2f8810b255 Add RST spellcheck (#524)
* 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>
2023-10-16 14:18:28 -04:00
Maxwell G
320d1bed6f include docs/bin/*.py in noxfile linting
This enforce the Python linters in the noxfile on the Python files in
docs/bin.
2023-10-11 22:46:19 +00:00
Maxwell G
02ffb4d914 add clone-core session to the noxfile
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.
2023-10-11 22:46:03 +00:00
Maxwell G
7bec1d92c6 nox pip-compile: allow passing custom posargs (#369)
Example:

``` shell
nox -e pip-compile-3.10(requirements-relaxed) -- -P sphinx
```

will only update the sphinx pin and leave all other packages.
2023-09-11 11:25:18 +01:00
Maxwell G
440ae14f76 noxfile: run typing session as part of lint session (#355)
`nox -e lint` runs the `static` and `formatters` sessions, but it does
not run `nox -e typing` due to an oversight in the initial PR.
2023-09-05 12:21:23 -05:00
Maxwell G
ae24c096b4 move pip-compile config into .pip-tools.toml
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2023-08-21 13:38:42 -05:00
Maxwell G
40285f8de9 add noxfile to run python linters and pip-compile
Currently, this only lints the noxfile itself and the issue labeler
script.
We can expand the noxfile to build docs and lint other new files in
hacking.

Relates: https://github.com/ansible/ansible-documentation/issues/54
2023-08-21 13:38:42 -05:00