Skip to content

Commit 8790319

Browse files
authored
Maintenance cleanup (#457)
1 parent efa0f28 commit 8790319

File tree

7 files changed

+75
-28
lines changed

7 files changed

+75
-28
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
fail-fast: false
4747
matrix:
4848
os: [ubuntu-latest, windows-latest, macos-latest]
49-
python-version: ["3.8", "3.10"]
49+
python-version: ["3.8", "3.11"]
5050
steps:
5151
- uses: actions/checkout@v2
5252
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

.pre-commit-config.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,24 @@ repos:
2828
files: \.py$
2929
args: [--profile=black]
3030

31-
- repo: https://github.com/pre-commit/mirrors-prettier
32-
rev: v3.0.0-alpha.3
31+
- repo: https://github.com/abravalheri/validate-pyproject
32+
rev: v0.10.1
3333
hooks:
34-
- id: prettier
34+
- id: validate-pyproject
35+
stages: [manual]
36+
37+
- repo: https://github.com/executablebooks/mdformat
38+
rev: 0.7.16
39+
hooks:
40+
- id: mdformat
41+
additional_dependencies:
42+
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3543

3644
- repo: https://github.com/asottile/pyupgrade
3745
rev: v3.1.0
3846
hooks:
3947
- id: pyupgrade
40-
args: [--py37-plus]
48+
args: [--py38-plus]
4149

4250
- repo: https://github.com/john-hen/Flake8-pyproject
4351
rev: 1.1.0.post0

docs/source/get_started/making_release_from_releaser.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ already uses Jupyter Releaser.
1111
## Set up
1212

1313
- Fork `jupyter_releaser`
14+
1415
- Generate a [GitHub Access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with access to target GitHub repo to run GitHub Actions
16+
1517
- Add the token as `ADMIN_GITHUB_TOKEN` in the [repository secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) of your fork. The token must have `repo` and `workflow` scopes.
18+
1619
- If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons.
20+
1721
- You can store the token as `PYPI_TOKEN` in your fork's `Secrets`.
1822

1923
- Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows:
@@ -35,8 +39,11 @@ already uses Jupyter Releaser.
3539
## Prep Release
3640
3741
- Go to the "Actions" tab in your fork of `jupyter_releaser`
42+
3843
- Select the "Step 1: Prep Release" workflow on the left
44+
3945
- Click on the "Run workflow" dropdown button on the right
46+
4047
- Fill in the appropriate parameters
4148
4249
![Prep Release Workflow Dialog](../images/prep_release.png)
@@ -62,29 +69,40 @@ already uses Jupyter Releaser.
6269
![Draft GitHub Release](../images/draft_github_release.png)
6370
6471
- Review the contents, fixing typos or otherwise editing as necessary.
72+
6573
- If there is a section called "Other Merged PRs", it means those PRs did not have one of the appropriate labels. If desired, you can go label those PRs and then re-run the workflow, or move the entries manually to the desired section. The appropriate labels are: bug, maintenance, enhancement, feature, and documentation.
6674
6775
## Publish Release
6876
6977
- Return to your fork of `jupyter_releaser`
78+
7079
- Click on the "Actions" tab
80+
7181
- Select the "Publish Release" workflow on the left
82+
7283
- Click on the "Run workflow" button on the right
84+
7385
- Fill in the target repository
86+
7487
- (Optional) Fill in draft GitHub Release URL given by the Changelog PR.
7588
If you leave it blank it will use the most recent draft GitHub release.
7689
7790
![Publish Release Workflow Dialog](../images/publish_release.png)
7891
7992
- The workflow will finish the GitHub release and publish assets to the appropriate registries.
93+
8094
- If the workflow is not targeting the default branch, it will also generate a forward-port pull request for the changelog entry to the default branch.
95+
8196
- When the workflow finishes it will print a link to the GitHub release and the forward-port PR (if appropriate) in the "\*\* Next Step \*\*" output.
8297
8398
![Publish Release Workflow Next Step](../images/publish_release_next_step.png)
8499
85100
- **Note** If the publish portion fails you can attempt to publish the draft GitHub release given by the URL in the "\*\* Failure Message \*\*" using the "Publish Release" workflow again. It will skip past the asset creation phase
86101
and move into asset publish.
102+
87103
- **Note** GitHub Actions caches the secrets used on a given workflow run. So if you run into an auth issue, you'll
88104
need to run a new workflow instead of re-running the existing workflow.
105+
89106
- Review and merge the forward-port PR if applicable
107+
90108
- Announce the release on appropriate channels

docs/source/get_started/making_release_from_repo.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,31 @@ already uses Jupyter Releaser using workflows on its own repository.
1111
## Prep Release
1212

1313
- Go to the "Actions" tab in the repository.
14+
1415
- Select the "Step 1: Prep Release" workflow on the left
16+
1517
- Click on the "Run workflow" dropdown button on the right
18+
1619
- Fill in the appropriate parameters
1720

1821
![Prep Release Workflow Dialog](../images/prep_release_repo.png)
1922

2023
- The "New Version Spec" will usually be the full version (e.g. 0.7.1). Repos using `tbump` can also use:
24+
2125
- "next" or "patch" option, which will bump the micro version (or the build version in the case of a prerelease).
2226
Note: The "next" and "patch" options are not available when using dev versions, you must use explicit versions
2327
instead.
2428
- "minor" option, which will bump to the next minor version directly.
2529
- "release" option, which will start making prereleases (a0, a1...)
30+
2631
- Use the "since" field to select PRs prior to the latest tag to include in the release
32+
2733
- Type "true" in the "since the last stable git tag" if you would like to include PRs since the last non-prerelease version tagged on the target repository and branch.
34+
2835
- The additional "Post Version Spec" field should be used if your repo uses a dev version (e.g. 0.7.0.dev0)
36+
2937
- The workflow will use the GitHub API to find the relevant pull requests and make an appropriate changelog entry.
38+
3039
- The workflow will create a draft GitHub release to the target
3140
repository and branch, with the draft changelog contents.
3241

@@ -39,27 +48,36 @@ already uses Jupyter Releaser using workflows on its own repository.
3948
![Draft GitHub Release](../images/draft_github_release.png)
4049

4150
- Review the contents, fixing typos or otherwise editing as necessary.
51+
4252
- If there is a section called "Other Merged PRs", it means those PRs did not have one of the appropriate labels. If desired, you can go label those PRs and then re-run the workflow, or move the entries manually to the desired section. The appropriate labels are: bug, maintenance, enhancement, feature, and documentation.
4353

4454
## Publish Release
4555

4656
- Return to "Actions" tab for the repository
57+
4758
- Select the "Publish Release" workflow on the left
59+
4860
- Click on the "Run workflow" button on the right
61+
4962
- (Optional) Fill in draft GitHub Release URL given by the Changelog PR.
5063
If you leave it blank it will use the most recent draft GitHub release.
5164

5265
![Publish Release Workflow Dialog](../images/publish_release_repo.png)
5366

5467
- The workflow will finish the GitHub release and publish assets to the appropriate registries.
68+
5569
- If the workflow is not targeting the default branch, it will also generate a forward-port pull request for the changelog entry to the default branch.
70+
5671
- When the workflow finishes it will print a link to the GitHub release and the forward-port PR (if appropriate) in the "\*\* Next Step \*\*" output.
5772

5873
![Publish Release Workflow Next Step](../images/publish_release_next_step.png)
5974

6075
- **Note** If the publish portion fails you can attempt to publish the draft GitHub release given by the URL in the "\*\* Failure Message \*\*" using the "Publish Release" workflow again. It will skip past the asset creation phase
6176
and move into asset publish.
77+
6278
- **Note** GitHub Actions caches the secrets used on a given workflow run. So if you run into an auth issue, you'll
6379
need to run a new workflow instead of re-running the existing workflow.
80+
6481
- Review and merge the forward-port PR if applicable
82+
6583
- Announce the release on appropriate channels

docs/source/how_to_guides/convert_repo_from_releaser.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ See checklist below for details:
1717
A. Prep the `jupyter_releaser` fork:
1818

1919
- [ ] Clone this repository onto your GitHub user account.
20+
2021
- [ ] Add a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with access to target GitHub repo to run
21-
GitHub Actions, saved as `ADMIN_GITHUB_TOKEN` in the
22-
[repository secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository).
23-
The token will need "public_repo", and "repo:status" permissions.
22+
GitHub Actions, saved as `ADMIN_GITHUB_TOKEN` in the
23+
[repository secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository).
24+
The token will need "public_repo", and "repo:status" permissions.
25+
2426
- [ ] Add access token for the [PyPI registry](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github) stored as `PYPI_TOKEN`.
25-
_Note_ For security reasons, it is recommended that you scope the access
26-
to a single repository, and use a variable called `PYPI_TOKEN_MAP` that is formatted as follows:
27+
_Note_ For security reasons, it is recommended that you scope the access
28+
to a single repository, and use a variable called `PYPI_TOKEN_MAP` that is formatted as follows:
2729

2830
```text
2931
owner1/repo1,token1
@@ -47,7 +49,7 @@ B. Prep target repository:
4749
- Note that [directives](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#syntax-directives) can still be used
4850
- [ ] Add HTML start and end comment markers to Changelog file - see example in [CHANGELOG.md](https://github.com/jupyter-server/jupyter_releaser/blob/main/CHANGELOG.md) (view in raw mode)
4951
- [ ] We recommend using [hatch](https://hatch.pypa.io/latest/) for your
50-
build system and for version handling.
52+
build system and for version handling.
5153
- If previously providing `version_info` like `version_info = (1, 7, 0, '.dev', '0')`, use a pattern like the one below in your version file:
5254

5355
```toml
@@ -94,7 +96,7 @@ version_info = tuple(parts)
9496
````
9597
9698
- [ ] Add a workflow that uses the [`enforce-label`](https://github.com/jupyterlab/maintainer-tools#enforce-labels) action from `jupyterlab/maintainer-tools` to ensure that all PRs have on of the triage labels used to
97-
categorize the changelog.
99+
categorize the changelog.
98100

99101
- [ ] Update or add `RELEASE.md` that describes the onboarding and release process, e.g. [jupyter_server](https://github.com/jupyter-server/jupyter_server/blob/main/RELEASE.md).
100102

docs/source/how_to_guides/convert_repo_from_repo.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Follow the steps below to convert a repository to use Jupyter Releaser for relea
44

55
## Prerequisites
66

7-
See [hecklist below for details:
7+
See \[hecklist below for details:
88

99
- Markdown changelog
1010
- Bump version configuration (if using Python), for example [hatch](https://hatch.pypa.io/latest/)
@@ -15,28 +15,28 @@ See [hecklist below for details:
1515
## Checklist for Adoption
1616

1717
- [ ] Add a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), preferably from a "machine user" GitHub
18-
account that has admin access to the repository. The token itself will
19-
need "public_repo", and "repo:status" permissions. Save the token as
20-
`ADMIN_GITHUB_TOKEN`
21-
in the [repository secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository). We need this
22-
access token to allow for branch protection rules, which block the pushing
23-
of commits when using the `GITHUB_TOKEN`, even when run from an admin user
24-
account.
18+
account that has admin access to the repository. The token itself will
19+
need "public_repo", and "repo:status" permissions. Save the token as
20+
`ADMIN_GITHUB_TOKEN`
21+
in the [repository secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository). We need this
22+
access token to allow for branch protection rules, which block the pushing
23+
of commits when using the `GITHUB_TOKEN`, even when run from an admin user
24+
account.
2525
- [ ] Add access token for the [PyPI registry](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github) stored as `PYPI_TOKEN`.
26-
_Note_ For security reasons, it is recommended that you scope the access
27-
to a single repository. Additionally, this token should belong to a
28-
machine account and not a user account.
26+
_Note_ For security reasons, it is recommended that you scope the access
27+
to a single repository. Additionally, this token should belong to a
28+
machine account and not a user account.
2929
- [ ] If needed, add access token for [npm](https://docs.npmjs.com/creating-and-viewing-access-tokens), saved as `NPM_TOKEN`. Again this should
30-
be created using a machine account that only has publish access.
30+
be created using a machine account that only has publish access.
3131
- [ ] Ensure that only trusted users with 2FA have admin access to the
32-
repository, since they will be able to trigger releases.
32+
repository, since they will be able to trigger releases.
3333
- [ ] Switch to Markdown Changelog
3434
- We recommend [MyST](https://myst-parser.readthedocs.io/en/latest/?badge=latest), especially if some of your docs are in reStructuredText.
3535
- Can use `pandoc -s changelog.rst -o changelog.md` and some hand edits as needed.
3636
- Note that [directives](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#syntax-directives) can still be used
3737
- [ ] Add HTML start and end comment markers to Changelog file - see example in [CHANGELOG.md](https://github.com/jupyter-server/jupyter_releaser/blob/main/CHANGELOG.md) (view in raw mode)
3838
- [ ] We recommend using [hatch](https://hatch.pypa.io/latest/) for your
39-
build system and for version handling.
39+
build system and for version handling.
4040
- If previously providing `version_info` like `version_info = (1, 7, 0, '.dev', '0')`, use a pattern like the one below in your version file:
4141

4242
```toml
@@ -81,7 +81,7 @@ version_info = tuple(parts)
8181
```
8282

8383
- [ ] Add a workflow that uses the [`enforce-label`](https://github.com/jupyterlab/maintainer-tools#enforce-labels) action from `jupyterlab/maintainer-tools` to ensure that all PRs have on of the triage labels used to
84-
categorize the changelog.
84+
categorize the changelog.
8585

8686
- [ ] Update or add `RELEASE.md` that describes the onboarding and release process, e.g. [jupyter_server](https://github.com/jupyter-server/jupyter_server/blob/main/RELEASE.md).
8787

@@ -96,7 +96,7 @@ version_info = tuple(parts)
9696
- [ ] Try out the `Prep Release` and `Publish Release` process against a fork of the target repo first so you don't accidentally push tags and GitHub releases to the source repository. Set the `TWINE_REPOSITORY_URL` environment variable to `https://test.pypi.org/legacy/` in the "Finalize Release" action part of the workflow
9797

9898
- [ ] Try the `Publish Release` process using a prerelease version on the main
99-
repository before publishing a final version.
99+
repository before publishing a final version.
100100

101101
## Backport Branches
102102

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ classifiers = [
1717
"Programming Language :: Python :: 3.8",
1818
"Programming Language :: Python :: 3.9",
1919
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
2021
]
2122
urls = {Homepage = "https://jupyter.org"}
2223
requires-python = ">=3.8"

0 commit comments

Comments
 (0)