-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make error message more informative again
- Loading branch information
1 parent
2e53ea7
commit dd794eb
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
"""Library to read data from Mi Flora sensor""" | ||
import sys | ||
|
||
assert sys.version_info >= (3, 6), "Miflora requires at least Python 3.6" | ||
# This check must be run first, so that it fails before loading the other modules. | ||
# Otherwise we do not get a clean error message. | ||
min_python_version = (3, 6) | ||
if sys.version_info < min_python_version: | ||
raise ValueError( | ||
"miflora requires Python≥{}.{}. You're running version {}.{} from {}.".format( | ||
*min_python_version, *sys.version_info[:2], sys.executable | ||
) | ||
) | ||
from ._version import __version__ # noqa: E402, pylint: disable=wrong-import-position | ||
|
||
__all__ = ["__version__"] |