Skip to content

Commit

Permalink
Fix bump version script (#22)
Browse files Browse the repository at this point in the history
* Fix bump version script

* Fix dependencies
  • Loading branch information
fcollonval authored Feb 26, 2023
1 parent 3b08262 commit 9cfcdf5
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
pip install "jupyterlab~=3.1" jupyterlab_rise*.whl
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "jupyterlab_rise.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-rise.*OK"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:

token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# jupyterlab_rise

[![Extension status](https://img.shields.io/badge/status-draft-critical 'Not yet working')](https://jupyterlab-contrib.github.io/index.html)[![Github Actions Status](https://github.com/jupyterlab-contrib/rise/workflows/Build/badge.svg)](https://github.com/jupyterlab-contrib/rise/actions/workflows/build.yml)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab-contrib/rise/main?urlpath=lab/tree/examples/README.ipynb)
[![Extension status](https://img.shields.io/badge/status-draft-critical 'Not yet working')](https://jupyterlab-contrib.github.io/index.html) [![Github Actions Status](https://github.com/jupyterlab-contrib/rise/workflows/Build/badge.svg)](https://github.com/jupyterlab-contrib/rise/actions/workflows/build.yml) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab-contrib/rise/main?urlpath=lab/tree/examples/README.ipynb) [![PyPI](https://img.shields.io/pypi/v/jupyterlab-rise)](https://pypi.org/project/jupyterlab-rise/)

RISE: "Live" Reveal.js JupyterLab Slideshow extension.

Expand Down Expand Up @@ -41,6 +41,7 @@ The `jlpm` command is JupyterLab's pinned version of
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
jupyter server extension enable jupyterlab_rise
# Rebuild extension Typescript source after making changes
jlpm build
```
Expand Down
26 changes: 8 additions & 18 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Making a new release of jupyterlab_rise

The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser) (preferred method).

## Manual release

Expand All @@ -15,11 +15,10 @@ Python package. Before generating a package, we first need to install `build`.
pip install build twine hatch
```

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

```bash
hatch version <new-version>
python scripts/bump_version.py <new-version>
```

To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
Expand Down Expand Up @@ -49,20 +48,11 @@ npm publish --access public

The extension repository should already be compatible with the Jupyter Releaser.

Check out the [workflow documentation](https://github.com/jupyter-server/jupyter_releaser#typical-workflow) for more information.
Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information.

Here is a summary of the steps to cut a new release:

- Fork the [`jupyter-releaser` repo](https://github.com/jupyter-server/jupyter_releaser)
- Add `ADMIN_GITHUB_TOKEN`, `PYPI_TOKEN` and `NPM_TOKEN` to the Github Secrets in the fork
- Go to the Actions panel
- Run the "Draft Changelog" workflow
- Merge the Changelog PR
- Run the "Draft Release" workflow
- Run the "Publish Release" workflow

## Publishing to `conda-forge`

If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html

Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically.
- Go to the _Actions_ panel on this repository
- Run the _Step 1: Prep Release_ workflow
- Check the draft release
- Run the _Step 2 Publish Release_ workflow providing the URL of the draft release.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"jupyterlab>=3.0.0,<4",
]
dynamic = ["version", "description", "authors", "urls", "keywords"]

Expand Down
17 changes: 17 additions & 0 deletions scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,24 @@
LERNA_CMD = "jlpm run lerna version --no-push --force-publish --no-git-tag-version"


def install_dependencies() -> None:
pkgs = []
try:
import hatch
except ImportError:
pkgs.append("hatch")
try:
import jupyterlab
except ImportError:
pkgs.append("jupyterlab~=3.1")

if pkgs:
run([sys.executable, "-m", "pip", "install"] + pkgs)


def bump(force: bool, spec: str) -> None:
install_dependencies()

HERE = Path(__file__).parent.parent.resolve()
output = check_output(
shlex.split("git status --porcelain"), cwd=HERE, encoding="utf-8"
Expand Down

0 comments on commit 9cfcdf5

Please sign in to comment.