Skip to content
Snippets Groups Projects

Make __version__ global available for all supported python versions

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

Checking pipeline status.

Merged by Klaas KliffenKlaas Kliffen Jun 28, 2022 (Jun 28, 2022 7:26am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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")
  • Klaas Kliffen approved this merge request

    approved this merge request

  • Klaas Kliffen mentioned in commit 057e7a1b

    mentioned in commit 057e7a1b

  • mentioned in issue #2 (closed)

  • Please register or sign in to reply
    Loading