Skip to content
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

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

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Changes from 1 commit
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
@@ -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'
@@ -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:
5 changes: 5 additions & 0 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
@@ -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: |
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
gotmax23 marked this conversation as resolved.
Show resolved Hide resolved
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:

@@ -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
```
11 changes: 8 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -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()
@@ -96,7 +101,7 @@ def test(session: nox.Session):

@nox.session
def coverage(session: nox.Session):
install(session, "coverage[toml]")
install(session, "coverage[toml]", *other_antsibull())
gotmax23 marked this conversation as resolved.
Show resolved Hide resolved
combined = map(str, Path().glob(".nox/test*/tmp/.coverage"))
# Combine the results into a single .coverage file in the root
session.run("coverage", "combine", "--keep", *combined)
@@ -115,7 +120,7 @@ def lint(session: nox.Session):

@nox.session
def formatters(session: nox.Session):
install(session, ".[formatters]")
install(session, ".[formatters]", *other_antsibull())
gotmax23 marked this conversation as resolved.
Show resolved Hide resolved
posargs = list(session.posargs)
if IN_CI:
posargs.append("--check")