From 29d57733cb2554fe964df9b500df774357c9b5e2 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 20 Jan 2025 22:39:24 +0100 Subject: [PATCH] Fix version import --- pyfritzhome/__init__.py | 1 + pyfritzhome/__version__.py | 3 +++ pyfritzhome/cli.py | 5 +---- setup.cfg | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 pyfritzhome/__version__.py diff --git a/pyfritzhome/__init__.py b/pyfritzhome/__init__.py index 10a76eb..c9e4a23 100644 --- a/pyfritzhome/__init__.py +++ b/pyfritzhome/__init__.py @@ -3,6 +3,7 @@ from .errors import InvalidError, LoginError, NotLoggedInError from .fritzhome import Fritzhome from .fritzhomedevice import FritzhomeDevice +from .__version__ import __version__ # noqa: F401 __all__ = ( "Fritzhome", diff --git a/pyfritzhome/__version__.py b/pyfritzhome/__version__.py new file mode 100644 index 0000000..c376f65 --- /dev/null +++ b/pyfritzhome/__version__.py @@ -0,0 +1,3 @@ +"""The fritzhome version""" + +__version__ = "0.6.13" diff --git a/pyfritzhome/cli.py b/pyfritzhome/cli.py index d3fa5f9..264f6d2 100644 --- a/pyfritzhome/cli.py +++ b/pyfritzhome/cli.py @@ -6,10 +6,7 @@ import logging import argparse -try: - from version import __version__ -except ImportError: - __version__ = "dev" +from .__version__ import __version__ from pyfritzhome import Fritzhome diff --git a/setup.cfg b/setup.cfg index 80cdde3..61c9be5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyfritzhome -version = 0.6.13 +version = attr: pyfritzhome.__version__ description = Fritz!Box Smarthome Python Library long_description = file: README.rst long_description_content_type = text/x-rst