Skip to content

Commit 4ee66ac

Browse files
committed
Working on CI using uv
1 parent 8054104 commit 4ee66ac

File tree

3 files changed

+21
-39
lines changed

3 files changed

+21
-39
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535

3636
- name: Install dependencies
3737
uses: astral-sh/setup-uv@v5
38+
with:
39+
enable-cache: true
3840

3941
# Update output format to enable automatic inline annotations.
4042
- name: Run Ruff
@@ -89,6 +91,8 @@ jobs:
8991

9092
- name: Install dependencies and build
9193
uses: astral-sh/setup-uv@v5
94+
with:
95+
enable-cache: true
9296

9397
- name: Build Python package
9498
run: uv run maturin build --release --strip --features substrait
@@ -142,6 +146,8 @@ jobs:
142146

143147
- name: Install dependencies and build
144148
uses: astral-sh/setup-uv@v5
149+
with:
150+
enable-cache: true
145151

146152
- name: Build Python package
147153
run: uv run maturin build --release --strip --features substrait

.github/workflows/docs.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,13 @@ jobs:
5858
repo-token: ${{ secrets.GITHUB_TOKEN }}
5959

6060
- name: Install dependencies and build
61-
run: |
62-
python -m pip install uv
63-
uv venv
64-
source .venv/bin/activate
65-
uv sync --dev
61+
uses: astral-sh/setup-uv@v5
62+
with:
63+
enable-cache: true
6664

6765
- name: Build docs
6866
run: |
6967
set -x
70-
source venv/bin/activate
7168
cd docs
7269
curl -O https://gist.githubusercontent.com/ritchie46/cac6b337ea52281aa23c049250a4ff03/raw/89a957ff3919d90e6ef2d34235e6bf22304f3366/pokemon.csv
7370
curl -O https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-01.parquet

.github/workflows/test.yaml

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ jobs:
4343
- uses: actions/checkout@v4
4444

4545
- name: Setup Rust Toolchain
46-
uses: actions-rs/toolchain@v1
46+
uses: dtolnay/rust-toolchain@stable
4747
id: rust-toolchain
48-
with:
49-
toolchain: ${{ matrix.toolchain }}
50-
override: true
5148

5249
- name: Install Protoc
5350
uses: arduino/setup-protoc@v3
@@ -64,46 +61,30 @@ jobs:
6461
uses: actions/cache@v4
6562
with:
6663
path: ~/.cargo
67-
key: cargo-cache-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }}
64+
key: cargo-cache-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('Cargo.lock') }}
6865

6966
- name: Check Formatting
70-
uses: actions-rs/cargo@v1
7167
if: ${{ matrix.python-version == '3.10' && matrix.toolchain == 'stable' }}
72-
with:
73-
command: fmt
74-
args: -- --check
68+
run: cargo fmt -- --check
7569

7670
- name: Run Clippy
77-
uses: actions-rs/cargo@v1
7871
if: ${{ matrix.python-version == '3.10' && matrix.toolchain == 'stable' }}
79-
with:
80-
command: clippy
81-
args: --all-targets --all-features -- -D clippy::all -A clippy::redundant_closure
72+
run: cargo clippy --all-targets --all-features -- -D clippy::all -A clippy::redundant_closure
8273

8374
- name: Install dependencies and build
84-
run: |
85-
python -m pip install uv
86-
uv venv
87-
source .venv/bin/activate
88-
uv sync --dev
75+
uses: astral-sh/setup-uv@v5
76+
with:
77+
enable-cache: true
8978

9079
- name: Run tests
9180
env:
9281
RUST_BACKTRACE: 1
93-
run: |
94-
git submodule update --init
95-
source venv/bin/activate
96-
pip install -e . -vv
97-
pytest -v .
82+
run: uv run pytest -v .
9883

9984
- name: FFI unit tests
10085
run: |
101-
source venv/bin/activate
102-
pip install -e . -vv
103-
pip install maturin==1.5.1
104-
cd examples/ffi-table-provider
105-
maturin develop --release --strip
106-
pytest python/tests/_test_table_provider.py
86+
uv run maturin develop --release --strip
87+
uv run pytest python/tests/_test_table_provider.py
10788
10889
- name: Cache the generated dataset
10990
id: cache-tpch-dataset
@@ -120,7 +101,5 @@ jobs:
120101
121102
- name: Run TPC-H examples
122103
run: |
123-
source venv/bin/activate
124-
cd examples/tpch
125-
python convert_data_to_parquet.py
126-
pytest _tests.py
104+
uv run python convert_data_to_parquet.py
105+
uv run pytest _tests.py

0 commit comments

Comments
 (0)