1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 01:16:14 +01:00

Move __version__ from osc.core to osc

Fixes issues with circular module deps during tests
that caused that osc.core wasn't available
This commit is contained in:
Daniel Mach 2022-08-24 09:53:26 +02:00
parent 9cc4a5594f
commit 4848b0f42a
3 changed files with 21 additions and 7 deletions

View File

@ -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

View File

@ -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`')

View File

@ -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