Skip to content

Commit c8430a8

Browse files
committed
maint: include __version__, add RELEASE.md, use tbump
1 parent a7ea239 commit c8430a8

File tree

7 files changed

+101
-17
lines changed

7 files changed

+101
-17
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
include *.md
22
include LICENSE
3-
include version.py

RELEASE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# How to make a release
2+
3+
`batchspawner` is a package available on [PyPI] and on [conda-forge].
4+
5+
These are the instructions on how to make a release.
6+
7+
## Pre-requisites
8+
9+
- Push rights to this GitHub repository
10+
11+
## Steps to make a release
12+
13+
1. Create a PR updating `CHANGELOG.md` with [github-activity] and continue when
14+
its merged.
15+
16+
Advice on this procedure can be found in [this team compass
17+
issue](https://github.com/jupyterhub/team-compass/issues/563).
18+
19+
2. Checkout main and make sure it is up to date.
20+
21+
```shell
22+
git checkout main
23+
git fetch origin main
24+
git reset --hard origin/main
25+
```
26+
27+
3. Update the version, make commits, and push a git tag with `tbump`.
28+
29+
```shell
30+
pip install tbump
31+
```
32+
33+
`tbump` will ask for confirmation before doing anything.
34+
35+
```shell
36+
# Example versions to set: 1.0.0, 1.0.0b1
37+
VERSION=
38+
tbump ${VERSION}
39+
```
40+
41+
Following this, the [CI system] will build and publish a release.
42+
43+
4. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`.
44+
45+
```shell
46+
# Example version to set: 1.0.1.dev
47+
NEXT_VERSION=
48+
tbump --no-tag ${NEXT_VERSION}.dev
49+
```
50+
51+
5. Following the release to PyPI, an automated PR should arrive within 24 hours
52+
to [conda-forge/batchspawner-feedstock] with instructions on releasing to
53+
conda-forge. You are welcome to volunteer doing this, but aren't required as
54+
part of making this release to PyPI.
55+
56+
[github-activity]: https://github.com/executablebooks/github-activity
57+
[pypi]: https://pypi.org/project/batchspawner/
58+
[ci system]: https://github.com/jupyterhub/batchspawner/actions/workflows/release.yaml
59+
[conda-forge]: https://anaconda.org/conda-forge/batchspawner
60+
[conda-forge/batchspawner-feedstock]: https://github.com/conda-forge/batchspawner-feedstock

batchspawner/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from .batchspawner import *
2+
from ._version import __version__, version_info
23
from . import api

batchspawner/_version.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# __version__ should be updated using tbump, based on configuration in
2+
# pyproject.toml, according to instructions in RELEASE.md.
3+
#
4+
__version__ = "1.3.0.dev"
5+
6+
# version_info looks like (1, 2, 3, "dev") if __version__ is 1.2.3.dev
7+
version_info = tuple(int(p) if p.isdigit() else p for p in __version__.split("."))

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
4+
5+
6+
# tbump is used to simplify and standardize the release process when updating
7+
# the version, making a git commit and tag, and pushing changes.
8+
#
9+
# ref: https://github.com/your-tools/tbump#readme
10+
#
11+
[tool.tbump]
12+
github_url = "https://github.com/jupyterhub/tmpauthenticator"
13+
14+
[tool.tbump.version]
15+
current = "1.3.0.dev"
16+
regex = '''
17+
(?P<major>\d+)
18+
\.
19+
(?P<minor>\d+)
20+
\.
21+
(?P<patch>\d+)
22+
(?P<pre>((a|b|rc)\d+)|)
23+
\.?
24+
(?P<dev>(?<=\.)dev\d*|)
25+
'''
26+
27+
[tool.tbump.git]
28+
message_template = "Bump to {new_version}"
29+
tag_template = "v{new_version}"
30+
31+
[[tool.tbump.file]]
32+
src = "setup.py"
33+
34+
[[tool.tbump.file]]
35+
src = "batchspawner/_version.py"

setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
with open("README.md") as f:
44
long_description = f.read()
55

6-
# Get the current package version.
7-
version_ns = {}
8-
with open("version.py") as f:
9-
exec(f.read(), {}, version_ns)
10-
116
setup(
127
name="batchspawner",
138
entry_points={
149
"console_scripts": ["batchspawner-singleuser=batchspawner.singleuser:main"],
1510
},
1611
packages=["batchspawner"],
17-
version=version_ns["__version__"],
12+
version="1.3.0.dev",
1813
description="""Batchspawner: A spawner for Jupyterhub to spawn notebooks using batch resource managers.""",
1914
long_description=long_description,
2015
long_description_content_type="text/markdown",

version.py

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

0 commit comments

Comments
 (0)