Skip to content

Commit a7b0bd3

Browse files
committed
Wrapping package version into try/catch
1 parent 96eaf26 commit a7b0bd3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mrmat_python_api_flask/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
log = logging.getLogger(__name__)
4545
console = Console()
4646

47-
__version__ = importlib.metadata.version('mrmat-python-api-flask')
47+
try:
48+
__version__ = importlib.metadata.version('mrmat-python-api-flask')
49+
except importlib.metadata.PackageNotFoundError:
50+
# You have not actually installed the wheel yet. We may be within CI so pick that version or fall back
51+
__version__ = os.environ.get('MRMAT_VERSION', '0.0.0.dev0')
52+
4853
db = SQLAlchemy()
4954
ma = Marshmallow()
5055
migrate = Migrate()

0 commit comments

Comments
 (0)