Skip to content

Commit 8bc5432

Browse files
authored
Merge pull request #12 from jupyter-server/first-release-fixes
Pre-release clean up
2 parents 1ef0ebc + 5b17742 commit 8bc5432

File tree

10 files changed

+24
-28
lines changed

10 files changed

+24
-28
lines changed

.github/actions/draft-changelog/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ runs:
4444
export RH_DRY_RUN=${{ inputs.dry_run }}
4545
export RH_REF=${GITHUB_REF}
4646
47+
# Install Jupyter Releaser from git
48+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
49+
4750
# Draft Changelog
48-
pip install -q jupyter-releaser
4951
python -m jupyter_releaser.actions.draft_changelog

.github/actions/draft-release/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@ runs:
4848
export RH_POST_VERSION_SPEC=${{ inputs.post_version_spec }}
4949
export RH_DRY_RUN=${{ inputs.dry_run }}
5050
51+
# Install Jupyter Releaser from git
52+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
53+
5154
# Draft Release
5255
python -m jupyter_releaser.actions.draft_release

.github/actions/publish-release/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ runs:
3131
export RH_DRY_RUN=${{ inputs.dry_run }}
3232
export release_url=${{ inputs.release_url }}
3333
34+
# Install Jupyter Releaser from git
35+
pip install -q git+https://github.com/jupyter-server/jupyter_releaser.git@v1
36+
3437
# Publish release
35-
pip install -q jupyter-releaser
3638
python -m jupyter_releaser.actions.publish_release

.github/workflows/draft-changelog.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ jobs:
2929
- name: Upgrade packaging dependencies
3030
run: |
3131
pip install --upgrade pip setuptools wheel --user
32-
- name: Install Dependencies
33-
run: |
34-
pip install -e .
3532
- name: Draft Changelog
3633
id: draft-changelog
37-
uses: ./.github/actions/draft-changelog
34+
uses: jupyter-server/jupyter_server/.github/actions/draft-changelog@v1
3835
with:
3936
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
4037
version_spec: ${{ github.event.inputs.version_spec }}

.github/workflows/draft-release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ jobs:
3535
- name: Upgrade packaging dependencies
3636
run: |
3737
pip install --upgrade pip setuptools wheel --user
38-
- name: Install Dependencies
39-
run: |
40-
pip install -e .
4138
- name: Create Draft GitHub Release
4239
id: draft-release
43-
uses: ./.github/actions/draft-release
40+
uses: jupyter-server/release_helper/.github/actions/draft-release@v1
4441
with:
4542
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
4643
target: ${{ github.event.inputs.target }}

.github/workflows/publish-release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ jobs:
2323
- name: Upgrade packaging dependencies
2424
run: |
2525
pip install --upgrade pip setuptools wheel --user
26-
- name: Install Dependencies
27-
run: |
28-
pip install -e .
2926
- name: Publish Release
3027
id: publish-release
3128
env:
3229
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} # use final when ready to publish
3330
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
34-
uses: ./.github/actions/publish-release
31+
uses: jupyter-server/jupyter_releaser/.github/actions/publish-release@v1
3532
with:
3633
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
3734
release_url: ${{ github.event.inputs.release_url }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ dmypy.json
130130

131131
# Local git checkout
132132
.jupyter_releaser_checkout
133+
134+
# macOS
135+
.DS_Store

jupyter_releaser/changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def get_version_entry(branch, repo, version, *, auth=None, resolve_backports=Fal
7575
md = generate_activity_md(
7676
repo,
7777
since=since,
78-
until=until,
7978
kind="pr",
8079
heading_level=2,
8180
auth=auth,
@@ -87,6 +86,7 @@ def get_version_entry(branch, repo, version, *, auth=None, resolve_backports=Fal
8786
return f"## {version}\n\nNo merged PRs"
8887

8988
entry = md.replace("[full changelog]", "[Full Changelog]")
89+
entry = entry.replace("...None", f"...{until}")
9090

9191
entry = entry.splitlines()[2:]
9292

jupyter_releaser/lib.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,13 @@ def make_changelog_pr(auth, branch, repo, title, commit_message, body, dry_run=F
128128
pr_branch = f"changelog-{uuid.uuid1().hex}"
129129

130130
if not dry_run:
131-
util.run("git --no-pager diff")
132-
util.run("git stash")
131+
dirty = util.run("git --no-pager diff --stat") != ""
132+
if dirty:
133+
util.run("git stash")
133134
util.run(f"git fetch origin {branch}")
134135
util.run(f"git checkout -b {pr_branch} origin/{branch}")
135-
util.run("git stash apply")
136+
if dirty:
137+
util.run("git stash apply")
136138

137139
# Add a commit with the message
138140
util.run(commit_message)
@@ -363,6 +365,8 @@ def publish_assets(dist_dir, npm_token, npm_cmd, twine_cmd, dry_run, use_checkou
363365
os.environ["TWINE_USERNAME"] = "foo"
364366
os.environ["TWINE_PASSWORD"] = "bar"
365367
npm_cmd = "npm publish --dry-run"
368+
else:
369+
os.environ.setdefault("TWINE_USERNAME", "__token__")
366370

367371
if npm_token:
368372
npm.handle_auth_token(npm_token)

jupyter_releaser/tests/test_functions.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,8 @@ def test_get_changelog_version_entry(py_package, mocker):
5353
mocked_gen.return_value = testutil.CHANGELOG_ENTRY
5454
branch = "foo"
5555
resp = changelog.get_version_entry(branch, "bar/baz", version)
56-
until = util.run(f'git --no-pager log -n 1 origin/{branch} --pretty=format:"%H"')
57-
until = until.replace("%", "")
5856
mocked_gen.assert_called_with(
59-
"bar/baz",
60-
since="v0.0.1",
61-
kind="pr",
62-
branch=branch,
63-
heading_level=2,
64-
auth=None,
65-
until=until,
57+
"bar/baz", since="v0.0.1", kind="pr", branch=branch, heading_level=2, auth=None
6658
)
6759

6860
assert f"## {version}" in resp
@@ -75,7 +67,6 @@ def test_get_changelog_version_entry(py_package, mocker):
7567
mocked_gen.assert_called_with(
7668
"bar/baz",
7769
since="v0.0.1",
78-
until=until,
7970
kind="pr",
8071
branch=branch,
8172
heading_level=2,

0 commit comments

Comments
 (0)