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 authored Feb 20, 2021
1 parent 8f3c894 commit 295a5f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 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
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

0 comments on commit 295a5f3

Please sign in to comment.