diff --git a/osc/__init__.py b/osc/__init__.py index 475cc39e..1572977f 100644 --- a/osc/__init__.py +++ b/osc/__init__.py @@ -1,3 +1,19 @@ -__all__ = ['babysitter', 'core', 'commandline', 'oscerr', 'build', 'fetch', 'meter', 'grabber'] +__all__ = [ + 'babysitter', + 'build', + 'connection', + 'commandline', + 'core', + 'fetch', + 'grabber', + 'meter', + 'oscerr', + 'oscssl', +] + + +from .util import git_version +__version__ = git_version.get_version('1.0.0~b1') + # vim: sw=4 et diff --git a/osc/connection.py b/osc/connection.py index db7afd64..dd2acf4e 100644 --- a/osc/connection.py +++ b/osc/connection.py @@ -16,6 +16,7 @@ import urllib3.poolmanager import urllib3.response import urllib3.util +from . import __version__ from . import conf from . import oscerr from . import oscssl @@ -98,7 +99,7 @@ def get_proxy_manager(env): proxy_headers = urllib3.make_headers( proxy_basic_auth=proxy_purl.auth, - user_agent=f"osc/{core.__version__}", + user_agent=f"osc/{__version__}", ) manager = urllib3.ProxyManager(proxy_url, proxy_headers=proxy_headers) @@ -171,7 +172,7 @@ def http_request(method, url, headers=None, data=None, file=None): headers = urllib3.response.HTTPHeaderDict(headers or {}) # identify osc - headers.update(urllib3.make_headers(user_agent=f"osc/{core.__version__}")) + headers.update(urllib3.make_headers(user_agent=f"osc/{__version__}")) if data and file: raise RuntimeError('Specify either `data` or `file`') diff --git a/osc/core.py b/osc/core.py index f039315f..ed9257b9 100644 --- a/osc/core.py +++ b/osc/core.py @@ -4,10 +4,6 @@ # either version 2, or version 3 (at your option). -from .util import git_version -__version__ = git_version.get_version('1.0.0~b1') - - # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration # functionality to check_store_version(). @@ -37,6 +33,7 @@ try: except ImportError: distro = None +from . import __version__ from . import conf from . import oscerr from .connection import http_request, http_GET, http_POST, http_PUT, http_DELETE