Skip to content

Commit f7e80c0

Browse files
heitorPBxalelax
andauthored
fix: allow digits in the pre-release semver tag (#355)
#### Relevant issue or PR #### Description of changes Currently, tesseracts are not allowed to have digits in the pre-release section of the version/tag. This changes that behavior to allow that, e.g. `1.2.3-rc2`. #### Testing done Tested manually: ```console $ uv run tesseract build --tag 1.2.3-rc2 examples/vectoradd [i] Building image ... [i] Built image sha256:41b380c24c95, ['vectoradd:1.2.3-rc2'] ["vectoradd:1.2.3-rc2"] ``` --------- Signed-off-by: Heitor Pascoal de Bittencourt <heitorpbittencourt@gmail.com> Co-authored-by: Alessandro Angioi <alessandro.angioi@simulation.science>
1 parent 1c1b5c7 commit f7e80c0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tesseract_core/sdk/api_parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class TesseractConfig(BaseModel, validate_assignment=True):
172172
@classmethod
173173
def validate_version(cls, v: str) -> str:
174174
"""Validate that the version string is a valid semantic version."""
175-
version_pattern = r"""^\d+\.\d+\.\d+[a-zA-Z-]*$"""
175+
version_pattern = r"^\d+\.\d+\.\d+[a-zA-Z-0-9]*$"
176176

177177
if (not re.match(version_pattern, v)) and v != "unknown":
178178
raise ValueError(

tests/sdk_tests/test_api_parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def valid_tesseract_config() -> str:
4444
return dedent(
4545
"""
4646
name: foo
47-
version: "unknown"
47+
version: "1.2.3-rc2"
4848
4949
build_config:
5050
package_data:

0 commit comments

Comments
 (0)