Skip to content

Commit

Permalink
feat!: move hcloud.__version__.VERSION to hcloud.__version__ (#397)
Browse files Browse the repository at this point in the history
Closes #234
  • Loading branch information
jooola committed Jul 2, 2024
1 parent 8e66f30 commit 4e3f638
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
".": {
"release-type": "python",
"package-name": "hcloud",
"extra-files": ["hcloud/__version__.py"]
"extra-files": ["hcloud/_version.py"]
}
}
}
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions hcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
APIException as APIException,
HCloudException as HCloudException,
)
from ._version import __version__ # noqa
3 changes: 0 additions & 3 deletions hcloud/__version__.py

This file was deleted.

4 changes: 2 additions & 2 deletions hcloud/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand Down
3 changes: 3 additions & 0 deletions hcloud/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from __future__ import annotations

__version__ = "1.35.0" # x-release-please-version
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4e3f638

Please sign in to comment.