Skip to content

Commit a3fc1da

Browse files
authored
Merge pull request #332 from bgilbert/checklist
Autogenerate Markdown file with release checklist links
2 parents 9642aff + d2c8708 commit a3fc1da

File tree

5 files changed

+60
-6
lines changed

5 files changed

+60
-6
lines changed

.github/maintainer/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- Generated by mkmaintainer.py; do not edit -->
2+
3+
## Maintainer issue templates
4+
5+
- [Release checklist](https://github.com/openslide/openslide-python/issues/new?title=Release+X.Y.Z&body=%23+OpenSlide+Python+release+process%0A%0A-+%5B+%5D+Update+%60CHANGELOG.md%60+and+version+in+%60openslide%2F_version.py%60%0A-+%5B+%5D+Create+and+push+signed+tag%0A-+%5B+%5D+Find+the+%5Bworkflow+run%5D%28https%3A%2F%2Fgithub.com%2Fopenslide%2Fopenslide-python%2Factions%2Fworkflows%2Fpython.yml%29+for+the+tag%0A++-+%5B+%5D+Once+the+build+finishes%2C+approve+deployment+to+PyPI%0A++-+%5B+%5D+Download+the+docs+artifact%0A-+%5B+%5D+Verify+that+the+workflow+created+a+%5BPyPI+release%5D%28https%3A%2F%2Fpypi.org%2Fp%2Fopenslide-python%29+with+a+description%2C+source+tarball%2C+and+wheels%0A-+%5B+%5D+Verify+that+the+workflow+created+a+%5BGitHub+release%5D%28https%3A%2F%2Fgithub.com%2Fopenslide%2Fopenslide-python%2Freleases%29+with+release+notes%2C+source+tarballs%2C+and+wheels%0A-+%5B+%5D+%60cd%60+into+website+checkout%3B+%60rm+-r+api%2Fpython+%26%26+unzip+%2Fpath%2Fto%2Fdownloaded%2Fopenslide-python-docs.zip+%26%26+mv+openslide-python-docs-%2A+api%2Fpython%60%0A-+%5B+%5D+Update+website%3A+%60_data%2Freleases.yaml%60%2C+%60_includes%2Fnews.md%60%0A-+%5B+%5D+Start+a+%5BCI+build%5D%28https%3A%2F%2Fgithub.com%2Fopenslide%2Fopenslide.github.io%2Factions%2Fworkflows%2Fretile.yml%29+of+the+demo+site%0A-+%5B+%5D+Update+Ubuntu+PPA%0A-+%5B+%5D+Update+Fedora+and+possibly+EPEL+packages%0A-+%5B+%5D+Check+that+%5BCopr+package%5D%28https%3A%2F%2Fcopr.fedorainfracloud.org%2Fcoprs%2Fg%2Fopenslide%2Fopenslide%2Fbuilds%2F%29+built+successfully%0A-+%5B+%5D+Send+mail+to+-announce+and+-users%0A-+%5B+%5D+Post+to+%5Bforum.image.sc%5D%28https%3A%2F%2Fforum.image.sc%2Fc%2Fannouncements%2F10%29%0A-+%5B+%5D+Update+MacPorts+package&labels=release)
6+
- [Update checklist for a Python minor release](https://github.com/openslide/openslide-python/issues/new?title=Add+Python+X.Y&body=%23+Adding+a+new+Python+release%0A%0A-+Update+Git+main%0A++-+%5B+%5D+%60git+checkout+main%60%0A++-+%5B+%5D+In+%60pyproject.toml%60%2C+add+classifier+for+new+Python+version+and+update+%60tool.black.target-version%60%0A++-+%5B+%5D+In+%60.github%2Fworkflows%2Fpython.yml%60%2C+update+hardcoded+Python+versions+and+add+new+version+to+lists%0A++-+%5B+%5D+Commit+and+open+a+PR%0A++-+%5B+%5D+Merge+the+PR+when+CI+passes%0A++-+%5B+%5D+Add+new+Python+jobs+to+%5Bbranch+protection+required+checks%5D%28https%3A%2F%2Fgithub.com%2Fopenslide%2Fopenslide-python%2Fsettings%2Fbranches%29%0A-+%5B+%5D+Update+MacPorts+package%0A-+%5B+%5D+Update+website%3A+Python+3+versions+in+%60download%2Findex.md%60&labels=release)

.github/maintainer/mkmaintainer.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/python
2+
3+
from __future__ import annotations
4+
5+
from pathlib import Path
6+
from urllib.parse import urlencode
7+
8+
import yaml
9+
10+
dir = Path(__file__).parent
11+
with open(dir / 'README.md', 'w') as fh:
12+
fh.write('<!-- Generated by mkmaintainer.py; do not edit -->\n\n')
13+
fh.write('## Maintainer issue templates\n\n')
14+
for path in sorted(dir.iterdir()):
15+
if path.name == 'README.md' or path.suffix != '.md':
16+
continue
17+
_, front, body = path.read_text().split('---\n', 2)
18+
info = yaml.safe_load(front)
19+
args = urlencode(
20+
{
21+
'title': info['title'],
22+
'body': body.strip(),
23+
'labels': ','.join(info.get('labels', [])),
24+
}
25+
)
26+
url = f"https://github.com/{info['repo']}/issues/new?{args}"
27+
fh.write(f"- [{info['link-text']}]({url})\n")

.github/ISSUE_TEMPLATE/release.md renamed to .github/maintainer/release.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
---
2+
link-text: Release checklist
3+
repo: openslide/openslide-python
4+
title: Release X.Y.Z
5+
labels: [release]
6+
---
7+
18
# OpenSlide Python release process
29

310
- [ ] Update `CHANGELOG.md` and version in `openslide/_version.py`

.github/ISSUE_TEMPLATE/python-bump.md renamed to .github/maintainer/update-python.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
---
2+
link-text: Update checklist for a Python minor release
3+
repo: openslide/openslide-python
4+
title: Add Python X.Y
5+
labels: [release]
6+
---
7+
18
# Adding a new Python release
29

310
- Update Git main

.pre-commit-config.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exclude: '^(COPYING\.LESSER|examples/deepzoom/static/.*\.js)$'
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v5.0.0
6+
rev: v6.0.0
77
hooks:
88
- id: check-added-large-files
99
- id: check-merge-conflict
@@ -16,7 +16,7 @@ repos:
1616
- id: trailing-whitespace
1717

1818
- repo: https://github.com/asottile/pyupgrade
19-
rev: v3.19.1
19+
rev: v3.20.0
2020
hooks:
2121
- id: pyupgrade
2222
name: Modernize python code
@@ -47,21 +47,21 @@ repos:
4747
additional_dependencies: [flake8-bugbear, Flake8-pyproject]
4848

4949
- repo: https://github.com/PyCQA/flake8
50-
rev: 7.2.0
50+
rev: 7.3.0
5151
hooks:
5252
- id: flake8
5353
name: Lint python code with flake8
5454
additional_dependencies: [flake8-bugbear, Flake8-pyproject]
5555

5656
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: v1.15.0
57+
rev: v1.17.1
5858
hooks:
5959
- id: mypy
6060
name: Check Python types
61-
additional_dependencies: [flask, openslide-bin, pillow, types-setuptools]
61+
additional_dependencies: [flask, openslide-bin, pillow, types-PyYAML, types-setuptools]
6262

6363
- repo: https://github.com/rstcheck/rstcheck
64-
rev: v6.2.4
64+
rev: v6.2.5
6565
hooks:
6666
- id: rstcheck
6767
name: Validate reStructuredText syntax
@@ -82,6 +82,13 @@ repos:
8282

8383
- repo: local
8484
hooks:
85+
- id: mkmaintainer
86+
name: Sync maintainer issue templates
87+
entry: .github/maintainer/mkmaintainer.py
88+
files: .github/maintainer/
89+
language: python
90+
additional_dependencies: [PyYAML]
91+
8592
- id: annotations
8693
name: Require "from __future__ import annotations"
8794
language: pygrep

0 commit comments

Comments
 (0)