Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling >=0.25"]
requires = ["hatchling >=1.5"]
build-backend = "hatchling.build"

[project]
Expand Down
25 changes: 15 additions & 10 deletions traitlets/_version.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
version_info = (5, 4, 0)
__version__ = "5.4.0"
"""
handle the current version info of traitlets.
"""
import re
from typing import List

# unlike `.dev`, alpha, beta and rc _must not_ have dots,
# or the wheel and tgz won't look to pip like the same version.
# Version string must appear intact for hatch versioning
__version__ = "5.4.0"

assert __version__ == (
".".join(map(str, version_info)).replace(".b", "b").replace(".a", "a").replace(".rc", "rc")
)
assert ".b" not in __version__
assert ".a" not in __version__
assert ".rc" not in __version__
# 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__)
assert match is not None
parts: List[object] = [int(match[part]) for part in ["major", "minor", "patch"]]
if match["rest"]:
parts.append(match["rest"])
version_info = tuple(parts)