From e3bf3596b1e5ff0bc4916c93f55e6b6729bb9c27 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Sun, 17 Jul 2022 17:09:58 +0200 Subject: [PATCH 1/3] chore: add configuration for Dependabot --- .github/dependabot.yml | 9 +++++++++ influxdb_client/__init__.py | 4 ++-- influxdb_client/_async/api_client.py | 4 ++-- influxdb_client/_sync/api_client.py | 4 ++-- influxdb_client/configuration.py | 4 ++-- influxdb_client/version.py | 2 +- setup.py | 4 ++-- tests/test_WriteApiBatching.py | 4 ++-- 8 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..dc1c467f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "docutils" diff --git a/influxdb_client/__init__.py b/influxdb_client/__init__.py index a3a89037..fbb4d6b8 100644 --- a/influxdb_client/__init__.py +++ b/influxdb_client/__init__.py @@ -383,6 +383,6 @@ from influxdb_client.client.logging_handler import InfluxLoggingHandler from influxdb_client.client.write.point import Point -from influxdb_client.version import CLIENT_VERSION +from influxdb_client.version import VERSION -__version__ = CLIENT_VERSION +__version__ = VERSION diff --git a/influxdb_client/_async/api_client.py b/influxdb_client/_async/api_client.py index 59fa75b3..f8fc2742 100644 --- a/influxdb_client/_async/api_client.py +++ b/influxdb_client/_async/api_client.py @@ -76,8 +76,8 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - from influxdb_client import CLIENT_VERSION - self.user_agent = f'influxdb-client-python/{CLIENT_VERSION}' + from influxdb_client import VERSION + self.user_agent = f'influxdb-client-python/{VERSION}' async def close(self): """Dispose api client.""" diff --git a/influxdb_client/_sync/api_client.py b/influxdb_client/_sync/api_client.py index e22df488..f61ef26c 100644 --- a/influxdb_client/_sync/api_client.py +++ b/influxdb_client/_sync/api_client.py @@ -76,8 +76,8 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - from influxdb_client import CLIENT_VERSION - self.user_agent = f'influxdb-client-python/{CLIENT_VERSION}' + from influxdb_client import VERSION + self.user_agent = f'influxdb-client-python/{VERSION}' def __del__(self): """Dispose pools.""" diff --git a/influxdb_client/configuration.py b/influxdb_client/configuration.py index e6ef2c61..e9d95c78 100644 --- a/influxdb_client/configuration.py +++ b/influxdb_client/configuration.py @@ -249,13 +249,13 @@ def to_debug_report(self): :return: The report for debugging. """ - from influxdb_client import CLIENT_VERSION + from influxdb_client import VERSION return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2.0.0\n"\ "SDK Package Version: {client_version}".\ - format(env=sys.platform, pyversion=sys.version, client_version=CLIENT_VERSION) + format(env=sys.platform, pyversion=sys.version, client_version=VERSION) def update_request_header_params(self, path: str, params: dict): """Update header params based on custom settings. diff --git a/influxdb_client/version.py b/influxdb_client/version.py index 840fa2cc..54497056 100644 --- a/influxdb_client/version.py +++ b/influxdb_client/version.py @@ -1,3 +1,3 @@ """Version of the Client that is used in User-Agent header.""" -CLIENT_VERSION = '1.31.0dev0' +VERSION = '1.31.0dev0' diff --git a/setup.py b/setup.py index 1eae7d66..c64480c9 100644 --- a/setup.py +++ b/setup.py @@ -49,11 +49,11 @@ meta = {} with open(Path(__file__).parent / 'influxdb_client' / 'version.py') as f: - exec('\n'.join(l for l in f if l.startswith('CLIENT_VERSION')), meta) + exec('\n'.join(l for l in f if l.startswith('VERSION')), meta) setup( name=NAME, - version=meta['CLIENT_VERSION'], + version=meta['VERSION'], description="InfluxDB 2.0 Python client library", long_description=readme, url="https://github.com/influxdata/influxdb-client-python", diff --git a/tests/test_WriteApiBatching.py b/tests/test_WriteApiBatching.py index e9e91034..f939e6bc 100644 --- a/tests/test_WriteApiBatching.py +++ b/tests/test_WriteApiBatching.py @@ -13,7 +13,7 @@ from rx import operators as ops import influxdb_client -from influxdb_client import WritePrecision, InfluxDBClient, CLIENT_VERSION +from influxdb_client import WritePrecision, InfluxDBClient, VERSION from influxdb_client.client.exceptions import InfluxDBError from influxdb_client.client.write.point import Point from influxdb_client.client.write_api import WriteOptions, WriteApi, PointSettings @@ -463,7 +463,7 @@ def test_user_agent_header(self): requests = httpretty.httpretty.latest_requests self.assertEqual(1, len(requests)) - self.assertEqual(f'influxdb-client-python/{CLIENT_VERSION}', requests[0].headers['User-Agent']) + self.assertEqual(f'influxdb-client-python/{VERSION}', requests[0].headers['User-Agent']) def test_to_low_flush_interval(self): From cc9b6bd5a86bf226c95023aaa21a3cfc8df86ebd Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Sun, 17 Jul 2022 17:11:56 +0200 Subject: [PATCH 2/3] chore: add configuration for Dependabot --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 87a744b3..e82a977a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,7 @@ meta = {} with open(Path(__file__).parent.parent / 'influxdb_client' / 'version.py') as f: - exec('\n'.join(l for l in f if l.startswith('CLIENT_VERSION')), meta) + exec('\n'.join(l for l in f if l.startswith('VERSION')), meta) def setup(app): @@ -37,9 +37,9 @@ def setup(app): autoclass_content = 'both' # The short X.Y version -version = meta['CLIENT_VERSION'] +version = meta['VERSION'] # The full version, including alpha/beta/rc tags -release = meta['CLIENT_VERSION'] +release = meta['VERSION'] # -- General configuration --------------------------------------------------- From ac4d6004b41dfbf6b059a9a551398eed644a55a0 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Sun, 17 Jul 2022 17:18:31 +0200 Subject: [PATCH 3/3] docs: clarify reason --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dc1c467f..5b9406e3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,4 +6,4 @@ updates: interval: "daily" open-pull-requests-limit: 10 ignore: - - dependency-name: "docutils" + - dependency-name: "docutils" # pinned version for readthedocs.org - https://github.com/influxdata/influxdb-client-python/pull/361