File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from typing import Dict , TextIO
22from labkey .utils import json_dumps
3- from . import __version__
43import requests
4+ import importlib .metadata
55from requests .exceptions import RequestException
66from labkey .exceptions import (
77 RequestError ,
1414
1515API_KEY_TOKEN = "apikey"
1616CSRF_TOKEN = "X-LABKEY-CSRF"
17+ client_version = importlib .metadata .version ("labkey" )
1718
1819
1920def handle_response (response , non_json_response = False ):
@@ -76,7 +77,9 @@ def __init__(
7677 self ._disable_csrf = disable_csrf
7778 self .allow_redirects = allow_redirects
7879 self ._session = requests .Session ()
79- self ._session .headers .update ({"User-Agent" : f"LabKey Python API/{ __version__ } " })
80+ self ._session .headers .update ({"User-Agent" : f"LabKey Python API/{ client_version } " })
81+
82+ print (f"User Agent header: LabKey Python API/{ client_version } " )
8083
8184 if self ._use_ssl :
8285 self ._scheme = "https://"
You can’t perform that action at this time.
0 commit comments