Skip to content

Commit

Permalink
Clean up version info handling (#620)
Browse files Browse the repository at this point in the history
* use tbump fields

* add version template

* fix name

* Update pyproject.toml
  • Loading branch information
blink1073 committed Nov 28, 2021
1 parent 3b72d9c commit e5cb6c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 2 additions & 12 deletions jupyter_server/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,5 @@
store the current version info of the server.
"""
import re

# Version string must appear intact for tbump versioning
__version__ = "1.12.1"

# Build up version_info tuple for backwards compatibility
pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)"
match = re.match(pattern, __version__)
parts = [int(match[part]) for part in ["major", "minor", "patch"]]
if match["rest"]:
parts.append(match["rest"])
version_info = tuple(parts)
version_info = (1, 12, 1, "", "")
__version__ = ".".join(map(str, version_info[:3])) + "".join(version_info[3:])
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ tag_template = "v{new_version}"

[[tool.tbump.file]]
src = "jupyter_server/_version.py"
version_template = '({major}, {minor}, {patch}, "{channel}", "{release}")'

[[tool.tbump.field]]
name = "channel"
default = ""

[[tool.tbump.field]]
name = "release"
default = ""

0 comments on commit e5cb6c4

Please sign in to comment.