Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
24f2347
ci: update docs publishing using myst-version-switcher-plugin
Aug 17, 2026
52f132e
ci: edit and update ci.yml.jinja file with new changes from ci.yml
Aug 17, 2026
3eae2b3
chore: test a commit
Aug 18, 2026
a26f2d7
chore: test a commit2
shree-iyengar-dls Aug 18, 2026
55cbcd2
Merge branch 'main' into 344_change_docs_publishing_ci
shree-iyengar-dls Aug 18, 2026
74e3550
chore: delete _release.yml file
shree-iyengar-dls Aug 18, 2026
e69980d
ci: remove type checking from tox in ci.yml
shree-iyengar-dls Aug 19, 2026
0f5bb9d
chore: add long description to pyproject.toml
shree-iyengar-dls Aug 19, 2026
eb0a3f7
chore: add readme to pyproject.toml
shree-iyengar-dls Aug 19, 2026
9203a59
chore: remove dist as a requirement for release in ci.yml
shree-iyengar-dls Aug 19, 2026
662290a
add type-checking back to lint job
shree-iyengar-dls Aug 19, 2026
ef2afe1
chore:revert back some of ci yml jinja changes
shree-iyengar-dls Aug 19, 2026
0140b6f
chore:remove extra endif
shree-iyengar-dls Aug 19, 2026
54fbfd9
chore: cahnges to conf.py files
shree-iyengar-dls Aug 19, 2026
79adfb5
ci: remove dist job from ci.yml
shree-iyengar-dls Aug 19, 2026
97255d5
chore: update uv lock and jinja file
shree-iyengar-dls Aug 20, 2026
8ceca5f
chore: update uv lock file dependencies from merge conflict
shree-iyengar-dls Sep 10, 2026
86938b1
ci: upgrade docs pipeline from v0.24 to v0.27.0
shree-iyengar-dls Sep 10, 2026
b88add2
chore: remove a few package names from renovate
shree-iyengar-dls Sep 10, 2026
23c19e2
chore: formatting changes in pyproject.toml
shree-iyengar-dls Sep 10, 2026
16a96cc
remove if in renovate.json.jinja
shree-iyengar-dls Sep 11, 2026
fe19024
remove trailing comma
shree-iyengar-dls Sep 11, 2026
76f53c7
chore: rearrange order in renovate.json
shree-iyengar-dls Sep 14, 2026
3fe4bbc
ci: add install graphviz
shree-iyengar-dls Sep 14, 2026
c240f30
ci: add needs install graphviz to docs
shree-iyengar-dls Sep 14, 2026
1741739
ci: add install graphviz to ci.yml.jinja file
shree-iyengar-dls Sep 14, 2026
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
55 changes: 0 additions & 55 deletions .github/workflows/_docs.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/_release.yml

This file was deleted.

32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: CI

on:
push:
branches:
- main
tags:
- '*'
pull_request:
push:
branches: [main]
tags: ["*"] # '*' never matches '/', so e.g. release/x tags don't build

jobs:
lint:
Expand All @@ -19,10 +17,20 @@ jobs:
with:
runs-on: ubuntu-latest

docs:
uses: ./.github/workflows/_docs.yml
permissions:
contents: write
install-graphviz:
runs-on: ubuntu-latest
steps:
- name: Install system packages
run: sudo apt-get update && sudo apt-get install -y graphviz

docs: # Call the docs building workflow directly
needs: install-graphviz
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/docs.yml@v0.27.0
with:
# Whatever turns your sources into docs/_build/html at $BASE_URL. uv and Node
# are preinstalled; so: make docs · tox -e docs · npm ci && npm run docs
build-command: uv run --locked tox -e docs
html-dir: build/html

example:
needs: test
Expand All @@ -33,7 +41,7 @@ jobs:

release:
needs: [test, docs]
if: github.ref_type == 'tag'
uses: ./.github/workflows/_release.yml
if: github.ref_type == 'tag' # tag pushes only
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.27.0
permissions:
contents: write
contents: write # create the Release + attach assets
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
# matches ci.yml's `name:`, NOT its filename
workflow_run:
workflows: [CI]
types: [completed]

# fork-PR previews and manual re-deploys
workflow_dispatch:
inputs:
pr:
description: "Fork PR to approve + preview (empty = re-deploy)"
required: false
default: ""

jobs:
publish:
# Both guards fail OPEN — copy them verbatim.
# conclusion == 'success' : workflow_run fires on failures too
# head_repository == this repo : workflow_run holds a WRITE token even when a
# fork's PR triggered it (the pwn-request shape)
# The repository check keeps forks of blueapi from publishing to their own Pages.
if: >-
github.repository == 'DiamondLightSource/blueapi' &&
(github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_repository.full_name == github.repository))
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/publish-gh-pages.yml@v0.27.0
with:
pr: ${{ inputs.pr }}
max-releases: "30"
max-prs: "20"
permissions:
contents: read
actions: read # gather cross-run docs artifacts
pages: write
id-token: write
statuses: write # record the fork-preview approval / preview link
17 changes: 4 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys
from importlib.metadata import version
from pathlib import Path
from subprocess import check_output

import requests

Expand All @@ -19,14 +17,7 @@
# The full version, including alpha/beta/rc tags.
release = version(project)

# The short X.Y version.
if "+" in release:
# Not on a tag, use branch name
root = Path(__file__).absolute().parent.parent
git_branch = check_output("git branch --show-current".split(), cwd=root)
version = git_branch.decode().strip()
else:
version = release
version = os.environ.get("VERSION_NAME", "local")

extensions = [
# For graphviz diagrams
Expand Down Expand Up @@ -135,8 +126,8 @@
"json_url": switcher_json,
"version_match": version,
},
"check_switcher": True,
"navbar_end": ["theme-switcher", "icon-links", "version-switcher"],
"check_switcher": False,
"navbar_end": ["theme-switcher", "navbar-icon-links", "version-switcher"],
}

# A dictionary of values to pass into the template engine’s context for all pages
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ build-backend = "setuptools.build_meta"

[project]
name = "python-copier-template"
description = "Diamond's opinionated copier template for pure Python projects."
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.11"

[dependency-groups]
Expand Down
6 changes: 4 additions & 2 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ version_file = "src/{{ package_name }}/_version.py"
typeCheckingMode = "strict"
{% else %}
typeCheckingMode = "standard"
{% endif %}reportMissingImports = false # Ignore missing stubs in imported modules
{% endif %}{% if type_checker=="mypy" %}
{% endif %}
reportMissingImports = false # Ignore missing stubs in imported modules
{% endif %}
{% if type_checker=="mypy" %}
[tool.mypy]
ignore_missing_imports = true # Ignore missing stubs in imported modules
{% endif %}
Expand Down
6 changes: 2 additions & 4 deletions template/renovate.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
"actions/checkout",
"astral-sh/setup-uv",
"actions/upload-artifact",
"actions/download-artifact",
"softprops/action-gh-release",
"codecov/codecov-action"{% if docker %},
"docker/setup-buildx-action",
"docker/login-action",
"docker/build-push-action",
"docker/metadata-action"{% endif %}{% if pypi %},
"pypa/gh-action-pypi-publish"{% endif %}{% if sphinx %},
"peaceiris/actions-gh-pages"{% endif %}
"pypa/gh-action-pypi-publish",
"actions/download-artifact"{% endif %}
],
"matchManagers": [
"github-actions"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: CI

on:
push:
branches:
- main
tags:
- '*'
pull_request:

push:
branches:[main]
tags:['*']

jobs:

lint:
Expand Down Expand Up @@ -36,11 +34,20 @@ jobs:
contents: read
packages: write
{% endraw %}{% endif %}{% if sphinx %}
install-graphviz:
runs-on: ubuntu-latest
steps:
- name: Install system packages
run: sudo apt-get update && sudo apt-get install -y graphviz

docs:
uses: ./.github/workflows/_docs.yml
permissions:
contents: write
{% endif %}
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/docs.yml@v0.27.0
with:
# Whatever turns your sources into docs/_build/html at $BASE_URL.
# uv and Node are preinstalled; so: make docs · tox -e docs · npm ci && npm run docs
build-command: uv run --locked tox -e docs
html-dir: build/html
{% endif %}
dist:
uses: ./.github/workflows/_dist.yml
{% if pypi %}
Expand All @@ -54,6 +61,6 @@ jobs:
release:
needs: [dist, test{% if sphinx %}, docs{% endif %}]
if: github.ref_type == 'tag'
uses: ./.github/workflows/_release.yml
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/release.yml@v0.27.0
permissions:
contents: write
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
# matches ci.yml's `name:`, NOT its filename
workflow_run:
workflows: [CI]
types: [completed]

# fork-PR previews and manual re-deploys
workflow_dispatch:
inputs:
pr:
description: "Fork PR to approve + preview (empty = re-deploy)"
required: false
default: ""

jobs:
publish:
# Both guards fail OPEN — copy them verbatim.
# conclusion == 'success' : workflow_run fires on failures too
# head_repository == this repo : workflow_run holds a WRITE token even when a
# fork's PR triggered it (the pwn-request shape)
# The repository check keeps forks of blueapi from publishing to their own Pages.
if: >-
github.repository == 'DiamondLightSource/blueapi' &&
(github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_repository.full_name == github.repository))
uses: DiamondLightSource/myst-version-switcher-plugin/.github/workflows/publish-gh-pages.yml@v0.27.0
with:
pr: ${{ inputs.pr }}
max-releases: "30"
max-prs: "20"
permissions:
contents: read
actions: read # gather cross-run docs artifacts
pages: write
id-token: write
statuses: write # record the fork-preview approval / preview link

This file was deleted.

2 changes: 1 addition & 1 deletion template/{% if sphinx %}docs{% endif %}/conf.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ html_theme_options = {
"version_match": version,
},
"check_switcher": False,
"navbar_end": ["theme-switcher", "icon-links", "version-switcher"],
"navbar_end": ["theme-switcher", "navbar-icon-links", "version-switcher"],
"navigation_with_keys": False,
}

Expand Down
Loading