mirror of
https://github.com/andrewthetechie/py-healthchecks.io.git
synced 2025-12-06 01:28:26 +01:00
get versioning working from git tags
This commit is contained in:
@@ -2,7 +2,7 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [prereleased]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -77,5 +77,13 @@ show_error_codes = true
|
|||||||
show_error_context = true
|
show_error_context = true
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
|
[tool.poetry-dynamic-versioning]
|
||||||
|
enable = true
|
||||||
|
vcs = "git"
|
||||||
|
dirty = true
|
||||||
|
|
||||||
|
[tool.poetry-dynamic-versioning.substitution]
|
||||||
|
files = ["src/healthchecks_io/__init__.py"]
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"""Py Healthchecks.Io."""
|
"""Py Healthchecks.Io."""
|
||||||
VERSION = "0.1" # noqa: E402
|
# set by poetry-dynamic-versioning
|
||||||
|
__version__ = "0.0.0" # noqa: E402
|
||||||
|
|
||||||
from .client import AsyncClient # noqa: F401, E402
|
from .client import AsyncClient # noqa: F401, E402
|
||||||
from .client import Client # noqa: F401, E402
|
from .client import Client # noqa: F401, E402
|
||||||
@@ -29,4 +30,5 @@ __all__ = [
|
|||||||
"CheckStatuses",
|
"CheckStatuses",
|
||||||
"Integration",
|
"Integration",
|
||||||
"Badges",
|
"Badges",
|
||||||
|
"__version__",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from typing import Tuple
|
|||||||
from httpx import AsyncClient as HTTPXAsyncClient
|
from httpx import AsyncClient as HTTPXAsyncClient
|
||||||
|
|
||||||
from ._abstract import AbstractClient
|
from ._abstract import AbstractClient
|
||||||
from healthchecks_io import VERSION
|
from healthchecks_io import __version__ as client_version
|
||||||
from healthchecks_io.schemas import Badges
|
from healthchecks_io.schemas import Badges
|
||||||
from healthchecks_io.schemas import Check
|
from healthchecks_io.schemas import Check
|
||||||
from healthchecks_io.schemas import CheckCreate
|
from healthchecks_io.schemas import CheckCreate
|
||||||
@@ -51,7 +51,9 @@ class AsyncClient(AbstractClient):
|
|||||||
api_version=api_version,
|
api_version=api_version,
|
||||||
)
|
)
|
||||||
self._client.headers["X-Api-Key"] = self._api_key
|
self._client.headers["X-Api-Key"] = self._api_key
|
||||||
self._client.headers["user-agent"] = f"py-healthchecks.io-async/{VERSION}"
|
self._client.headers[
|
||||||
|
"user-agent"
|
||||||
|
] = f"py-healthchecks.io-async/{client_version}"
|
||||||
self._client.headers["Content-type"] = "application/json"
|
self._client.headers["Content-type"] = "application/json"
|
||||||
|
|
||||||
def _finalizer_method(self) -> None:
|
def _finalizer_method(self) -> None:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from typing import Tuple
|
|||||||
from httpx import Client as HTTPXClient
|
from httpx import Client as HTTPXClient
|
||||||
|
|
||||||
from ._abstract import AbstractClient
|
from ._abstract import AbstractClient
|
||||||
from healthchecks_io import VERSION
|
from healthchecks_io import __version__ as client_version
|
||||||
from healthchecks_io.schemas import badges
|
from healthchecks_io.schemas import badges
|
||||||
from healthchecks_io.schemas import Check
|
from healthchecks_io.schemas import Check
|
||||||
from healthchecks_io.schemas import CheckCreate
|
from healthchecks_io.schemas import CheckCreate
|
||||||
@@ -47,7 +47,7 @@ class Client(AbstractClient):
|
|||||||
api_version=api_version,
|
api_version=api_version,
|
||||||
)
|
)
|
||||||
self._client.headers["X-Api-Key"] = self._api_key
|
self._client.headers["X-Api-Key"] = self._api_key
|
||||||
self._client.headers["user-agent"] = f"py-healthchecks.io/{VERSION}"
|
self._client.headers["user-agent"] = f"py-healthchecks.io/{client_version}"
|
||||||
self._client.headers["Content-type"] = "application/json"
|
self._client.headers["Content-type"] = "application/json"
|
||||||
|
|
||||||
def _finalizer_method(self) -> None:
|
def _finalizer_method(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user