From 7ff5616870dc2aed5c50dc2b287e488b242aa9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=93=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=B0=D1=80=D1=8C?= Date: Mon, 15 Jun 2026 15:24:19 +0300 Subject: [PATCH] feat: update installation scripts to pre-install fastapi and starlette for compatibility --- scripts/setup_ros2_desktop.sh | 10 +++++++--- scripts/setup_ros2_ros_base.sh | 10 +++++++--- src/iiwa_web/setup.py | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/setup_ros2_desktop.sh b/scripts/setup_ros2_desktop.sh index 529c37c..31b49e1 100755 --- a/scripts/setup_ros2_desktop.sh +++ b/scripts/setup_ros2_desktop.sh @@ -68,9 +68,13 @@ if ! sudo grep -qs 'break-system-packages' /root/.config/pip/pip.conf 2>/dev/nul fi # rosdep calls `pip install -U ` which upgrades every transitive dependency, # including packages installed by apt that have no pip RECORD file, causing an -# uninstall failure. Pre-installing fastmcp with --ignore-installed creates pip -# RECORD files for all its transitive deps so the later rosdep upgrade succeeds. -sudo pip3 install --break-system-packages --ignore-installed fastmcp +# uninstall failure. Pre-installing these packages with --ignore-installed creates +# pip RECORD files for all their transitive deps so the later rosdep upgrade succeeds. +# fastapi>=0.100.0 + starlette>=0.27.0 are pinned together to avoid the +# "Router.__init__() got an unexpected keyword argument 'on_startup'" error that +# occurs when the apt-installed fastapi (old) is mixed with a newer pip starlette. +sudo pip3 install --break-system-packages --ignore-installed \ + "fastapi>=0.100.0" "starlette>=0.27.0" fastmcp PROGRESS 100 "Done" echo "ROS2 Jazzy Desktop installed successfully." diff --git a/scripts/setup_ros2_ros_base.sh b/scripts/setup_ros2_ros_base.sh index d958cc6..4b25922 100755 --- a/scripts/setup_ros2_ros_base.sh +++ b/scripts/setup_ros2_ros_base.sh @@ -68,9 +68,13 @@ if ! sudo grep -qs 'break-system-packages' /root/.config/pip/pip.conf 2>/dev/nul fi # rosdep calls `pip install -U ` which upgrades every transitive dependency, # including packages installed by apt that have no pip RECORD file, causing an -# uninstall failure. Pre-installing fastmcp with --ignore-installed creates pip -# RECORD files for all its transitive deps so the later rosdep upgrade succeeds. -sudo pip3 install --break-system-packages --ignore-installed fastmcp +# uninstall failure. Pre-installing these packages with --ignore-installed creates +# pip RECORD files for all their transitive deps so the later rosdep upgrade succeeds. +# fastapi>=0.100.0 + starlette>=0.27.0 are pinned together to avoid the +# "Router.__init__() got an unexpected keyword argument 'on_startup'" error that +# occurs when the apt-installed fastapi (old) is mixed with a newer pip starlette. +sudo pip3 install --break-system-packages --ignore-installed \ + "fastapi>=0.100.0" "starlette>=0.27.0" fastmcp PROGRESS 100 "Done" echo "ROS2 Jazzy (ros-base) installed successfully." diff --git a/src/iiwa_web/setup.py b/src/iiwa_web/setup.py index b288152..3db5655 100644 --- a/src/iiwa_web/setup.py +++ b/src/iiwa_web/setup.py @@ -13,7 +13,8 @@ setup( ], install_requires=[ 'setuptools', - 'fastapi', + 'fastapi>=0.100.0', + 'starlette>=0.27.0', 'uvicorn[standard]', 'python-multipart', 'fastmcp',