Skip to content

Commit a293bcb

Browse files
committed
feat: Update version handling and validation in transcribe_me module
- Add default version "0.0.0" if not specified in environment variable - Validate version format with three parts and all parts being digits in [transcribe_me/__init__.py]
1 parent d079dc8 commit a293bcb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

transcribe_me/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import os
22

3-
__version__ = os.environ.get("VERSION")
3+
__version__ = os.environ.get("VERSION", "0.0.0")
4+
5+
parts = __version__.split(".")
6+
if len(parts) != 3 or not all(part.isdigit() for part in parts):
7+
__version__ = "0.0.0"
48

5-
if __version__ is None:
6-
print("Error: VERSION environment variable is not set.")
7-
exit(1)

0 commit comments

Comments
 (0)