2424import requests .utils
2525
2626import gitlab .config
27+ from gitlab .__version__ import (
28+ __author__ ,
29+ __copyright__ ,
30+ __email__ ,
31+ __license__ ,
32+ __title__ ,
33+ __version__ ,
34+ )
2735from gitlab .const import * # noqa
2836from gitlab .exceptions import * # noqa
2937from gitlab import utils # noqa
3038from requests_toolbelt .multipart .encoder import MultipartEncoder
3139
3240
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-
4041warnings .filterwarnings ("default" , category = DeprecationWarning , module = "^gitlab" )
4142
4243REDIRECT_MSG = (
@@ -81,6 +82,7 @@ def __init__(
8182 per_page = None ,
8283 pagination = None ,
8384 order_by = None ,
85+ user_agent = USER_AGENT ,
8486 ):
8587
8688 self ._api_version = str (api_version )
@@ -90,7 +92,7 @@ def __init__(
9092 #: Timeout to use for requests to gitlab server
9193 self .timeout = timeout
9294 #: 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 }
9496
9597 #: Whether SSL certificates should be validated
9698 self .ssl_verify = ssl_verify
@@ -204,6 +206,7 @@ def from_config(cls, gitlab_id=None, config_files=None):
204206 per_page = config .per_page ,
205207 pagination = config .pagination ,
206208 order_by = config .order_by ,
209+ user_agent = config .user_agent ,
207210 )
208211
209212 def auth (self ):
0 commit comments