Skip to content

Fixed __version__ test to allow for semantic versioning #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2021
Merged
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
5 changes: 3 additions & 2 deletions dpctl/tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ def test___version__():
dpctl_ver = getattr(dpctl, "__version__", None)
assert type(dpctl_ver) is str
assert "unknown" not in dpctl_ver
# Reg expr from PEP-440
# Reg expr from PEP-440, relaxed to allow for semantic variant
# 0.9.0dev0 allowed, vs. PEP-440 compliant 0.9.0.dev0
reg_expr = (
r"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))"
r"*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev("
r"*((a|b|rc)(0|[1-9][0-9]*))?(\.?post(0|[1-9][0-9]*))?(\.?dev("
r"0|[1-9][0-9]*))?(\+.*)?$"
)
assert re.match(reg_expr, dpctl_ver) is not None