Skip to content

Commit 4432441

Browse files
Remove existing mbed-tools, re-add dependency
1 parent b4f9008 commit 4432441

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/workflows/test_building_multiple_executables.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
run: |
1616
python3 -m pip install --upgrade pip
1717
python3 -m pip install -e ./tools
18+
19+
# Remove mbed-tools package that comes with the docker image, it conflicts with the one we want to install
20+
python3 -m pip uninstall mbed-tools
1821
1922
# Note: For this CI job we use MBED_CREATE_PYTHON_VENV=FALSE so that we can make sure
2023
# this mode works.

tools/cmake/mbed_python_interpreter.cmake

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ if(MBED_CREATE_PYTHON_VENV)
9797
file(TOUCH ${VENV_STAMP_FILE})
9898
endif()
9999

100-
# We always have the memap deps with the venv
101-
set(HAVE_MEMAP_DEPS TRUE)
100+
# When using the venv, scripts will always be installed to the directory where Python itself is installed
101+
# (venv\Scripts on Windows, venv/bin on Linux/Mac)
102+
get_filename_component(PYTHON3_INTERP_DIR ${Python3_EXECUTABLE} DIRECTORY)
103+
set(PYTHON_SCRIPT_LOC_HINTS ${PYTHON3_INTERP_DIR})
102104

103105
else()
104106

@@ -113,25 +115,26 @@ else()
113115
if(NOT HAVE_MBED_CE_TOOLS)
114116
message(FATAL_ERROR "Did not detect the Mbed CE Python tools installed into the python interpreter ${Python3_EXECUTABLE}. Install them with a command like: ${Python3_EXECUTABLE} -m pip install -e ${MBED_CE_TOOLS_BASE_DIR}")
115117
endif()
116-
endif()
117118

118-
get_filename_component(PYTHON3_INTERP_DIR ${Python3_EXECUTABLE} DIRECTORY)
119+
# For now, don't supply any hints and assume that the script install dir is correctly on PATH
120+
set(PYTHON_SCRIPT_LOC_HINTS)
121+
endif()
119122

120123
# Find scripts provided by the Python package
121124
find_program(mbed_tools
122125
NAMES mbed-tools
123-
HINTS ${PYTHON3_INTERP_DIR}
126+
HINTS ${PYTHON_SCRIPT_LOC_HINTS}
124127
DOC "Path to mbed-tools Python script."
125128
REQUIRED)
126129

127130
find_program(mbedhtrun
128131
NAMES mbedhtrun
129-
HINTS ${PYTHON3_INTERP_DIR}
132+
HINTS ${PYTHON_SCRIPT_LOC_HINTS}
130133
DOC "Path to mbedhtrun Python script."
131134
REQUIRED)
132135

133136
find_program(memap
134137
NAMES memap
135-
HINTS ${PYTHON3_INTERP_DIR}
138+
HINTS ${PYTHON_SCRIPT_LOC_HINTS}
136139
DOC "Path to memap Python script."
137140
REQUIRED)

tools/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ dependencies = [
4949
"lockfile",
5050
"colorama",
5151

52+
# mbed_os_tools.detect dependencies -------------------------------------------------------
53+
"fasteners",
54+
5255
# needed for signing secure images --------------------------------------------------------
5356
"cryptography",
5457
"cbor",

0 commit comments

Comments
 (0)