From 406939b9c09c9f29526c18fe2f106c2059decf1e Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 14 Aug 2024 15:14:31 -0700 Subject: [PATCH] replace python with python3 (#33303) 3 --- .github/workflows/badges.yaml | 2 +- .github/workflows/selfdrive_tests.yaml | 10 +++++----- tools/cabana/streams/replaystream.cc | 2 +- tools/camerastream/README.md | 8 ++++---- tools/car_porting/README.md | 6 +++--- tools/latencylogger/README.md | 2 +- tools/replay/README.md | 4 ++-- tools/sim/launch_openpilot.sh | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/badges.yaml b/.github/workflows/badges.yaml index f8d2fc3cf1..63ee736dca 100644 --- a/.github/workflows/badges.yaml +++ b/.github/workflows/badges.yaml @@ -23,7 +23,7 @@ jobs: - uses: ./.github/workflows/setup-with-retry - name: Push badges run: | - ${{ env.RUN }} "scons -j$(nproc) && python selfdrive/ui/translations/create_badges.py" + ${{ env.RUN }} "scons -j$(nproc) && python3 selfdrive/ui/translations/create_badges.py" rm .gitattributes diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 0b17807308..479a4ff21d 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -54,7 +54,7 @@ jobs: timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache run: | cd $STRIPPED_DIR - ${{ env.RUN }} "python system/manager/build.py" + ${{ env.RUN }} "python3 system/manager/build.py" - name: Run tests timeout-minutes: 3 run: | @@ -221,7 +221,7 @@ jobs: - name: Upload reference logs if: ${{ failure() && steps.print-diff.outcome == 'success' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }} run: | - ${{ env.RUN }} "unset PYTHONWARNINGS && AZURE_TOKEN='$AZURE_TOKEN' python selfdrive/test/process_replay/test_processes.py -j$(nproc) --upload-only" + ${{ env.RUN }} "unset PYTHONWARNINGS && AZURE_TOKEN='$AZURE_TOKEN' python3 selfdrive/test/process_replay/test_processes.py -j$(nproc) --upload-only" # PYTHONWARNINGS triggers a SyntaxError in onnxruntime - name: Run model replay with ONNX timeout-minutes: 4 @@ -291,7 +291,7 @@ jobs: - uses: ./.github/workflows/setup-with-retry - name: Get base car info run: | - ${{ env.RUN }} "scons -j$(nproc) && python selfdrive/debug/dump_car_docs.py --path /tmp/openpilot_cache/base_car_docs" + ${{ env.RUN }} "scons -j$(nproc) && python3 selfdrive/debug/dump_car_docs.py --path /tmp/openpilot_cache/base_car_docs" sudo chown -R $USER:$USER ${{ github.workspace }} - uses: actions/checkout@v4 with: @@ -303,7 +303,7 @@ jobs: run: | cd current ${{ env.RUN }} "scons -j$(nproc)" - output=$(${{ env.RUN }} "python selfdrive/debug/print_docs_diff.py --path /tmp/openpilot_cache/base_car_docs") + output=$(${{ env.RUN }} "python3 selfdrive/debug/print_docs_diff.py --path /tmp/openpilot_cache/base_car_docs") output="${output//$'\n'/'%0A'}" echo "::set-output name=diff::$output" - name: Find comment @@ -348,7 +348,7 @@ jobs: run: > ${{ env.RUN }} "PYTHONWARNINGS=ignore && source selfdrive/test/setup_xvfb.sh && - python selfdrive/ui/tests/test_ui/run.py" + python3 selfdrive/ui/tests/test_ui/run.py" - name: Upload Test Report uses: actions/upload-artifact@v4 with: diff --git a/tools/cabana/streams/replaystream.cc b/tools/cabana/streams/replaystream.cc index 1616f2aec3..293b363532 100644 --- a/tools/cabana/streams/replaystream.cc +++ b/tools/cabana/streams/replaystream.cc @@ -63,7 +63,7 @@ bool ReplayStream::loadRoute(const QString &route, const QString &data_dir, uint QString message; if (auth_content.empty()) { message = "Authentication Required. Please run the following command to authenticate:\n\n" - "python tools/lib/auth.py\n\n" + "python3 tools/lib/auth.py\n\n" "This will grant access to routes from your comma account."; } else { message = tr("Access Denied. You do not have permission to access route:\n\n%1\n\n" diff --git a/tools/camerastream/README.md b/tools/camerastream/README.md index 76133f07cd..7dbafb4be5 100644 --- a/tools/camerastream/README.md +++ b/tools/camerastream/README.md @@ -1,10 +1,10 @@ # Camera stream -`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC. +`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC. ## Usage -### On the device +### On the device SSH into the device and run following in separate terminals: `cd /data/openpilot/cereal/messaging && ./bridge` @@ -30,7 +30,7 @@ Alternatively paste this as a single command: wait ) ; trap 'kill $(jobs -p)' SIGINT ``` -Ctrl+C will stop all three processes. +Ctrl+C will stop all three processes. ### On the PC Decode the stream with `compressed_vipc.py`: @@ -43,7 +43,7 @@ To actually display the stream, run `watch3` in separate terminal: ## compressed_vipc.py usage ``` -$ python compressed_vipc.py -h +$ python3 compressed_vipc.py -h usage: compressed_vipc.py [-h] [--nvidia] [--cams CAMS] [--silent] addr Decode video streams and broadcast on VisionIPC diff --git a/tools/car_porting/README.md b/tools/car_porting/README.md index a32e9f96c9..68b0a57fb3 100644 --- a/tools/car_porting/README.md +++ b/tools/car_porting/README.md @@ -21,7 +21,7 @@ Given a route and platform, automatically inserts FW fingerprints from the platf Example: ```bash -> python tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK' +> python3 tools/car_porting/auto_fingerprint.py '1bbe6bf2d62f58a8|2022-07-14--17-11-43' 'OUTBACK' Attempting to add fw version for: OUTBACK ``` @@ -45,7 +45,7 @@ Given a route, runs most of the car interface to check for common errors like mi #### Example: panda safety mismatch for gasPressed ```bash -> python tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21' +> python3 tools/car_porting/test_car_model.py '4822a427b188122a|2023-08-14--16-22-21' ===================================================================== FAIL: test_panda_safety_carstate (__main__.CarModelTestCase.test_panda_safety_carstate) @@ -93,4 +93,4 @@ vin: 1FM5K8GC7NGXXXXXX real platform: FORD EXPLORER 6TH GEN determi vin: 5LM5J7XC8MGXXXXXX real platform: FORD EXPLORER 6TH GEN determined platform: mock correct: False vin: 3FTTW8E31PRXXXXXX real platform: FORD MAVERICK 1ST GEN determined platform: mock correct: False vin: 3FTTW8E99NRXXXXXX real platform: FORD MAVERICK 1ST GEN determined platform: mock correct: False -``` \ No newline at end of file +``` diff --git a/tools/latencylogger/README.md b/tools/latencylogger/README.md index 421a6a0b4a..24169dfaef 100644 --- a/tools/latencylogger/README.md +++ b/tools/latencylogger/README.md @@ -5,7 +5,7 @@ LatencyLogger is a tool to track the time from first pixel to actuation. Timesta ## Usage ``` -$ python latency_logger.py -h +$ python3 latency_logger.py -h usage: latency_logger.py [-h] [--relative] [--demo] [--plot] [route_or_segment_name] A tool for analyzing openpilot's end-to-end latency diff --git a/tools/replay/README.md b/tools/replay/README.md index 122af71521..67cfcd75a6 100644 --- a/tools/replay/README.md +++ b/tools/replay/README.md @@ -6,7 +6,7 @@ ```bash # Log in via browser to have access to routes from your comma account -python tools/lib/auth.py +python3 tools/lib/auth.py # Start a replay tools/replay/replay @@ -20,7 +20,7 @@ tools/replay/replay --demo cd selfdrive/ui && ./ui # or try out radar point visualization in Rerun: -python replay/rp_visualization.py +python3 replay/rp_visualization.py # NOTE: To visualize radar points, make sure tools/replay/replay is running. ``` diff --git a/tools/sim/launch_openpilot.sh b/tools/sim/launch_openpilot.sh index 30c5b73827..fa5ac731bd 100755 --- a/tools/sim/launch_openpilot.sh +++ b/tools/sim/launch_openpilot.sh @@ -12,7 +12,7 @@ if [[ "$CI" ]]; then export BLOCK="${BLOCK},ui" fi -python -c "from openpilot.selfdrive.test.helpers import set_params_enabled; set_params_enabled()" +python3 -c "from openpilot.selfdrive.test.helpers import set_params_enabled; set_params_enabled()" SCRIPT_DIR=$(dirname "$0") OPENPILOT_DIR=$SCRIPT_DIR/../../