-
Notifications
You must be signed in to change notification settings - Fork 261
70 lines (64 loc) · 2.72 KB
/
Copy pathpython-package.yml
File metadata and controls
70 lines (64 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [master, develop]
tags: ["v*"]
pull_request:
branches: [master, develop]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
uv venv --python ${{ matrix.python-version }}
uv pip install --group dev
uv pip install --editable .
# lapsolver is unmaintained and no longer builds with the C++
# toolchain on current GitHub-hosted runners. The test suite
# discovers optional solvers dynamically, so exercise the
# maintained LAP backends here instead.
uv pip install lap scipy munkres
uv pip install "ortools<9.12; python_version < '3.9'" "ortools; python_version >= '3.9'"
- name: Lint with Ruff
run: |
# stop the build if there are Python syntax errors or undefined names
uv run --no-project ruff check motmetrics --select E9,F63,F7,F82
# report all configured lint findings without failing the build
uv run --no-project ruff check motmetrics --exit-zero
- name: Test with pytest
run: |
uv run --no-project pytest
trackeval-parity:
name: TrackEval parity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
uv venv --python 3.11
uv pip install --group dev
uv pip install --editable .
uv pip install trackeval==1.3.0
- name: Compare py-motmetrics with TrackEval
run: |
uv run --no-project pytest -q -s motmetrics/tests/test_trackeval_parity.py