armbian-next: Python tooling: use consolidated+hashed+cached pip base/pycache; don't pip during Dockerfile build, nor cli-requirements

- consolidate at `prepare_python_and_pip()`
- sanity check for Python version 3.9+ regardless of HOSTRELEASE
- TODO: pip vs sudo/root: need pip 22.2+ to curb warning, not doing it
This commit is contained in:
Ricardo Pardini
2023-01-13 04:37:30 +01:00
parent 350cf62ee0
commit 7beeae6219
7 changed files with 108 additions and 68 deletions

View File

@@ -6,17 +6,12 @@ function cli_json_info_pre_run() {
function cli_json_info_run() {
display_alert "Generating JSON info" "for all boards; wait" "info"
# So call a Python launcher.
# @TODO: this works without ti right now, since all the python stuff works with no external packages
# - python debian packages hostdeps? (-dev, -pip, virtualenv, etc)
# - run the virtualenv (messy?)
declare python3_binary_path
prepare_python3_binary_for_python_tools
obtain_and_check_host_release_and_arch # sets HOSTRELEASE
prepare_python_and_pip # requires HOSTRELEASE
# The info extractor itself...
run_host_command_logged "${python3_binary_path}" "${SRC}"/lib/tools/info.py ">" "${SRC}/output/info.json"
run_host_command_logged "${PYTHON3_VARS[@]}" "${PYTHON3_INFO[BIN]}" "${SRC}"/lib/tools/info.py ">" "${SRC}/output/info.json"
# Also convert output to CSV for easy import into Google Sheets etc
run_host_command_logged "${python3_binary_path}" "${SRC}"/lib/tools/json2csv.py "<" "${SRC}/output/info.json" ">" "${SRC}/output/info.csv"
run_host_command_logged "${PYTHON3_VARS[@]}" "${PYTHON3_INFO[BIN]}" "${SRC}"/lib/tools/json2csv.py "<" "${SRC}/output/info.json" ">" "${SRC}/output/info.csv"
}