Add requirements for Python and PIO Core+

This commit is contained in:
Ivan Kravets
2017-06-24 02:13:03 +03:00
parent 954ff8dca0
commit 2849d78ece
2 changed files with 11 additions and 4 deletions

View File

@ -32,9 +32,9 @@ __copyright__ = "Copyright 2014-present PlatformIO"
__apiurl__ = "https://api.platformio.org"
if sys.version_info < (2, 7, 4) or sys.version_info >= (3, 0, 0):
msg = ("PlatformIO version %s does not run under Python version %s.\n"
"Minimum supported version is 2.7.4, please upgrade Python. \n"
if sys.version_info < (2, 7, 0) or sys.version_info >= (3, 0, 0):
msg = ("PlatformIO Core v%s does not run under Python version %s.\n"
"Minimum supported version is 2.7, please upgrade Python.\n"
"Python 3 is not yet supported.\n")
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
sys.exit(1)

View File

@ -17,7 +17,7 @@ import subprocess
import sys
from os.path import join
from platformio import exception, util
from platformio import __version__, exception, util
from platformio.managers.package import PackageManager
CORE_PACKAGES = {
@ -63,6 +63,13 @@ def update_core_packages(only_check=False, silent=False):
def pioplus_call(args, **kwargs):
if "windows" in util.get_systype() and sys.version_info < (2, 7, 6):
raise exception.PlatformioException(
"PlatformIO Core Plus v%s does not run under Python version %s.\n"
"Minimum supported version is 2.7.6, please upgrade Python.\n"
"Python 3 is not yet supported.\n" % (__version__,
sys.version.split()[0]))
pioplus_path = join(get_core_package_dir("tool-pioplus"), "pioplus")
os.environ['PYTHONEXEPATH'] = util.get_pythonexe_path()
os.environ['PYTHONPYSITEDIR'] = get_core_package_dir("pysite-pioplus")