-
Notifications
You must be signed in to change notification settings - Fork 182
168 lines (142 loc) · 5.05 KB
/
hamilton-main.yml
File metadata and controls
168 lines (142 loc) · 5.05 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Unit Tests
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '.github/**'
- 'hamilton/**'
- 'plugin_tests/**'
- 'tests/**'
- 'pyproject.toml'
jobs:
static-checks:
name: "Static Checks"
runs-on: ubuntu-latest
env:
UV_PRERELEASE: "allow"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Check linting with prek
run: |
uv sync --dev
uv run prek run --all-files --hook-stage pre-merge-commit
test:
name: "Unit Tests"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # want to see for each version if fails are different
matrix:
os:
- ubuntu-latest
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
env:
UV_PRERELEASE: "allow"
HAMILTON_TELEMETRY_ENABLED: false
steps:
- name: Install Graphviz on Linux
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install --yes --no-install-recommends graphviz
- name: Install Graphviz on Windows
if: runner.os == 'Windows'
run: choco install graphviz
shell: powershell
- name: Install Graphviz on macOS
if: runner.os == 'macOS'
run: |
brew install graphviz
brew install libomp
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test hamilton main package
run: |
uv sync --group test
uv pip install "kaleido<0.4.0"
uv run pytest tests/ --cov=hamilton --ignore tests/integrations
- name: Test integrations
run: |
uv sync --group test --extra pandera
uv pip install -r tests/integrations/pandera/requirements.txt
uv run pytest tests/integrations
- name: Test MCP
run: |
uv sync --group test --extra mcp
uv run pytest tests/plugins/test_h_mcp.py
- name: Test pandas
run: |
uv sync --group test
uv run pytest plugin_tests/h_pandas
- name: Test polars
run: |
uv sync --group test
uv pip install polars
uv run pytest plugin_tests/h_polars
- name: Test narwhals
run: |
uv sync --group test
uv pip install polars pandas narwhals
uv run pytest plugin_tests/h_narwhals
- name: Test dask
run: |
uv sync --group test --extra dask
uv run pytest plugin_tests/h_dask
- name: Test ray
if: ${{ matrix.python-version != '3.14' }}
env:
RAY_ENABLE_UV_RUN_RUNTIME_ENV: 0 # https://github.com/ray-project/ray/issues/53848
run: |
uv sync --group test --extra ray
uv run pytest plugin_tests/h_ray
- name: Test pyspark
if: ${{ runner.os == 'Linux' }}
env:
PYSPARK_SUBMIT_ARGS: "--conf spark.sql.ansi.enabled=false pyspark-shell"
run: |
sudo apt-get install --no-install-recommends --yes default-jre
uv sync --group test --extra pyspark
uv pip install 'pyspark[connect]' 'grpcio'
uv pip install --no-cache --reinstall --strict 'grpcio-status >= 1.48.1'
uv run pytest plugin_tests/h_spark
- name: Test pyspark
if: ${{ runner.os != 'Linux' }}
env:
PYSPARK_SUBMIT_ARGS: "--conf spark.sql.ansi.enabled=false pyspark-shell"
run: |
uv sync --group test --extra pyspark
uv pip install 'pyspark[connect]' 'grpcio'
uv pip install --no-cache --reinstall --strict 'grpcio-status >= 1.48.1'
uv run pytest plugin_tests/h_spark
# Vaex 4.19 supports py<=3.12 and numpy>2 (https://github.com/vaexio/vaex/pull/2449) but limited by dask<2024.9
# For now the test matrix is py3.10 and numpy<2
- name: Test vaex
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.10' }}
run: |
sudo apt-get install --no-install-recommends --yes libpcre3-dev cargo
uv sync --group test --extra vaex
uv pip install "numpy<2"
uv run --no-sync pytest plugin_tests/h_vaex
- name: Test vaex
if: ${{ runner.os != 'Linux' && matrix.python-version == '3.10' }}
run: |
uv sync --group test --extra vaex
uv pip install "numpy<2"
uv run --no-sync pytest plugin_tests/h_vaex