diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 84a7bc4..9a5b28d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -51,22 +51,13 @@ jobs: - name: Check tag in package run: | - if ! grep -q "__VERSION__ = \"$TAG_VERSION\"" ./docker2mqtt/__init__.py; then + if ! grep -q "__version__ = \"$TAG_VERSION\"" ./docker2mqtt/__init__.py; then echo "Error: Tag version $TAG_VERSION not found in the package." exit 1 else echo "Success: Tag version $TAG_VERSION found in package." fi - - name: Check tag in setup.cfg - run: | - if ! grep -q "version = $TAG_VERSION" setup.cfg; then - echo "Error: Tag version $TAG_VERSION not found in the setup.cfg." - exit 1 - else - echo "Success: Tag version $TAG_VERSION found in setup.cfg." - fi - - name: Check changelog entry run: | if [ github.ref =~ 'refs/tags/[0-9]+\\.[0-9]+\\.[0-9]+$' ]; then diff --git a/docker2mqtt/__init__.py b/docker2mqtt/__init__.py index dbace58..17e25d0 100644 --- a/docker2mqtt/__init__.py +++ b/docker2mqtt/__init__.py @@ -1,6 +1,6 @@ """docker2mqtt package.""" -__VERSION__ = "2.0.5" +__version__ = "2.0.5" from .const import ( ANSI_ESCAPE, diff --git a/docker2mqtt/docker2mqtt.py b/docker2mqtt/docker2mqtt.py index 533395f..5ea95b4 100755 --- a/docker2mqtt/docker2mqtt.py +++ b/docker2mqtt/docker2mqtt.py @@ -22,7 +22,7 @@ from docker2mqtt.helpers import clean_for_discovery -from . import __VERSION__ +from . import __version__ from .const import ( ANSI_ESCAPE, DESTROYED_CONTAINER_TTL_DEFAULT, @@ -118,7 +118,7 @@ class Docker2Mqtt: """ # Version - version: str = __VERSION__ + version: str = __version__ cfg: Docker2MqttConfig @@ -1193,7 +1193,7 @@ def main() -> None: """ parser = argparse.ArgumentParser() parser.add_argument( - "--version", action="version", version=f"%(prog)s {__VERSION__}" + "--version", action="version", version=f"%(prog)s {__version__}" ) parser.add_argument( "--name", diff --git a/setup.cfg b/setup.cfg index 10fc1e3..a8196af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = docker2mqtt -version = 2.0.5 +version = attr: docker2mqtt.__version__ author = Cyrill Raccaud author_email = cyrill.raccaud+pypi@gmail.com description = Send your docker stats and and events to mqtt and discovery them in home assistant.