Skip to content

Commit 2bc13f9

Browse files
authored
Merge pull request #35 from DiamondLightSource/use-sphinx-docs
Use sphinx docs
2 parents 7823d1b + 347064d commit 2bc13f9

34 files changed

+612
-95
lines changed

.copier-answers.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 2.6.0
2+
_commit: 4.0.1
33
_src_path: gh:DiamondLightSource/python-copier-template
44
author_email: martin.gaughran@diamond.ac.uk
55
author_name: Martin Gaughran
@@ -9,10 +9,11 @@ component_type: library
99
description: A set of tools used for deploying applications to a shared filesystem.
1010
distribution_name: dls-deploy-tools
1111
docker: true
12-
docs_type: README
12+
docs_type: sphinx
1313
git_platform: github.com
1414
github_org: DiamondLightSource
1515
package_name: deploy_tools
1616
pypi: true
1717
repo_name: deploy-tools
18+
strict_typing: true
1819
type_checker: pyright

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
2424

2525
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
2626

27-
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/2.6.0/how-to.html).
27+
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/4.0.1/how-to.html).

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
Describe the bug, including a clear and concise description of the expected behavior, the actual behavior and the context in which you encountered it (ideally include details of your environment).
10+
Describe the bug, including a clear and concise description of the expected behaviour, the actual behavior and the context in which you encountered it (ideally include details of your environment).
1111

1212
## Steps To Reproduce
1313
Steps to reproduce the behavior:

.github/actions/install_requirements/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ runs:
1515
run: |
1616
PYTHON_VERSION="${{ inputs.python-version }}"
1717
if [ $PYTHON_VERSION == "dev" ]; then
18-
PYTHON_VERSION=$(sed -n "s/ARG PYTHON_VERSION=//p" Dockerfile)
18+
# python version from Dockerfile, removing potential pinned sha
19+
PYTHON_VERSION=$(sed -Ene "s/ARG PYTHON_VERSION=([0-9\.]+).*/\1/p" Dockerfile)
1920
fi
2021
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
2122
shell: bash

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ updates:
1313
actions:
1414
patterns:
1515
- "*"
16+
commit-message:
17+
prefix: "chore"
1618

1719
- package-ecosystem: "pip"
1820
directory: "/"
@@ -22,3 +24,5 @@ updates:
2224
dev-dependencies:
2325
patterns:
2426
- "*"
27+
commit-message:
28+
prefix: "chore"

.github/workflows/_check.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/_container.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
on:
22
workflow_call:
3+
inputs:
4+
publish:
5+
type: boolean
6+
description: If true, pushes image to container registry
37

48
jobs:
59
build:
@@ -47,7 +51,7 @@ jobs:
4751
type=raw,value=latest
4852
4953
- name: Push cached image to container registry
50-
if: github.ref_type == 'tag'
54+
if: inputs.publish && github.ref_type == 'tag'
5155
uses: docker/build-push-action@v6
5256
env:
5357
DOCKER_BUILD_RECORD_UPLOAD: false

.github/workflows/_docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
workflow_call:
3+
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Avoid git conflicts when tag and branch pushed at same time
11+
if: github.ref_type == 'tag'
12+
run: sleep 60
13+
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
# Need this to get version number from last tag
18+
fetch-depth: 0
19+
20+
- name: Install system packages
21+
run: sudo apt-get install graphviz
22+
23+
- name: Install python packages
24+
uses: ./.github/actions/install_requirements
25+
26+
- name: Build docs
27+
run: tox -e docs
28+
29+
- name: Remove environment.pickle
30+
run: rm build/html/.doctrees/environment.pickle
31+
32+
- name: Upload built docs artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: docs
36+
path: build
37+
38+
- name: Sanitize ref name for docs version
39+
run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV
40+
41+
- name: Move to versioned directory
42+
run: mv build/html .github/pages/$DOCS_VERSION
43+
44+
- name: Write switcher.json
45+
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
46+
47+
- name: Publish Docs to gh-pages
48+
if: github.ref_type == 'tag' || github.ref_name == 'main'
49+
# We pin to the SHA, not the tag, for security reasons.
50+
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
51+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
publish_dir: .github/pages
55+
keep_files: true

.github/workflows/_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Create GitHub Release
2424
# We pin to the SHA, not the tag, for security reasons.
2525
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
26-
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
26+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
2727
with:
2828
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
2929
files: "*"

.github/workflows/_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
tox -e tests
6161
6262
- name: Upload coverage to Codecov
63-
uses: codecov/codecov-action@v4
63+
uses: codecov/codecov-action@v5
6464
with:
6565
name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
6666
files: cov.xml

0 commit comments

Comments
 (0)