Skip to content

Commit

Permalink
Merge remote-tracking branch 'commaai/openpilot/master' into ui-home
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin committed Aug 4, 2024
2 parents e4bd772 + 8f9b165 commit abd0b40
Show file tree
Hide file tree
Showing 30 changed files with 245 additions and 523 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/repo-maintenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,13 @@ jobs:
python3 -m ensurepip --upgrade
pip3 install uv
uv lock --upgrade
- name: pre-commit autoupdate
run: |
git config --global --add safe.directory '*'
pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83
with:
author: Vehicle Researcher <[email protected]>
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
commit-message: Update Python packages and pre-commit hooks
title: '[bot] Update Python packages and pre-commit hooks'
commit-message: Update Python packages
title: '[bot] Update Python packages'
branch: auto-package-updates
base: master
delete-branch: true
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
BUILD: selfdrive/test/docker_build.sh base

RUN: docker run --shm-size 2G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e CI=1 -e PRE_COMMIT_HOME=/tmp/pre-commit -e PYTHONWARNINGS=error -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/pre-commit:/tmp/pre-commit -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c
RUN: docker run --shm-size 2G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e CI=1 -e PYTHONWARNINGS=error -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c

PYTEST: pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append --durations=0 --durations-min=5 --hypothesis-seed 0 -n logical

Expand All @@ -45,7 +45,6 @@ jobs:
- name: Build devel
timeout-minutes: 1
run: TARGET_DIR=$STRIPPED_DIR release/build_devel.sh
- uses: ./.github/workflows/setup-pre-commit
- uses: ./.github/workflows/setup-with-retry
- name: Check submodules
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
Expand All @@ -62,14 +61,13 @@ jobs:
cd $STRIPPED_DIR
${{ env.RUN }} "release/check-dirty.sh && \
MAX_EXAMPLES=5 $PYTEST -m 'not slow' selfdrive/car"
- name: pre-commit
timeout-minutes: 3
- name: static analysis
timeout-minutes: 1
run: |
cd $GITHUB_WORKSPACE
cp .pre-commit-config.yaml $STRIPPED_DIR
cp pyproject.toml $STRIPPED_DIR
cd $STRIPPED_DIR
${{ env.RUN }} "unset PYTHONWARNINGS && SKIP=check-added-large-files,check-hooks-apply,check-useless-excludes pre-commit run --all && chmod -R 777 /tmp/pre-commit"
${{ env.RUN }} "scripts/lint.sh"
build:
strategy:
Expand Down Expand Up @@ -146,13 +144,12 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-pre-commit
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: pre-commit
timeout-minutes: 4
run: ${{ env.RUN }} "unset PYTHONWARNINGS && pre-commit run --all && chmod -R 777 /tmp/pre-commit"
- name: static analysis
timeout-minutes: 1
run: ${{ env.RUN }} "scripts/lint.sh"

unit_tests:
name: unit tests
Expand Down Expand Up @@ -340,6 +337,7 @@ jobs:
# This job name needs to be the same as UI_JOB_NAME in ui_preview.yaml
name: Create UI Report
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/setup-pre-commit/action.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
workflow_dispatch:

env:
DAYS_BEFORE_PR_CLOSE: 3
DAYS_BEFORE_PR_STALE: 14
DAYS_BEFORE_PR_CLOSE: 2
DAYS_BEFORE_PR_STALE: 9

jobs:
stale:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = panda
url = ../../commaai/panda.git
[submodule "opendbc"]
path = opendbc
path = opendbc_repo
url = ../../commaai/opendbc.git
[submodule "msgq"]
path = msgq_repo
Expand Down
105 changes: 0 additions & 105 deletions .pre-commit-config.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ int fsync_dir(const std::string &path) {
int result = -1;
int fd = HANDLE_EINTR(open(path.c_str(), O_RDONLY, 0755));
if (fd >= 0) {
result = fsync(fd);
close(fd);
result = HANDLE_EINTR(fsync(fd));
HANDLE_EINTR(close(fd));
}
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions common/transformations/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def all_cams(self):
yield cam, getattr(self, cam)

_ar_ox_fisheye = CameraConfig(1928, 1208, 567.0) # focal length probably wrong? magnification is not consistent across frame
_os_fisheye = CameraConfig(2688, 1520, 567.0 / 2 * 3)
_os_fisheye = CameraConfig(2688 // 2, 1520 // 2, 567.0 / 4 * 3)
_ar_ox_config = DeviceCameraConfig(CameraConfig(1928, 1208, 2648.0), _ar_ox_fisheye, _ar_ox_fisheye)
_os_config = DeviceCameraConfig(CameraConfig(2688, 1520, 2648.0 * 2 / 3), _os_fisheye, _os_fisheye)
_os_config = DeviceCameraConfig(CameraConfig(2688 // 2, 1520 // 2, 1522.0 * 3 / 4), _os_fisheye, _os_fisheye)
_neo_config = DeviceCameraConfig(CameraConfig(1164, 874, 910.0), CameraConfig(816, 612, 650.0), _NoneCameraConfig())

DEVICE_CAMERAS = {
Expand Down
2 changes: 1 addition & 1 deletion docs/WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pytest
cd system/loggerd && pytest .

# run the linter
pre-commit run --all
op lint
```

## Testing
Expand Down
1 change: 0 additions & 1 deletion opendbc
Submodule opendbc deleted from 39a534
1 change: 1 addition & 0 deletions opendbc
1 change: 1 addition & 0 deletions opendbc_repo
Submodule opendbc_repo added at a40652
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ testing = [
"hypothesis ==6.47.*",
"import-linter",
"mypy",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-cpp",
Expand All @@ -87,7 +86,8 @@ testing = [
"pytest-asyncio",
"pytest-mock",
"pytest-repeat",
"ruff"
"ruff",
"codespell",
]

dev = [
Expand Down Expand Up @@ -164,6 +164,13 @@ testpaths = [
"cereal/messaging/tests",
]

[tool.codespell]
count = true
quiet-level = 3
# if you've got a short variable name that's getting flagged, add it here
ignore-words-list = "bu,ro,te,ue,alo,hda,ois,nam,nams,ned,som,parm,setts,inout,warmup,bumb,nd,sie,preints,whit,indexIn"
builtin = "clear,rare,informal,usage,code,names,en-GB_to_en-US"

[tool.mypy]
python_version = "3.11"
plugins = [
Expand Down
Loading

0 comments on commit abd0b40

Please sign in to comment.