Skip to content

Commit 5c83d4a

Browse files
committed
Merge remote-tracking branch 'origin/main' into 462-optional-changelog
2 parents aae7b0e + 977268c commit 5c83d4a

11 files changed

+83
-60
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
78
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
89
* Template unit tests for documentation generation, linting and version bumping
910
* Docstring for function

copier.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ license:
7171
- "Not open source"
7272
default: "MIT license"
7373

74+
AddLinkCheck:
75+
when: "{{ template_profile == 'ask' }}"
76+
type: bool
77+
default: "{{ template_profile != 'minimum' }}"
78+
help: Do you want to add a GitHub action to check broken links?
79+
7480
AddGitHubActions:
7581
when: "{{ template_profile == 'ask' }}"
7682
type: bool
@@ -83,6 +89,12 @@ AddChangeLog:
8389
default: "{{ template_profile != 'minimum' }}"
8490
help: Add a change log to keep track of changes in the package
8591

92+
AddOnlineDocumentation:
93+
when: "{{ template_profile == 'ask' }}"
94+
type: bool
95+
default: "{{ template_profile != 'minimum' }}"
96+
help: Online documentation using Read the Docs
97+
8698
# internal fields
8799
_subdirectory: template
88100

template/.github/next_steps/03_readthedocs.md.jinja renamed to template/.github/next_steps/{% if AddOnlineDocumentation %}03_readthedocs.md{% endif %}.jinja

File renamed without changes.

template/.github/workflows/markdown-link-check.yml

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

template/.github/workflows/next_steps.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ jobs:
2323
with:
2424
filename: .github/next_steps/02_citation.md
2525
id: citation
26-
- name: Create readthedocs issue
27-
uses: JasonEtco/create-an-issue@v2
28-
env:
29-
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
30-
with:
31-
filename: .github/next_steps/03_readthedocs.md
32-
id: readthedocs
3326
- name: Create Zenodo integration issue
3427
uses: JasonEtco/create-an-issue@v2
3528
env:
@@ -49,7 +42,6 @@ jobs:
4942
echo 'Created issues that must be completed to have fully working Python package:
5043
* Sonarcloud integration ${{ '{{ ' -}} steps.sonarcloud.outputs.url }}
5144
* Zenodo integration ${{ '{{ ' -}} steps.zenodo.outputs.url }}
52-
* Read the Docs instructions ${{ '{{ ' -}} steps.readthedocs.outputs.url }}
5345
* Citation data ${{ '{{ ' -}} steps.citation.outputs.url }}
5446
* Linting fixes ${{ '{{ ' -}} steps.linting.outputs.url }}'
5547
- name: Cleanup files needed to create next steps issues
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: link-check
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
schedule:
12+
- cron: '0 0 1 * *' # first day of every month at midnight
13+
14+
permissions:
15+
contents: read
16+
issues: write
17+
18+
jobs:
19+
linkChecker:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Link Checker
25+
id: lychee
26+
uses: lycheeverse/lychee-action@v1
27+
28+
- name: Set Issue Title
29+
id: set_title
30+
run: echo "ISSUE_TITLE=Link Checker Report - $(date '+%Y-%m-%d')" >> $GITHUB_ENV
31+
32+
- name: Create Issue From File
33+
if: env.lychee_exit_code != 0
34+
uses: peter-evans/create-issue-from-file@v5
35+
with:
36+
title: ${{ env.ISSUE_TITLE }}
37+
content-filepath: ./lychee/out.md
38+
labels: report, automated issue
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on: [push]
2+
permissions:
3+
contents: write
4+
issues: write
5+
name: Create an issue for online documentation
6+
jobs:
7+
next_steps:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Create readthedocs issue
12+
uses: JasonEtco/create-an-issue@v2
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
filename: .github/next_steps/03_readthedocs.md
17+
id: readthedocs
18+
- name: List created issues
19+
run: |
20+
echo 'Created issues that must be completed to have fully working Python package:
21+
* Read the Docs instructions ${{ steps.readthedocs.outputs.url }}'
22+
- name: Cleanup files needed to create next steps issues
23+
run: |
24+
git config --global user.name 'NLeSC Python template'
25+
git config --global user.email '[email protected]'
26+
git rm .github/workflows/next_steps_online_documentation.yml
27+
git rm -r .github/next_steps
28+
git commit -am "Cleanup automated next steps issue generator"
29+
git push

template/.mlc-config.json

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

template/README.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
| **Other best practices** |   |
1414
| Static analysis | [![workflow scq badge](https://sonarcloud.io/api/project_badges/measure?project={{github_organization}}_{{package_name}}&metric=alert_status)](https://sonarcloud.io/dashboard?id={{github_organization}}_{{package_name}}) |
1515
| Coverage | [![workflow scc badge](https://sonarcloud.io/api/project_badges/measure?project={{github_organization}}_{{package_name}}&metric=coverage)](https://sonarcloud.io/dashboard?id={{github_organization}}_{{package_name}}) |
16+
{% if AddOnlineDocumentation -%}
1617
| Documentation | [![Documentation Status](https://readthedocs.org/projects/{{package_name}}/badge/?version=latest)](https://{{package_name}}.readthedocs.io/en/latest/?badge=latest) |
18+
{%- endif -%}
1719
| **GitHub Actions** |   |
1820
| Build | [![build]({{repository_url}}/actions/workflows/build.yml/badge.svg)]({{repository_url}}/actions/workflows/build.yml) |
1921
| Citation data consistency | [![cffconvert]({{repository_url}}/actions/workflows/cffconvert.yml/badge.svg)]({{repository_url}}/actions/workflows/cffconvert.yml) |

template/project_setup.md.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ help you decide which tool to use for packaging.
5959
- The documentation is set up with the ReadTheDocs Sphinx theme.
6060
- Check out its [configuration options](https://sphinx-rtd-theme.readthedocs.io/en/latest/).
6161
- [AutoAPI](https://sphinx-autoapi.readthedocs.io/) is used to generate documentation for the package Python objects.
62-
- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.
62+
{% if AddOnlineDocumentation %}- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.{% endif -%}
6363
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=writingdocumentation)
6464

6565
## Coding style conventions and code quality

0 commit comments

Comments
 (0)