Skip to content

Commit 36985ce

Browse files
committed
add test.sh
1 parent 5483a02 commit 36985ce

3 files changed

Lines changed: 59 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ __pycache__
88
*.so
99
*.o
1010
*.a
11+
uv.lock
1112

1213
test_runner
1314

1415
libmessaging.*
1516
libmessaging_shared.*
16-
services.h
1717
.sconsign.dblite
18-
.mypy_cache/
18+
.mypy_cache/

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
[project]
2+
name = "msgq"
3+
version = "0.0.1"
4+
description = "Code powering the comma.ai panda"
5+
readme = "README.md"
6+
requires-python = ">=3.11,<3.13"
7+
license = {text = "MIT"}
8+
authors = [{name = "comma.ai"}]
9+
classifiers = [
10+
"Natural Language :: English",
11+
"Programming Language :: Python :: 3",
12+
"Topic :: System :: Hardware",
13+
]
14+
dependencies = [
15+
"Cython",
16+
"scons",
17+
"pre-commit",
18+
"ruff",
19+
"parameterized",
20+
"coverage",
21+
"numpy",
22+
"pytest",
23+
]
24+
125
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
226
[tool.ruff]
327
lint.select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A"]

test.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
5+
cd $DIR
6+
7+
# *** env setup ***
8+
if ! command -v uv &>/dev/null; then
9+
echo "'uv' is not installed. Installing 'uv'..."
10+
curl -LsSf https://astral.sh/uv/install.sh | sh
11+
12+
# doesn't require sourcing on all platforms
13+
set +e
14+
source $HOME/.local/bin/env
15+
set -e
16+
fi
17+
18+
export UV_PROJECT_ENVIRONMENT="$DIR/.venv"
19+
uv sync --all-extras
20+
source "$DIR/.venv/bin/activate"
21+
22+
# *** build ***
23+
scons -j8
24+
25+
# *** lint ***
26+
ruff check .
27+
mypy python/
28+
29+
30+
# *** test ***
31+
32+
# TODO: make randomly work
33+
pytest --randomly-dont-reorganize tests/

0 commit comments

Comments
 (0)