forked from platformio/platformio-core
Moved SCons to PlatformIO packages. PlatformIO does not require SCons to be installed in your system.
Significantly simplified installation process of PlatformIO. "pip install platformio" rocks!
This commit is contained in:
1 parent
d2088e7444
commit
9312ca7f0d
10 files changed
+52
-176
No files matched your search
@@ -18,7 +18,6 @@ import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from glob import glob
|
||||
from os.path import (abspath, basename, dirname, expanduser, isdir, isfile,
|
||||
join, realpath)
|
||||
@@ -330,60 +329,6 @@ def get_api_result(path, params=None, data=None):
|
||||
return result
|
||||
|
||||
|
||||
def test_scons():
|
||||
try:
|
||||
r = exec_command(["scons", "--version"])
|
||||
if "ImportError: No module named SCons.Script" in r['err']:
|
||||
_PYTHONPATH = []
|
||||
for p in sys.path:
|
||||
if not p.endswith("-packages"):
|
||||
continue
|
||||
for item in glob(join(p, "scons*")):
|
||||
if isdir(join(item, "SCons")) and item not in sys.path:
|
||||
_PYTHONPATH.append(item)
|
||||
sys.path.insert(0, item)
|
||||
if _PYTHONPATH:
|
||||
_PYTHONPATH = str(os.pathsep).join(_PYTHONPATH)
|
||||
if os.getenv("PYTHONPATH"):
|
||||
os.environ['PYTHONPATH'] += os.pathsep + _PYTHONPATH
|
||||
else:
|
||||
os.environ['PYTHONPATH'] = _PYTHONPATH
|
||||
r = exec_command(["scons", "--version"])
|
||||
assert r['returncode'] == 0
|
||||
return True
|
||||
except (OSError, AssertionError):
|
||||
for p in sys.path:
|
||||
try:
|
||||
r = exec_command([join(p, "scons"), "--version"])
|
||||
assert r['returncode'] == 0
|
||||
os.environ['PATH'] += os.pathsep + p
|
||||
return True
|
||||
except (OSError, AssertionError):
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
def install_scons():
|
||||
cmds = (
|
||||
["pip", "install", "-U", "scons"],
|
||||
["pip", "install", "--egg", "scons",
|
||||
'--install-option="--no-install-man"'],
|
||||
["easy_install", "scons"]
|
||||
)
|
||||
for cmd in cmds:
|
||||
r = exec_command(cmd)
|
||||
if r['returncode'] == 0:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def scons_in_pip():
|
||||
r = exec_command(["pip", "list"])
|
||||
if r['returncode'] != 0:
|
||||
return False
|
||||
return "scons (" in r['out'].lower()
|
||||
|
||||
|
||||
@memoized
|
||||
def _lookup_boards():
|
||||
boards = {}
|
||||
|
||||
Reference in new issue
Block a user