diff --git a/.github/release-please-config.json b/.github/release-please-config.json index 4fccf055..7386f9a6 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -7,7 +7,7 @@ ".": { "release-type": "python", "package-name": "hcloud", - "extra-files": ["hcloud/__version__.py"] + "extra-files": ["hcloud/_version.py"] } } } diff --git a/docs/conf.py b/docs/conf.py index b3be9a7f..df08f92c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,7 +5,7 @@ from datetime import datetime sys.path.insert(0, os.path.abspath("..")) -from hcloud.__version__ import VERSION # noqa +import hcloud # noqa # Configuration file for the Sphinx documentation builder. # @@ -19,8 +19,8 @@ author = "Hetzner Cloud GmbH" copyright = f"{datetime.now().year}, {author}" -version = VERSION -release = VERSION +version = hcloud.__version__ +release = hcloud.__version__ # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/hcloud/__init__.py b/hcloud/__init__.py index 6b69b169..2cf99212 100644 --- a/hcloud/__init__.py +++ b/hcloud/__init__.py @@ -5,3 +5,4 @@ APIException as APIException, HCloudException as HCloudException, ) +from ._version import __version__ # noqa diff --git a/hcloud/__version__.py b/hcloud/__version__.py deleted file mode 100644 index d350d713..00000000 --- a/hcloud/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -from __future__ import annotations - -VERSION = "1.35.0" # x-release-please-version diff --git a/hcloud/_client.py b/hcloud/_client.py index a12f204c..37aa1bd7 100644 --- a/hcloud/_client.py +++ b/hcloud/_client.py @@ -5,8 +5,8 @@ import requests -from .__version__ import VERSION from ._exceptions import APIException +from ._version import __version__ from .actions import ActionsClient from .certificates import CertificatesClient from .datacenters import DatacentersClient @@ -29,7 +29,7 @@ class Client: """Base Client for accessing the Hetzner Cloud API""" - _version = VERSION + _version = __version__ _retry_wait_time = 0.5 __user_agent_prefix = "hcloud-python" diff --git a/hcloud/_version.py b/hcloud/_version.py new file mode 100644 index 00000000..a0954297 --- /dev/null +++ b/hcloud/_version.py @@ -0,0 +1,3 @@ +from __future__ import annotations + +__version__ = "1.35.0" # x-release-please-version diff --git a/setup.py b/setup.py index 3d98e02f..9d2cc96d 100644 --- a/setup.py +++ b/setup.py @@ -5,13 +5,9 @@ with open("README.md", encoding="utf-8") as readme_file: readme = readme_file.read() -version = {} -with open("hcloud/__version__.py", encoding="utf-8") as fp: - exec(fp.read(), version) - setup( name="hcloud", - version=version["VERSION"], + version="1.35.0", keywords="hcloud hetzner cloud", description="Official Hetzner Cloud python library", long_description=readme,