Skip to content
Snippets Groups Projects
Commit 9456732b authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix: Include upip as fronzen modules inside the standard interpreter.

MicroPython doesn't come with standard library included, so it is important
to be able to easily install needed package in a seamless manner. Bundling
package manager (upip) inside an executable solves this issue.

upip is bundled only with standard executable, not "minimal" or "fast"
builds.
parent 2fc1e643
No related branches found
No related tags found
No related merge requests found
......@@ -5,3 +5,4 @@ micropython
micropython_fast
micropython_minimal
*.py
micropython-upip-*
......@@ -103,6 +103,13 @@ SRC_C = \
coverage.c \
$(SRC_MOD)
# Include builtin package manager in the standard build (and coverage)
ifeq ($(PROG),micropython)
SRC_C += $(BUILD)/_frozen_upip.c
else ifeq ($(PROG),micropython_coverage)
SRC_C += $(BUILD)/_frozen_upip.c
endif
LIB_SRC_C = $(addprefix lib/,\
$(LIB_SRC_C_EXTRA) \
)
......@@ -153,3 +160,17 @@ coverage_test: coverage
cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests --emit native
gcov -o build-coverage/py ../py/*.c
gcov -o build-coverage/extmod ../extmod/*.c
$(BUILD)/_frozen_upip.c: frozen_upip/upip.py
../tools/make-frozen.py frozen_upip > $@
# Select latest upip version available
UPIP_TARBALL := $(shell ls -1 -v ../tools/micropython-upip-*.tar.gz | tail -n1)
frozen_upip/upip.py: $(UPIP_TARBALL)
$(Q)rm -rf micropython-upip-*
$(ECHO) "MISC Preparing upip as frozen module"
$(Q)tar xfz $^
$(Q)rm -rf frozen_upip
$(Q)mkdir -p frozen_upip
$(Q)cp micropython-upip-*/upip*.py frozen_upip/
......@@ -81,6 +81,7 @@
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO_FILEIO (1)
#define MICROPY_PY_GC_COLLECT_RETVAL (1)
#define MICROPY_MODULE_FROZEN (1)
#define MICROPY_STACKLESS (0)
#define MICROPY_STACKLESS_STRICT (0)
......
......@@ -33,3 +33,8 @@
// 91 is a magic number proposed by @dpgeorge, which make pystone run ~ at tie
// with CPython 3.4.
#define MICROPY_MODULE_DICT_SIZE (91)
// Don't include builtin upip, as this build is again intended just for
// synthetic benchmarking
#undef MICROPY_MODULE_FROZEN
#define MICROPY_MODULE_FROZEN (0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment