Skip to content

Commit

Permalink
Enable tbump for labextension again
Browse files Browse the repository at this point in the history
  • Loading branch information
meffmadd committed Dec 19, 2023
1 parent 32570aa commit 80ec36c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build_labextension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,10 @@ jobs:
working-directory: ./grader_labextension
run: |
python -m pip install --upgrade pip
pip install jupyter_packaging jupyterlab packaging setuptools twine build hatch-nodejs-version hatch-jupyter-builder
- name: Install dependencies
working-directory: ./grader_labextension
run: |
python -m pip install --upgrade pip
pip install build wheel twine hatch
pip install build wheel twine hatch jupyter_packaging packaging setuptools hatch-nodejs-version hatch-jupyter-builder
- name: Build package
working-directory: ./grader_labextension
run: python -m build -n
run: python -m build

# Upload Artifacts
- name: Archive labextension artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_labextension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
python-version: '3.10'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 3 additions & 4 deletions grader_labextension/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ packaging instructions are in the `pyproject.toml` file to wrap your extension i
Python package. Before generating a package, you first need to install some tools:

```bash
pip install build twine hatch
pip install build twine hatch tbump
```

Bump the version using `hatch`. By default this will create a tag.
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
Bump the version using `tbump`.

```bash
hatch version <new-version>
tbump <new-version>
```

Make sure to clean up all the development files before building the package:
Expand Down
25 changes: 22 additions & 3 deletions grader_labextension/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ test = [
"pytest-jupyter[server]>=0.6.0"
]

[tool.tbump.version]
current = "0.2.11"

regex = '''
(?P<major>\d+)
\.
(?P<minor>\d+)
\.
(?P<patch>\d+)
\-?
(?P<pre>((a|b|rc|dev|nightly)\d+)?)
'''

[tool.tbump.git]
message_template = "Bump labextension to {new_version}"
tag_template = "grader-labextension-{new_version}"

[[tool.tbump.file]]
src = "package.json"
search = "\"version\": \"{current_version}\""

# hatch uses nodejs i.e. package.json to determine version -> tbump changes version there which hatch references for build etc.
[tool.hatch.version]
source = "nodejs"

Expand All @@ -60,9 +82,6 @@ exclude = [".github", "binder"]
"jupyter-config/nb-config" = "etc/jupyter/jupyter_notebook_config.d"


[tool.tbump.version]
current = "0.1.35"

[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.5"]
build-function = "hatch_jupyter_builder.npm_builder"
Expand Down

0 comments on commit 80ec36c

Please sign in to comment.