Skip to content

Integrate antsibull-docutils into CI and build scripts and instructions #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/antsibull-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
- main
antsibull_changelog_ref:
- main
antsibull_docutils_ref:
- main
include:
- options: '--use-current --use-html-blobs --no-breadcrumbs community.crypto community.docker --extra-conf antsibull_ext_color_scheme=none'
python: '3.9'
Expand Down Expand Up @@ -71,6 +73,13 @@ jobs:
path: antsibull-changelog
ref: ${{ matrix.antsibull_changelog_ref }}

- name: Check out dependent project antsibull-docutils
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-docutils
path: antsibull-docutils
ref: ${{ matrix.antsibull_docutils_ref }}

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ jobs:
with:
repository: ansible-community/antsibull-changelog
path: antsibull-changelog
- name: Check out dependent project antsibull-docutils
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-docutils
path: antsibull-docutils
- name: Install extra packages
if: "matrix.packages != ''"
run: |
Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,25 @@ Install and run `nox` to run all tests. That's it for simple contributions!
`nox` will create virtual environments in `.nox` inside the checked out project
and install the requirements needed to run the tests there.


---

antsibull-docs depends on the sister antsibull-core and antsibull-docs-parser projects.
By default, `nox` will install a development version of these projects from
Github.
If you're hacking on antsibull-core and/or antsibull-docs-parser alongside antsibull-docs,
nox will automatically install the projects from `../antsibull-core` and
`../antsibull-docs-parser` when running tests if those paths exist.
antsibull-docs depends on the sister antsibull-changelog, antsibull-core, and
antsibull-docs-parser projects.
By default, `nox` will install a development version of these projects from Github.
If you're hacking on antsibull-changelog, antsibull-core, antsibull-docs-parser, and/or
antsibull-docutils alongside antsibull-docs, nox will automatically install the projects
from `../antsibull-changelog`, `../antsibull-core`, `../antsibull-docs-parser`, and
`../antsibull-docutils` when running tests if those paths exist.
You can change this behavior through the `OTHER_ANTSIBULL_MODE` env var:

- `OTHER_ANTSIBULL_MODE=auto` — the default behavior described above
- `OTHER_ANTSIBULL_MODE=local` — install the projects from `../antsibull-core`
and `../antsibull-docs-parser`. Fail if those paths don't exist.
- `OTHER_ANTSIBULL_MODE=local` — install the projects from `../antsibull-changelog`,
`../antsibull-core`, `../antsibull-docs-parser`, and `../antsibull-docutils`.
Fail if those paths don't exist.
- `OTHER_ANTSIBULL_MODE=git` — install the projects from the Github main branch
- `OTHER_ANTSIBULL_MODE=pypi` — install the latest versions from PyPI

---

To run specific tests:

Expand All @@ -64,13 +66,15 @@ To run specific tests:
To create a more complete local development env:

```console
git clone https://github.com/ansible-community/antsibull-changelog.git
git clone https://github.com/ansible-community/antsibull-core.git
git clone https://github.com/ansible-community/antsibull-docs-parser.git
git clone https://github.com/ansible-community/antsibull-docs.git
git clone https://github.com/ansible-community/antsibull-docutils.git
cd antsibull-docs
python3 -m venv venv
. ./venv/bin/activate
pip install -e '.[dev]' -e ../antsibull-core -e ../antsibull-docs-parser
pip install -e '.[dev]' -e ../antsibull-changelog -e ../antsibull-core -e ../antsibull-docs-parser -e ../antsibull-docutils
[...]
nox
```
Expand Down
9 changes: 7 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def other_antsibull(
if mode is None:
mode = DEFAULT_MODE
to_install: list[str | Path] = []
args = ("antsibull-changelog", "antsibull-core", "antsibull-docs-parser")
args = (
"antsibull-changelog",
"antsibull-core",
"antsibull-docs-parser",
"antsibull-docutils",
)
for project in args:
path = Path("../", project)
path_exists = path.is_dir()
Expand Down Expand Up @@ -115,7 +120,7 @@ def lint(session: nox.Session):

@nox.session
def formatters(session: nox.Session):
install(session, ".[formatters]")
install(session, ".[formatters]", *other_antsibull())
posargs = list(session.posargs)
if IN_CI:
posargs.append("--check")
Expand Down