Skip to content

Commit e1af67d

Browse files
authored
Use hatch envs and clean up workflows (#436)
1 parent 0ebbc0b commit e1af67d

File tree

13 files changed

+84
-106
lines changed

13 files changed

+84
-106
lines changed

.github/actions/common/action.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/check-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
check_release:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v2
18-
19-
- name: Setup
20-
uses: ./.github/actions/common
21-
16+
- uses: actions/checkout@v2
17+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
18+
- name: Install Dependencies
19+
shell: bash
20+
run: |
21+
pip install -e .
2222
- name: Check Release
2323
uses: ./.github/actions/check-release
2424
with:

.github/workflows/generate-changelog.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ jobs:
2626
matrix:
2727
python-version: ["3.10"]
2828
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v2
31-
32-
- name: Setup
33-
uses: ./.github/actions/common
34-
35-
- name: Install the Extra Python dependencies
29+
- uses: actions/checkout@v2
30+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
31+
- name: Install Dependencies
32+
shell: bash
3633
run: |
3734
sudo apt-get install pandoc
38-
pip install pypandoc
35+
pip install -e .
36+
pip install pandoc
3937
4038
- name: Generate the Changelog
4139
env:

.github/workflows/prep-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ jobs:
2626
prep_release:
2727
runs-on: ubuntu-latest
2828
steps:
29+
- uses: actions/checkout@v2
2930
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
31+
- name: Install Dependencies
32+
shell: bash
33+
run: |
34+
pip install -e .
3035
- name: Prep Release
3136
id: prep-release
3237
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2

.github/workflows/publish-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ jobs:
1919
publish_release:
2020
runs-on: ubuntu-latest
2121
steps:
22+
- uses: actions/checkout@v2
2223
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
24+
- name: Install Dependencies
25+
shell: bash
26+
run: |
27+
pip install -e .
2328
- name: Populate Release
2429
id: populate-release
2530
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2

.github/workflows/test.yml

Lines changed: 24 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
branches: ["main"]
55
pull_request:
66

7+
defaults:
8+
run:
9+
shell: bash -eux {0}
10+
711
jobs:
812
# Run "pre-commit run --all-files --hook-stage=manual"
913
pre-commit:
@@ -28,7 +32,6 @@ jobs:
2832
2933
check-links:
3034
runs-on: ubuntu-20.04
31-
3235
steps:
3336
- uses: actions/checkout@v2
3437
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -42,35 +45,34 @@ jobs:
4245
os: [ubuntu-latest, windows-latest, macos-latest]
4346
python-version: ["3.8", "3.10"]
4447
steps:
45-
- name: Checkout
46-
uses: actions/checkout@v2
47-
48-
- name: Setup
49-
uses: ./.github/actions/common
50-
51-
- name: Install the Test dependencies
52-
run: |
53-
pip install -e .[test] codecov
48+
- uses: actions/checkout@v2
49+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
5450

5551
- name: Run the tests with coverage on Ubuntu
5652
if: ${{ matrix.os == 'ubuntu-latest' }}
5753
run: |
58-
python -m pytest -vv --cov jupyter_releaser --cov-branch --cov-report term-missing:skip-covered
54+
hatch run cov:test
55+
pip install codecov
56+
codecov
5957
60-
- name: Run the tests on Windows and macOS
58+
- name: Run the tests on Windows and MacOS
6159
if: ${{ matrix.os != 'ubuntu-latest' }}
62-
run: |
63-
python -m pytest -vv -s
60+
run: hatch run test:test -s
6461

65-
- name: Verify the Generate Changelog Action
66-
if: ${{ matrix.os == 'ubuntu' }}
67-
env:
62+
generate-changelog:
63+
runs-on: ubuntu-20.04
64+
timeout-minutes: 10
65+
steps:
66+
- uses: actions/checkout@v2
67+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
68+
- env:
6869
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6970
RH_REPOSITORY: jupyter-server/jupyter_releaser
7071
RH_SINCE: v0.10.2
7172
RH_UNTIL: v0.10.3
7273
run: |
7374
set -eux
75+
pip install -e .
7476
python -m jupyter_releaser.actions.generate-changelog
7577
cat CHANGELOG_ENTRY.md
7678
# Check for version entry contents
@@ -85,55 +87,19 @@ jobs:
8587
python -m jupyter_releaser.actions.generate-changelog
8688
cat CHANGELOG_ENTRY.md
8789
88-
- name: Coverage
89-
run: |
90-
codecov
91-
9290
docs:
9391
runs-on: ubuntu-20.04
9492
timeout-minutes: 10
95-
defaults:
96-
run:
97-
shell: bash -l {0}
9893
steps:
99-
- name: Checkout
100-
uses: actions/checkout@v2
101-
102-
- name: Setup
103-
uses: ./.github/actions/common
104-
105-
- name: Setup conda
106-
uses: conda-incubator/setup-miniconda@v2
107-
with:
108-
auto-update-conda: true
109-
activate-environment: jupyter_releaser_documentation
110-
environment-file: docs/environment.yml
111-
python-version: "3.10"
112-
auto-activate-base: false
113-
114-
- name: Cache conda
115-
uses: actions/cache@v2
116-
with:
117-
path: ~/conda_pkgs_dir
118-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
119-
hashFiles('docs/environment.yml') }}
120-
121-
- name: Build docs
122-
run: |
123-
set -eux
124-
pip install .
125-
pushd docs
126-
make html
127-
popd
94+
- uses: actions/checkout@v2
95+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
96+
- run: hatch run docs:build
12897

12998
check_local_actions:
13099
runs-on: ubuntu-latest
131100
steps:
132-
- name: Checkout
133-
uses: actions/checkout@v2
134-
135-
- name: Setup
136-
uses: ./.github/actions/common
101+
- uses: actions/checkout@v2
102+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
137103

138104
- name: prep-release
139105
uses: ./.github/actions/prep-release

docs/environment.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/source/background/theory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Detailed workflows are available to draft a changelog, draft a release, publish
4848
- Adds a commit that includes the hashes of the dist files
4949
- Creates an annotated version tag in standard format
5050
- If given, bumps the version using the post version spec. he post version
51-
spec can also be given as a setting, [Write Releaser Config Guide](../how_to_guides/write_config.html#automatic-dev-versions).
51+
spec can also be given as a setting, [Write Releaser Config Guide](../how_to_guides/write_config.md).
5252
- Verifies that the SHA of the most recent commit has not changed on the target
5353
branch, preventing a mismatch of release commit.
5454
- Pushes the commits and tag to the target `branch`

docs/source/how_to_guides/convert_repo_from_releaser.md

Lines changed: 2 additions & 2 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 [checklist](#Checklist-for-Adoption) below for details:
7+
See checklist below for details:
88

99
- Markdown changelog
1010
- Bump version configuration (if using Python), for example [tbump](https://github.com/dmerejkowsky/tbump)
@@ -94,7 +94,7 @@ _Note_ The check release action needs `contents: write` [permission](https://doc
9494

9595
- [ ] Set up a fork of `jupyter-releaser` if you have not yet done so.
9696
- [ ] Run through the release process, targeting this repo and the appropriate branch
97-
- [ ] Optionally add [configuration](#Configuration) to the target repository if non-standard options or hooks are needed.
97+
- [ ] Optionally add configuration to the target repository if non-standard options or hooks are needed.
9898
- [ ] If desired, add `check_release` job, changelog, and `tbump` support to other active release branches
9999
- [ ] Try out the `Draft Changelog` and `Draft Release` process against a fork of the target repo first so you don't accidentally push tags and GitHub releases to the source repository.
100100
- [ ] Try the `Publish Release` process using a prerelease version before publishing a final version.

docs/source/how_to_guides/convert_repo_from_repo.md

Lines changed: 2 additions & 2 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 [checklist](#Checklist-for-Adoption) 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/)
@@ -76,7 +76,7 @@ _Note_ The check release action needs `contents: write` [permission](https://doc
7676

7777
- [ ] Copy `prep-release.yml` and `publish-release.yml` from the `example-workflows` folder in this repository.
7878

79-
- [ ] Optionally add [configuration](#Configuration) to the repository if non-standard options or hooks are needed.
79+
- [ ] Optionally add configuration to the repository if non-standard options or hooks are needed.
8080

8181
- [ ] If desired, add `check_release` job, changelog, and `hatch` support to other active release branches
8282

0 commit comments

Comments
 (0)