Skip to content

Commit

Permalink
pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Jul 10, 2024
1 parent ebef964 commit a3e67a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
msgq/test_runner && \
msgq/visionipc/test_runner"
- name: python tests
run: $RUN_NAMED "${{ matrix.backend }}=1 coverage run -m unittest discover ."
run: $RUN_NAMED "${{ matrix.backend }}=1 coverage run -m pytest"
- name: Upload coverage
run: |
docker commit msgq msgqci
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install --break-system-packages --no-cache-dir pyyaml Cython scons pycapnp pre-commit ruff parameterized coverage numpy
RUN pip3 install --break-system-packages --no-cache-dir pyyaml Cython scons pycapnp pre-commit ruff parameterized coverage numpy pytest pytest-xdist

WORKDIR /project/msgq/
RUN cd /tmp/ && \
Expand Down
1 change: 0 additions & 1 deletion msgq/tests/test_messaging.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import random
import threading
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ lint.flake8-implicit-str-concat.allow-multiline=false
line-length = 160
target-version="py311"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
"unittest".msg = "Use pytest"

[mypy.tool]
# third-party packages
ignore_missing_imports=true
Expand All @@ -19,3 +23,11 @@ warn_unused_ignores=true
# restrict dynamic typing
warn_return_any=true
check_untyped_defs=true

[tool.pytest.ini_options]
addopts = "--durations=10 -n auto"
testpaths = [
"msgq/tests",
"msgq/visionipc/tests",
]

0 comments on commit a3e67a0

Please sign in to comment.