24
24
import requests .utils
25
25
26
26
import gitlab .config
27
+ from gitlab .__version__ import (
28
+ __author__ ,
29
+ __copyright__ ,
30
+ __email__ ,
31
+ __license__ ,
32
+ __title__ ,
33
+ __version__ ,
34
+ )
27
35
from gitlab .const import * # noqa
28
36
from gitlab .exceptions import * # noqa
29
37
from gitlab import utils # noqa
30
38
from requests_toolbelt .multipart .encoder import MultipartEncoder
31
39
32
40
33
- __title__ = "python-gitlab"
34
- __version__ = "2.6.0"
35
- __author__ = "Gauvain Pocentek"
36
- __email__ = "gauvainpocentek@gmail.com"
37
- __license__ = "LGPL3"
38
- __copyright__ = "Copyright 2013-2019 Gauvain Pocentek"
39
-
40
41
warnings .filterwarnings ("default" ,category = DeprecationWarning ,module = "^gitlab" )
41
42
42
43
REDIRECT_MSG = (
@@ -81,6 +82,7 @@ def __init__(
81
82
per_page = None ,
82
83
pagination = None ,
83
84
order_by = None ,
85
+ user_agent = USER_AGENT ,
84
86
):
85
87
86
88
self ._api_version = str (api_version )
@@ -90,7 +92,7 @@ def __init__(
90
92
#: Timeout to use for requests to gitlab server
91
93
self .timeout = timeout
92
94
#: Headers that will be used in request to GitLab
93
- self .headers = {"User-Agent" :"%s/%s" % ( __title__ , __version__ ) }
95
+ self .headers = {"User-Agent" :user_agent }
94
96
95
97
#: Whether SSL certificates should be validated
96
98
self .ssl_verify = ssl_verify
@@ -204,6 +206,7 @@ def from_config(cls, gitlab_id=None, config_files=None):
204
206
per_page = config .per_page ,
205
207
pagination = config .pagination ,
206
208
order_by = config .order_by ,
209
+ user_agent = config .user_agent ,
207
210
)
208
211
209
212
def auth (self ):