Skip to content

Commit bf637ed

Browse files
authored
Allow releasing from repo (#899)
* allow releasing from repo * lint
1 parent a83129e commit bf637ed

File tree

8 files changed

+105
-16
lines changed

8 files changed

+105
-16
lines changed

.github/workflows/prep-release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
since:
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
18+
since_last_stable:
19+
description: "Use PRs with activity since the last stable git tag"
20+
required: false
21+
type: boolean
22+
jobs:
23+
prep_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Prep Release
29+
id: prep-release
30+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
31+
with:
32+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
33+
version_spec: ${{ github.event.inputs.version_spec }}
34+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
35+
target: ${{ github.event.inputs.target }}
36+
branch: ${{ github.event.inputs.branch }}
37+
since: ${{ github.event.inputs.since }}
38+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
39+
40+
- name: "** Next Step **"
41+
run: |
42+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

.github/workflows/publish-release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Step 2: Publish Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: "The target branch"
7+
required: false
8+
release_url:
9+
description: "The URL of the draft GitHub release"
10+
required: false
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
21+
- name: Populate Release
22+
id: populate-release
23+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
24+
with:
25+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
26+
target: ${{ github.event.inputs.target }}
27+
branch: ${{ github.event.inputs.branch }}
28+
release_url: ${{ github.event.inputs.release_url }}
29+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
30+
31+
- name: Finalize Release
32+
id: finalize-release
33+
env:
34+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
35+
PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
36+
TWINE_USERNAME: __token__
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
39+
with:
40+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
41+
target: ${{ github.event.inputs.target }}
42+
release_url: ${{ steps.populate-release.outputs.release_url }}
43+
44+
- name: "** Next Step **"
45+
if: ${{ success() }}
46+
run: |
47+
echo "Verify the final release"
48+
echo ${{ steps.finalize-release.outputs.release_url }}
49+
50+
- name: "** Failure Message **"
51+
if: ${{ failure() }}
52+
run: |
53+
echo "Failed to Publish the Draft Release Url:"
54+
echo ${{ steps.populate-release.outputs.release_url }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
- id: black
3535

3636
- repo: https://github.com/charliermarsh/ruff-pre-commit
37-
rev: v0.0.165
37+
rev: v0.0.177
3838
hooks:
3939
- id: ruff
4040
args: ["--fix"]

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Using `jupyter_releaser`
44

5-
The recommended way to make a release is to use [`jupyter_releaser`](https://github.com/jupyter-server/jupyter_releaser#checklist-for-adoption).
5+
The recommended way to make a release is to use [`jupyter_releaser`](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html).
66

77
## Manual Release
88

jupyter_client/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from .connect import ConnectionFileMixin
2222
from .session import Session
2323

24-
2524
# some utilities to validate message structure, these might get moved elsewhere
2625
# if they prove to have more generic utility
2726

jupyter_client/clientabc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# -----------------------------------------------------------------------------
1111
import abc
1212

13-
1413
# -----------------------------------------------------------------------------
1514
# Main kernel client class
1615
# -----------------------------------------------------------------------------

jupyter_client/threaded.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from .session import Session
1919

20-
2120
# Local imports
2221
# import ZMQError in top-level namespace, to avoid ugly attribute-error messages
2322
# during garbage collection of threads at exit

pyproject.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ docs = [
6666
"pydata_sphinx_theme",
6767
"sphinxcontrib_github_alt",
6868
]
69-
lint = [
70-
"black>=22.6.0",
71-
"mdformat>0.7",
72-
"ruff>=0.0.156",
73-
]
74-
typing = [
75-
"mypy>=0.990"
76-
]
7769

7870
[project.scripts]
7971
jupyter-kernelspec = "jupyter_client.kernelspecapp:KernelSpecApp.launch_instance"
@@ -106,13 +98,17 @@ test = "python -m pytest -vv --cov jupyter_client --cov-branch --cov-report term
10698
nowarn = "test -W default {args}"
10799

108100
[tool.hatch.envs.typing]
109-
features = ["test", "typing"]
101+
features = ["test"]
110102
dependencies = ["mypy>=0.990"]
111103
[tool.hatch.envs.typing.scripts]
112104
test = "mypy --install-types --non-interactive {args:.}"
113105

114106
[tool.hatch.envs.lint]
115-
features = ["lint"]
107+
dependencies = [
108+
"black>=22.6.0",
109+
"mdformat>0.7",
110+
"ruff==0.0.177",
111+
]
116112
[tool.hatch.envs.lint.scripts]
117113
style = [
118114
"ruff {args:.}",
@@ -198,7 +194,7 @@ ignore = [
198194
# Line too long
199195
"E501",
200196
# Relative imports are banned
201-
"I252",
197+
"TID252",
202198
# Boolean ... in function definition
203199
"FBT001",
204200
"FBT002",

0 commit comments

Comments
 (0)