urban-meal-delivery/src/urban_meal_delivery/__init__.py

37 lines
934 B
Python
Raw Normal View History

"""Source code for the urban-meal-delivery research project.
Example:
>>> import urban_meal_delivery as umd
>>> umd.__version__ != '0.0.0'
True
"""
import os as _os
from importlib import metadata as _metadata
from urban_meal_delivery import configuration as _configuration
try:
_pkg_info = _metadata.metadata(__name__)
except _metadata.PackageNotFoundError: # pragma: no cover
__author__ = 'unknown'
__pkg_name__ = 'unknown'
__version__ = 'unknown'
else:
__author__ = _pkg_info['author']
__pkg_name__ = _pkg_info['name']
__version__ = _pkg_info['version']
# Global `config` object to be used in the package.
config: _configuration.Config = _configuration.make_config(
'testing' if _os.getenv('TESTING') else 'production',
)
# Import `db` down here as it depends on `config`.
# pylint:disable=wrong-import-position
from urban_meal_delivery import db # noqa:E402,F401 isort:skip