From 6ed1302e0913d678793425f5c0ae7c7d2fb77cab Mon Sep 17 00:00:00 2001 From: Bruno Marques Date: Tue, 28 May 2024 12:00:30 +0100 Subject: [PATCH] CP-2184 add bumpversion --- .bumpversion.cfg | 6 ++++++ thousandeyes-sdk-client/pyproject.toml | 5 ++++- .../src/thousandeyes_sdk/client/__init__.py | 5 +++++ .../src/thousandeyes_sdk/client/api_client.py | 2 -- .../src/thousandeyes_sdk/client/version.py | 6 ++++++ 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .bumpversion.cfg create mode 100644 thousandeyes-sdk-client/src/thousandeyes_sdk/client/version.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..af7b5a11 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,6 @@ +[bumpversion] +current_version = 1.0.0 +commit = False +tag = False + +[bumpversion:glob:*/src/thousandeyes_sdk/client/version.py] diff --git a/thousandeyes-sdk-client/pyproject.toml b/thousandeyes-sdk-client/pyproject.toml index d48858de..53c1e41c 100644 --- a/thousandeyes-sdk-client/pyproject.toml +++ b/thousandeyes-sdk-client/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "thousandeyes-sdk-client" -version = "1.0.0" +dynamic = ["version"] authors = [ { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } ] @@ -13,6 +13,9 @@ dependencies = [ "typing-extensions >=4.7.1", ] +[tool.setuptools.dynamic] +version = {attr = "thousandeyes_sdk.client.__version__"} + [project.optional-dependencies] test = [ "pytest~=7.1.3", diff --git a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/__init__.py b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/__init__.py index d5c718a8..62ce833e 100644 --- a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/__init__.py +++ b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/__init__.py @@ -2,3 +2,8 @@ from . import exceptions from .api_client import ApiClient from .api_response import ApiResponse from .configuration import Configuration +from .version import Version + +import os.path + +__version__ = Version.get() diff --git a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/api_client.py b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/api_client.py index d677f1f2..e79dbab5 100644 --- a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/api_client.py +++ b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/api_client.py @@ -67,8 +67,6 @@ class ApiClient: if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'ThousandEyesSDK-Python/1.0.0' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/thousandeyes-sdk-client/src/thousandeyes_sdk/client/version.py b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/version.py new file mode 100644 index 00000000..85acbddc --- /dev/null +++ b/thousandeyes-sdk-client/src/thousandeyes_sdk/client/version.py @@ -0,0 +1,6 @@ +import os.path + +class Version: + @staticmethod + def get() -> str: + return "1.0.0"