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

Fix version import #112

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

flabbamann
Copy link
Contributor

@flabbamann flabbamann commented Jan 20, 2025

Refactor import of current project version.

@coveralls
Copy link

Coverage Status

coverage: 95.791% (+0.01%) from 95.778%
when pulling d7925ec on flabbamann:version-import
into 869fd9c on hthiery:master.

Copy link
Collaborator

@mib1185 mib1185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't remove the version from the setup.cfg as this is the place for meta data - further I would make use of the importlib.metadata.version

from version import __version__
except ImportError:
__version__ = "dev"
from .__version__ import __version__

from pyfritzhome import Fritzhome
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from pyfritzhome import Fritzhome
from pyfritzhome import Fritzhome, __version__

from version import __version__
except ImportError:
__version__ = "dev"
from .__version__ import __version__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from .__version__ import __version__

Comment on lines +1 to +3
"""The fritzhome version."""

__version__ = "0.6.13"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""The fritzhome version."""
__version__ = "0.6.13"

remove the file

Comment on lines 3 to +6
from .errors import InvalidError, LoginError, NotLoggedInError
from .fritzhome import Fritzhome
from .fritzhomedevice import FritzhomeDevice
from .__version__ import __version__ # noqa: F401
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from .errors import InvalidError, LoginError, NotLoggedInError
from .fritzhome import Fritzhome
from .fritzhomedevice import FritzhomeDevice
from .__version__ import __version__ # noqa: F401
try:
from importlib.metadata import version
__version__ = version(__name__)
except ImportError:
__version__ = "dev"
from .errors import InvalidError, LoginError, NotLoggedInError
from .fritzhome import Fritzhome
from .fritzhomedevice import FritzhomeDevice

@@ -1,6 +1,6 @@
[metadata]
name = pyfritzhome
version = 0.6.13
version = attr: pyfritzhome.__version__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = attr: pyfritzhome.__version__
version = 0.6.13

@mib1185 mib1185 marked this pull request as draft January 25, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cli --version broken
3 participants