mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Gracefully fall back when version metadata is missing (#4324)
* Update __init__.py * Update manim/__init__.py Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at> --------- Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
This commit is contained in:
parent
a234ff31e8
commit
f63ba71f04
1 changed files with 9 additions and 2 deletions
|
|
@ -1,9 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import annotations
|
||||
|
||||
from importlib.metadata import version
|
||||
from importlib.metadata import PackageNotFoundError, version
|
||||
|
||||
__version__ = version(__name__)
|
||||
# Use installed distribution version if available; otherwise fall back to a
|
||||
# sensible default so that importing from a source checkout works without an
|
||||
# editable install (pip install -e .).
|
||||
try:
|
||||
__version__ = version(__name__)
|
||||
except PackageNotFoundError:
|
||||
# Package is not installed; provide a fallback version string.
|
||||
__version__ = "0.0.0+unknown"
|
||||
|
||||
|
||||
# isort: off
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue