Skip to content

Commit 512b136

Browse files
committed
fix merge conflicts
2 parents 43a6ccf + 977268c commit 512b136

11 files changed

Lines changed: 84 additions & 60 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
* Added a question about citation file [#471](https://github.com/NLeSC/python-template/pull/471)
8+
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
89
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
910
* Template unit tests for documentation generation, linting and version bumping
1011
* Docstring for function

copier.yml

Lines changed: 13 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,13 @@ AddCitation:
8389
default: "{{ template_profile != 'minimum' }}"
8490
help: Citation file and cffconvert workflow which validates the citation file
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+
98+
8699
# internal fields
87100
_subdirectory: template
88101

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
@@ -15,13 +15,6 @@ jobs:
1515
with:
1616
filename: .github/next_steps/01_sonarcloud_integration.md
1717
id: sonarcloud
18-
- name: Create readthedocs issue
19-
uses: JasonEtco/create-an-issue@v2
20-
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
with:
23-
filename: .github/next_steps/03_readthedocs.md
24-
id: readthedocs
2518
- name: Create Zenodo integration issue
2619
uses: JasonEtco/create-an-issue@v2
2720
env:
@@ -41,7 +34,6 @@ jobs:
4134
echo 'Created issues that must be completed to have fully working Python package:
4235
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}
4336
* Zenodo integration ${{ steps.zenodo.outputs.url }}
44-
* Read the Docs instructions ${{ steps.readthedocs.outputs.url }}
4537
* Linting fixes ${{ steps.linting.outputs.url }}'
4638
- name: Cleanup files needed to create next steps issues
4739
run: |
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 'nlesc-python-template@users.noreply.github.com'
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
{% if AddCitation -%}

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)