Skip to content

Commit e5cb6c4

Browse files
authored
Clean up version info handling (#620)
* use tbump fields * add version template * fix name * Update pyproject.toml
1 parent 3b72d9c commit e5cb6c4

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

jupyter_server/_version.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,5 @@
22
store the current version info of the server.
33
44
"""
5-
import re
6-
7-
# Version string must appear intact for tbump versioning
8-
__version__ = "1.12.1"
9-
10-
# Build up version_info tuple for backwards compatibility
11-
pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)"
12-
match = re.match(pattern, __version__)
13-
parts = [int(match[part]) for part in ["major", "minor", "patch"]]
14-
if match["rest"]:
15-
parts.append(match["rest"])
16-
version_info = tuple(parts)
5+
version_info = (1, 12, 1, "", "")
6+
__version__ = ".".join(map(str, version_info[:3])) + "".join(version_info[3:])

pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ tag_template = "v{new_version}"
3030

3131
[[tool.tbump.file]]
3232
src = "jupyter_server/_version.py"
33+
version_template = '({major}, {minor}, {patch}, "{channel}", "{release}")'
34+
35+
[[tool.tbump.field]]
36+
name = "channel"
37+
default = ""
38+
39+
[[tool.tbump.field]]
40+
name = "release"
41+
default = ""

0 commit comments

Comments
 (0)