diff --git a/.github/workflows/pip-compile-dev.yml b/.github/workflows/pip-compile-dev.yml index c648cd9dcf9..89ae8e77184 100644 --- a/.github/workflows/pip-compile-dev.yml +++ b/.github/workflows/pip-compile-dev.yml @@ -39,6 +39,7 @@ jobs: 'pip-compile-3.10(typing)' 'pip-compile-3.10(static)' 'pip-compile-3.10(spelling)' + 'pip-compile-3.10(tag)' reset-branch: "${{ inputs.reset-branch || false }}" labels: "${{ inputs.labels || 'backport-2.14,backport-2.15,backport-2.16,backport-2.17,tooling' }}" secrets: inherit diff --git a/README.md b/README.md index 2c729580b0d..9ec6cd5a5be 100644 --- a/README.md +++ b/README.md @@ -141,30 +141,22 @@ podman run --rm --tty --volume "$(pwd):/mnt:z" --workdir /mnt docker.io/library/ When a tag is created in the [`ansible/ansible`](https://github.com/ansible/ansible) repository for a release or release candidate, a corresponding tag should be created in this `ansible-documentation` repository. -First, install the additional tagging dependencies from this repository as follows, creating or activating a `venv` as needed: - -``` bash -python3 -m venv ./venv -source ./venv/bin/activate -pip install -r hacking/tagger/requirements.txt -``` - -Next, ensure that you have the [`ansible/ansible`](https://github.com/ansible/ansible) and [`ansible/ansible-documentation`](https://github.com/ansible/ansible-documentation) repositories checked out. +First, ensure that you have the [`ansible/ansible`](https://github.com/ansible/ansible) and [`ansible/ansible-documentation`](https://github.com/ansible/ansible-documentation) repositories checked out. The tool assumes that both checkouts have the same parent directory. You can set different paths to your checkouts with the `--docs` and `--core` options if you have them set up another way. -Lastly, run the tagger script. +Next, run the `tag` `nox` session. This will determine any missing `ansible-core` tags and create them in `ansible-documentation` if needed, exiting normally otherwise: ``` bash # The tagger scripts assumes "origin" as the upstream remote. -./hacking/tagger/tag.py tag +nox -s tag # If you use a different upstream remote, specify the name. -./hacking/tagger/tag.py --remote tag +nox -s tag -- --remote tag # If your core repo is not in the same filesystem location, specify the path. -./hacking/tagger/tag.py --core tag +nox -s tag -- --core tag ``` -See `--help` for extended options. +See `nox -s tag -- --help` for extended options. diff --git a/noxfile.py b/noxfile.py index fbb0beb757d..e685f9349e7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -180,3 +180,18 @@ def make(session: nox.Session): *(args.make_args or ("clean", "coredocs")), ] session.run("make", "-C", "docs/docsite", *make_args, external=True) + + +@nox.session +def tag(session: nox.Session): + """ + Check the core repo for new releases and create tags in ansible-documentation + """ + install(session, req="tag") + args = list(session.posargs) + + # If run without any arguments, default to "tag" + if not any(arg.startswith(("hash", "mantag", "new-tags", "tag")) for arg in args): + args.append("tag") + + session.run("python", "hacking/tagger/tag.py", *args) diff --git a/hacking/tagger/requirements.txt b/tests/tag.in similarity index 100% rename from hacking/tagger/requirements.txt rename to tests/tag.in diff --git a/tests/tag.txt b/tests/tag.txt new file mode 100644 index 00000000000..faa6f01587c --- /dev/null +++ b/tests/tag.txt @@ -0,0 +1,30 @@ +# +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: +# +# pip-compile --allow-unsafe --output-file=tests/tag.txt --strip-extras tests/tag.in +# +click==8.1.7 + # via typer +gitdb==4.0.11 + # via gitpython +gitpython==3.1.43 + # via -r tests/tag.in +markdown-it-py==3.0.0 + # via rich +mdurl==0.1.2 + # via markdown-it-py +packaging==24.1 + # via -r tests/tag.in +pygments==2.18.0 + # via rich +rich==13.7.1 + # via typer +shellingham==1.5.4 + # via typer +smmap==5.0.1 + # via gitdb +typer==0.12.3 + # via -r tests/tag.in +typing-extensions==4.12.2 + # via typer diff --git a/tests/typing.in b/tests/typing.in index 5eaee63794a..9701e2c5780 100644 --- a/tests/typing.in +++ b/tests/typing.in @@ -1,4 +1,4 @@ -r ../hacking/pr_labeler/requirements.txt --r ../hacking/tagger/requirements.txt +-r tag.in mypy nox