Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/maintainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- Generated by mkmaintainer.py; do not edit -->

## Maintainer issue templates

- [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)
- [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)
27 changes: 27 additions & 0 deletions .github/maintainer/mkmaintainer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/python

from __future__ import annotations

from pathlib import Path
from urllib.parse import urlencode

import yaml

dir = Path(__file__).parent
with open(dir / 'README.md', 'w') as fh:
fh.write('<!-- Generated by mkmaintainer.py; do not edit -->\n\n')
fh.write('## Maintainer issue templates\n\n')
for path in sorted(dir.iterdir()):
if path.name == 'README.md' or path.suffix != '.md':
continue
_, front, body = path.read_text().split('---\n', 2)
info = yaml.safe_load(front)
args = urlencode(
{
'title': info['title'],
'body': body.strip(),
'labels': ','.join(info.get('labels', [])),
}
)
url = f"https://github.com/{info['repo']}/issues/new?{args}"
fh.write(f"- [{info['link-text']}]({url})\n")
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
link-text: Release checklist
repo: openslide/openslide-python
title: Release X.Y.Z
labels: [release]
---

# OpenSlide Python release process

- [ ] Update `CHANGELOG.md` and version in `openslide/_version.py`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
link-text: Update checklist for a Python minor release
repo: openslide/openslide-python
title: Add Python X.Y
labels: [release]
---

# Adding a new Python release

- Update Git main
Expand Down
19 changes: 13 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exclude: '^(COPYING\.LESSER|examples/deepzoom/static/.*\.js)$'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
Expand All @@ -16,7 +16,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
rev: v3.20.0
hooks:
- id: pyupgrade
name: Modernize python code
Expand Down Expand Up @@ -47,21 +47,21 @@ repos:
additional_dependencies: [flake8-bugbear, Flake8-pyproject]

- repo: https://github.com/PyCQA/flake8
rev: 7.2.0
rev: 7.3.0
hooks:
- id: flake8
name: Lint python code with flake8
additional_dependencies: [flake8-bugbear, Flake8-pyproject]

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

- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
rev: v6.2.5
hooks:
- id: rstcheck
name: Validate reStructuredText syntax
Expand All @@ -82,6 +82,13 @@ repos:

- repo: local
hooks:
- id: mkmaintainer
name: Sync maintainer issue templates
entry: .github/maintainer/mkmaintainer.py
files: .github/maintainer/
language: python
additional_dependencies: [PyYAML]

- id: annotations
name: Require "from __future__ import annotations"
language: pygrep
Expand Down
Loading