CP-2184 add bumpversion

This commit is contained in:
Bruno Marques 2024-05-28 12:00:30 +01:00
parent 92b9a0126c
commit 6ed1302e09
5 changed files with 21 additions and 3 deletions

6
.bumpversion.cfg Normal file
View File

@ -0,0 +1,6 @@
[bumpversion]
current_version = 1.0.0
commit = False
tag = False
[bumpversion:glob:*/src/thousandeyes_sdk/client/version.py]

View File

@ -1,6 +1,6 @@
[project] [project]
name = "thousandeyes-sdk-client" name = "thousandeyes-sdk-client"
version = "1.0.0" dynamic = ["version"]
authors = [ authors = [
{ name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" }
] ]
@ -13,6 +13,9 @@ dependencies = [
"typing-extensions >=4.7.1", "typing-extensions >=4.7.1",
] ]
[tool.setuptools.dynamic]
version = {attr = "thousandeyes_sdk.client.__version__"}
[project.optional-dependencies] [project.optional-dependencies]
test = [ test = [
"pytest~=7.1.3", "pytest~=7.1.3",

View File

@ -2,3 +2,8 @@ from . import exceptions
from .api_client import ApiClient from .api_client import ApiClient
from .api_response import ApiResponse from .api_response import ApiResponse
from .configuration import Configuration from .configuration import Configuration
from .version import Version
import os.path
__version__ = Version.get()

View File

@ -67,8 +67,6 @@ class ApiClient:
if header_name is not None: if header_name is not None:
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
self.cookie = cookie self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'ThousandEyesSDK-Python/1.0.0'
self.client_side_validation = configuration.client_side_validation self.client_side_validation = configuration.client_side_validation
def __enter__(self): def __enter__(self):

View File

@ -0,0 +1,6 @@
import os.path
class Version:
@staticmethod
def get() -> str:
return "1.0.0"