-
-
Notifications
You must be signed in to change notification settings - Fork 659
118 lines (95 loc) 路 3.1 KB
/
Copy pathcode-quality.yml
File metadata and controls
118 lines (95 loc) 路 3.1 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: code-quality
on:
pull_request:
branches:
- "*"
push:
branches:
- main
jobs:
smoke-tests:
name: Smoke tests ~ Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install the source checkout
if: matrix.python-version != '3.15'
run: uv sync --locked --no-default-groups
- name: Import public packages from the source checkout
if: matrix.python-version != '3.15'
run: uv run --no-sync python -c "import river.stream"
- name: Compile the source checkout
if: matrix.python-version == '3.15'
run: uv run --no-project python -m compileall -q river
tests:
name: Tests + prek
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Cache datasets
uses: actions/cache@v5
with:
path: ~/river_data
key: river-data-${{ hashFiles('river/datasets/**/*.py', 'river/bandit/datasets/**/*.py', 'Makefile') }}
restore-keys: |
river-data-
- name: Download datasets
run: uv run make download-datasets
# prek runs while pandas is still installed (mypy etc. type-check against it).
- name: Run prek
uses: j178/prek-action@v2
# The bulk of the suite runs without pandas, which also guards the
# optional-dependency contract. The pandas subset runs in the companion
# job below, so nothing is tested twice.
- name: Uninstall pandas
run: uv pip uninstall pandas
- name: Run tests
run: uv run --no-sync pytest
pandas:
name: Tests with pandas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Cache datasets
uses: actions/cache@v5
with:
path: ~/river_data
key: river-data-${{ hashFiles('river/datasets/**/*.py', 'river/bandit/datasets/**/*.py', 'Makefile') }}
restore-keys: |
river-data-
- name: Download datasets
run: uv run make download-datasets
# RIVER_PANDAS_ONLY restricts collection to the pandas-dependent modules
# (see conftest.py).
- name: Run pandas tests
env:
RIVER_PANDAS_ONLY: "1"
run: uv run pytest
build-sdist:
name: Build sdist and wheel from sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
- name: Build sdist and wheel from sdist
run: uv build