mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Move hardcoded required Python version into homeassistant.const
This commit is contained in:
parent
8e9c557a2c
commit
ac69db8133
@ -12,15 +12,21 @@ from multiprocessing import Process
|
|||||||
import homeassistant.config as config_util
|
import homeassistant.config as config_util
|
||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_HOMEASSISTANT_START, RESTART_EXIT_CODE, __version__)
|
__version__,
|
||||||
|
EVENT_HOMEASSISTANT_START,
|
||||||
|
REQUIRED_PYTHON_VER,
|
||||||
|
RESTART_EXIT_CODE,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def validate_python():
|
def validate_python():
|
||||||
""" Validate we're running the right Python version. """
|
""" Validate we're running the right Python version. """
|
||||||
major, minor = sys.version_info[:2]
|
major, minor = sys.version_info[:2]
|
||||||
|
req_major, req_minor = REQUIRED_PYTHON_VER
|
||||||
|
|
||||||
if major < 3 or (major == 3 and minor < 4):
|
if major < req_major or (major == req_major and minor < req_minor):
|
||||||
print("Home Assistant requires atleast Python 3.4")
|
print("Home Assistant requires at least Python {}.{}".format(
|
||||||
|
req_major, req_minor))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"""Constants used by Home Assistant components."""
|
"""Constants used by Home Assistant components."""
|
||||||
|
|
||||||
__version__ = "0.15.0.dev0"
|
__version__ = "0.15.0.dev0"
|
||||||
|
REQUIRED_PYTHON_VER = (3, 4)
|
||||||
|
|
||||||
# Can be used to specify a catch all when registering state or event listeners.
|
# Can be used to specify a catch all when registering state or event listeners.
|
||||||
MATCH_ALL = '*'
|
MATCH_ALL = '*'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user