Skip to content

Commit

Permalink
Catch missing python modules and print message (#2221)
Browse files Browse the repository at this point in the history
* Add `python-requirements` target for main Sming Makefile to install core requirements

* Catch missing optional python modules and print more obvious message
  • Loading branch information
mikee47 committed Feb 22, 2021
1 parent 8f3c894 commit 7b19c1b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sming/Components/IFS
Submodule IFS updated 1 files
+7 −2 tools/fsbuild/config.py
8 changes: 7 additions & 1 deletion Sming/Components/Storage/Tools/hwconfig/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
import os, partition, storage
from common import *
from builtins import classmethod
from rjsmin import jsmin

try:
from rjsmin import jsmin
except ImportError as err:
sys.stderr.write("\n** %s: please run `make python-requirements` **\n\n" % str(err))
sys.exit(1)


def findConfig(name):
dirs = os.environ['HWCONFIG_DIRS'].split(' ')
Expand Down
1 change: 0 additions & 1 deletion Sming/Components/Storage/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
jsonschema
rjsmin
8 changes: 8 additions & 0 deletions Sming/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ $(CLEAN_TESTS):

##@Tools

CACHE_VARS += PIP_ARGS
PIP_ARGS ?=
.PHONY: python-requirements
python-requirements: ##Install Python requirements for framework via pip (use PIP_ARGS=... for additional options)
@echo Installing Python requirements...
$(Q) $(PYTHON) -m pip install $(PIP_ARGS) -r $(SMING_HOME)/../Tools/requirements.txt


# Recursive wildcard search
# $1 -> list of directories
# $2 -> file extensions filters (using % as wildcard)
Expand Down
1 change: 0 additions & 1 deletion Tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pyserial
jsonschema
rjsmin

0 comments on commit 7b19c1b

Please sign in to comment.