Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scons failure fixed #1605

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ Everything you need to know to use, contribute, and extend opendbc are in these
```bash
git clone https://github.com/commaai/opendbc.git
cd opendbc

# you probably just want to use this. it's an all-in-one for dependency
# installation, compiling, linting, and tests. it's also what runs in CI
./test.sh

# here are the individual commands it runs
pip3 install -e .[testing,docs] # install dependencies
scons -j8 # build with 8 cores
pytest . # run the tests
pre-commit run --all-files # run the linter
./test.sh # all-in-one dependency installation, compiling, linting, and tests. It's what runs in CI
```

[`examples/`](examples/) contains small example programs that can read state from the car and control the steering, gas, and brakes.
Expand Down
2 changes: 2 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import subprocess
import sysconfig
import platform
import numpy as np
from pathlib import Path

arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"

os.environ['PYTHONPATH'] = str(Path(sysconfig.get_paths()['data']).parent)
python_path = sysconfig.get_paths()['include']
cpppath = [
'#',
Expand Down
10 changes: 2 additions & 8 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR

# TODO: why doesn't uv do this?
export PYTHONPATH=$DIR

# *** dependencies install ***
if ! command -v uv &>/dev/null; then
echo "'uv' is not installed. Installing 'uv'..."
Expand All @@ -17,15 +11,15 @@ uv sync --all-extras
source .venv/bin/activate

# *** build ***
uv run scons -j8
uv run scons -j$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)

# *** lint ***
# TODO: pre-commit is slow; replace it with openpilot's "op lint"
#uv run pre-commit run --all-files
uv run ruff check .

# *** test ***
uv run pytest -n8
uv run pytest -n$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)

# *** all done ***
GREEN='\033[0;32m'
Expand Down
Loading