Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/use uv python management #994

Merged
merged 36 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0ed4862
Remove requirements files and add dependencies into pyproject.toml in…
timsaucer Jan 12, 2025
88aff7e
Remove old conda files since we will use uv as our primary method for…
timsaucer Jan 12, 2025
32604e3
Working through CI changes to use uv instead of pip and conda
timsaucer Jan 12, 2025
21ac4a8
Add uv lock to exclude files
timsaucer Jan 12, 2025
2857364
Revert "Remove old conda files since we will use uv as our primary me…
timsaucer Jan 12, 2025
5c33fb2
Windows workflows don't use source command
timsaucer Jan 12, 2025
892d305
Add in extra include for ignoreing rat
timsaucer Jan 13, 2025
56c7e93
Use uv commands in CI
timsaucer Jan 13, 2025
8054104
Remove conda recipes and CI stages
timsaucer Jan 13, 2025
4ee66ac
Working on CI using uv
timsaucer Jan 13, 2025
774510b
Install doc requirements
timsaucer Jan 13, 2025
f0b2234
Remove caching uv
timsaucer Jan 13, 2025
9196f59
Set uv venv
timsaucer Jan 13, 2025
5ae5d6e
Add requirements for building
timsaucer Jan 13, 2025
442d83b
Revert github action to allowed one
timsaucer Jan 13, 2025
da3a519
Call uv sync with verbose mode so users can see the build occuring in CI
timsaucer Jan 13, 2025
e2bf5d9
Test setting specific hash on action
timsaucer Jan 13, 2025
d6b8b41
Test setting rust-toolchain github action with pinned version
timsaucer Jan 14, 2025
d94d703
Testing night rust toolchain against apache rejection criteria
timsaucer Jan 14, 2025
338794f
Github action is fickle with the pattern matching
timsaucer Jan 14, 2025
4cfa108
Switch all Ci to use nightly rust toolchain until infra team whitelis…
timsaucer Jan 14, 2025
f547fe2
Speed up CI by preventing build during uv sync
timsaucer Jan 14, 2025
1f35a56
Additional uv commands missing no-project option
timsaucer Jan 14, 2025
6179d9b
Setting python versions of dependencies to match lowest supported pyt…
timsaucer Jan 14, 2025
e27831d
Update maturin and move to deps for dev
timsaucer Jan 14, 2025
d299124
CI ordering was wrong and maturin needed uv option
timsaucer Jan 14, 2025
49be265
Switch to stable toolchain
timsaucer Jan 14, 2025
5307acf
uv requires two dashes
timsaucer Jan 14, 2025
7c61b04
Submodule init
timsaucer Jan 14, 2025
a33d110
change directories for unit tests
timsaucer Jan 14, 2025
eeb88bd
Add deps for build
timsaucer Jan 14, 2025
29437b3
Maturin build doesn't take uv as parameter
timsaucer Jan 14, 2025
6491bdf
Update documentation for setting up with uv
timsaucer Jan 14, 2025
9c0c8dc
Enable cache in CI
timsaucer Jan 14, 2025
755a8f5
Update documentation to use uv
timsaucer Jan 14, 2025
48890c3
Small adjustment to CI config
timsaucer Jan 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,30 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
uses: astral-sh/setup-uv@v5

# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: |
timsaucer marked this conversation as resolved.
Show resolved Hide resolved
ruff check --output-format=github python/
ruff format --check python/
uv run ruff check --output-format=github python/
uv run ruff format --check python/

generate-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
timsaucer marked this conversation as resolved.
Show resolved Hide resolved
id: rust-toolchain
with:
profile: minimal
toolchain: stable
override: true

- name: Generate license file
run: python ./dev/create_license.py
run: uv run python ./dev/create_license.py
- uses: actions/upload-artifact@v4
with:
name: python-wheel-license
Expand All @@ -78,12 +80,6 @@ jobs:
with:
toolchain: stable

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install maturin
run: pip install maturin==1.5.1

- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
Expand All @@ -97,8 +93,11 @@ jobs:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies and build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't installing dependencies in this step.

uses: astral-sh/setup-uv@v5

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

- name: List Windows wheels
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -136,12 +135,6 @@ jobs:
with:
toolchain: stable

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install maturin
run: pip install maturin==1.5.1

- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v4
Expand All @@ -155,9 +148,11 @@ jobs:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies and build
uses: astral-sh/setup-uv@v5

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

- name: List Mac wheels
run: find target/wheels/
Expand Down
107 changes: 0 additions & 107 deletions .github/workflows/conda.yml

This file was deleted.

21 changes: 8 additions & 13 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,22 @@ jobs:
version: '27.4'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: |
set -x
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-311.txt
pip install -r docs/requirements.txt
- name: Build Datafusion
- name: Install dependencies and build
uses: astral-sh/setup-uv@v5

- name: Build repo
run: |
set -x
source venv/bin/activate
maturin develop
uv venv
uv sync --dev -v

- name: Build docs
run: |
set -x
source venv/bin/activate
cd docs
uv pip install -r requirements.txt
timsaucer marked this conversation as resolved.
Show resolved Hide resolved
curl -O https://gist.githubusercontent.com/ritchie46/cac6b337ea52281aa23c049250a4ff03/raw/89a957ff3919d90e6ef2d34235e6bf22304f3366/pokemon.csv
curl -O https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-01.parquet
make html
uv run make html

- name: Copy & push the generated HTML
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
Expand Down
52 changes: 9 additions & 43 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,57 +67,25 @@ jobs:
key: cargo-cache-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }}

- name: Check Formatting
uses: actions-rs/cargo@v1
if: ${{ matrix.python-version == '3.10' && matrix.toolchain == 'stable' }}
with:
command: fmt
args: -- --check
run: cargo fmt -- --check

- name: Run Clippy
uses: actions-rs/cargo@v1
if: ${{ matrix.python-version == '3.10' && matrix.toolchain == 'stable' }}
with:
command: clippy
args: --all-targets --all-features -- -D clippy::all -A clippy::redundant_closure

- name: Create Virtualenv (3.12)
if: ${{ matrix.python-version == '3.12' }}
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements-312.txt
run: cargo clippy --all-targets --all-features -- -D clippy::all -A clippy::redundant_closure

- name: Create Virtualenv (3.10)
if: ${{ matrix.python-version == '3.10' }}
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements-310.txt

- name: Create Virtualenv (3.11)
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements-311.txt
- name: Install dependencies and build
uses: astral-sh/setup-uv@v5

- name: Run tests
env:
RUST_BACKTRACE: 1
run: |
git submodule update --init
source venv/bin/activate
pip install -e . -vv
pytest -v .
run: uv run pytest -v .

- name: FFI unit tests
run: |
source venv/bin/activate
pip install -e . -vv
pip install maturin==1.5.1
cd examples/ffi-table-provider
maturin develop --release --strip
pytest python/tests/_test_table_provider.py
uv run maturin develop
uv run pytest python/tests/_test_table_provider.py

- name: Cache the generated dataset
id: cache-tpch-dataset
Expand All @@ -134,7 +102,5 @@ jobs:

- name: Run TPC-H examples
run: |
source venv/bin/activate
cd examples/tpch
python convert_data_to_parquet.py
pytest _tests.py
uv run python convert_data_to_parquet.py
uv run pytest _tests.py
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

repos:
- repo: https://github.com/rhysd/actionlint
rev: v1.6.23
rev: v1.7.6
hooks:
- id: actionlint-docker
- id: actionlint-docker
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.0
Expand Down
44 changes: 0 additions & 44 deletions conda/environments/datafusion-cuda-dev.yaml

This file was deleted.

Loading
Loading