Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: move hcloud.__version__.VERSION to hcloud.__version__ #397

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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