Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
Use importlib.metadata to dynamically populate module metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
thebigmunch committed Feb 23, 2020
1 parent 8d19b03 commit db3480b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ flake8-builtins = { version = "^1.0", optional = true }
flake8-comprehensions = { version = ">=2.0,<=4.0", optional = true }
flake8-import-order = { version = "^0.18", optional = true }
flake8-import-order-tbm = { version = "^1.0", optional = true }
importlib-metadata = { version = "^1.5.0", python = "<3.8", optional = true }
nox = { version = "^2019", optional = true }
sphinx = { version = "^2.0", optional = true}
sphinx-argparse = { version = "^0.2", optional = true }
Expand Down
21 changes: 14 additions & 7 deletions src/google_music_scripts/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@
'__version_info__',
]

__title__ = 'google-music-scripts'
__summary__ = 'A collection of scripts to interact with Google Music.'
__url__ = 'https://github.com/thebigmunch/google-music-scripts'
try:
from importlib.metadata import metadata
except ImportError:
from importlib_metadata import metadata

__version__ = '4.2.0'
meta = metadata('google-music-scripts')

__title__ = meta['Name']
__summary__ = meta['Summary']
__url__ = meta['Home-page']

__version__ = meta['Version']
__version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit())

__author__ = 'thebigmunch'
__author_email__ = '[email protected]'
__author__ = meta['Author']
__author_email__ = meta['Author-email']

__license__ = 'MIT'
__license__ = meta['License']
__copyright__ = f'2018-2020 {__author__} <{__author_email__}>'

0 comments on commit db3480b

Please sign in to comment.