Skip to content

Commit

Permalink
include version number in __version__, if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
knipknap committed Aug 27, 2023
1 parent d39110f commit 31cf1bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions btl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
from .shape import Shape
from .tool import Tool
from .machine import Machine

try:
from importlib.metadata import version, PackageNotFoundError
except ImportError:
__version__ = "unknown; Python version too old"
else:
try:
__version__ = version("btl")
except PackageNotFoundError:
__version__ = "unknown version"

0 comments on commit 31cf1bb

Please sign in to comment.