Make __version__ global available for all supported python versions
1 unresolved thread
1 unresolved thread
Extract the version information from the packaging and set it as version global. For the still supported python 3.7 this also handles the installation of the importlib-metadata
package.
Merge request reports
Activity
1 1 """ My Awesome Package """ 2 3 try: 4 from importlib import metadata 5 except ImportError: # for Python<3.8 6 import importlib_metadata as metadata 7 8 __version__ = metadata.version("my-awseome-app") This name must match the setup.cfg name, unfortunately there is no easy / non-ugly way to extract this automatically so no single source of truth.
Here is the 'ugly' way: https://stackoverflow.com/a/60351412
mentioned in commit 057e7a1b
mentioned in issue #2 (closed)
Please register or sign in to reply