Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/__init__.py
# Copyright (C) 2019 The Software Heritage developers | # Copyright (C) 2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from typing import Any, Dict | |||||
from typing import Any, Dict, Mapping | |||||
import pkg_resources | import pkg_resources | ||||
try: | try: | ||||
__version__ = pkg_resources.get_distribution('swh.loader.core').version | __version__ = pkg_resources.get_distribution('swh.loader.core').version | ||||
except pkg_resources.DistributionNotFound: | except pkg_resources.DistributionNotFound: | ||||
__version__ = 'devel' | __version__ = 'devel' | ||||
DEFAULT_PARAMS: Dict[str, Any] = { | DEFAULT_PARAMS: Dict[str, Any] = { | ||||
'headers': { | 'headers': { | ||||
'User-Agent': 'Software Heritage Loader (%s)' % ( | 'User-Agent': 'Software Heritage Loader (%s)' % ( | ||||
__version__ | __version__ | ||||
) | ) | ||||
} | } | ||||
} | } | ||||
def register() -> Mapping[str, Any]: | |||||
return { | |||||
'task_modules': ['%s.tasks' % __name__], | |||||
} |