Skip to content

Commit

Permalink
[CHORE] switch CI to use UV (#2716)
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 authored Aug 23, 2024
1 parent 959f8f6 commit a235f80
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 36 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/daft-profiling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
TPCH_SCALE_FACTOR: '4'
TPCH_NUM_PARTS: '32'
PYTHON_VERSION: '3.9'
UV_SYSTEM_PYTHON: 1


jobs:
Expand Down Expand Up @@ -37,11 +38,11 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Build Rust Library
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/nightlies-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

env:
DAFT_ANALYTICS_ENABLED: '0'
UV_SYSTEM_PYTHON: 1

jobs:
integration-test-tpch:
Expand All @@ -34,8 +35,8 @@ jobs:
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt getdaft --pre --extra-index-url https://pypi.anaconda.org/daft-nightly/simple --force-reinstall
pip install uv
uv pip install -r requirements-dev.txt getdaft --pre --extra-index-url https://pypi.anaconda.org/daft-nightly/simple --force-reinstall
rm -rf daft
- uses: actions/cache@v4
env:
Expand Down Expand Up @@ -98,8 +99,8 @@ jobs:
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt getdaft --pre --extra-index-url https://pypi.anaconda.org/daft-nightly/simple --force-reinstall
pip install uv
uv pip install -r requirements-dev.txt getdaft --pre --extra-index-url https://pypi.anaconda.org/daft-nightly/simple --force-reinstall
rm -rf daft
- name: Prepare tmpdirs for IO services
run: |
Expand Down
47 changes: 25 additions & 22 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

env:
DAFT_ANALYTICS_ENABLED: '0'
UV_SYSTEM_PYTHON: 1

jobs:

Expand Down Expand Up @@ -68,27 +69,27 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install dependencies
if: ${{ (runner.os != 'Windows') }}
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
activate
uv pip install -r requirements-dev.txt
- name: Install dependencies (Windows)
if: ${{ (runner.os == 'Windows') }}
run: |
.\venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Override pyarrow
if: ${{ (matrix.pyarrow-version) && (runner.os != 'Windows') }}
run: pip install pyarrow==${{ matrix.pyarrow-version }}
run: uv pip install pyarrow==${{ matrix.pyarrow-version }}

- name: Override deltalake for pyarrow
if: ${{ (matrix.pyarrow-version == '7.0.0') }}
run: pip install deltalake==0.10.0
run: uv pip install deltalake==0.10.0

- name: Build library and Test with pytest (unix)
if: ${{ (runner.os != 'Windows') }}
Expand Down Expand Up @@ -238,14 +239,16 @@ jobs:
pattern: wheels-*
merge-multiple: true
path: dist

- name: Setup Virtual Env
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
uv pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
rm -rf daft
- uses: actions/cache@v4
env:
Expand Down Expand Up @@ -316,10 +319,10 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
uv pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
rm -rf daft
- name: Prepare tmpdirs for IO services
run: |
Expand Down Expand Up @@ -399,10 +402,10 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
uv pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
rm -rf daft
- name: Prepare tmpdirs for IO services
run: |
Expand Down Expand Up @@ -488,10 +491,10 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
uv pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
rm -rf daft
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
Expand Down Expand Up @@ -566,10 +569,10 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install Daft and dev dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
uv pip install -r requirements-dev.txt dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall
rm -rf daft
- name: Spin up services
run: |
Expand Down Expand Up @@ -642,10 +645,10 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Build Rust Library
run: |
source activate
Expand Down Expand Up @@ -782,10 +785,10 @@ jobs:
run: |
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
pip install uv
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Run doctests
run: |
source activate
Expand Down Expand Up @@ -940,8 +943,8 @@ jobs:

- name: Install pre-commit
run: |
pip install --upgrade pip
pip install pre-commit
pip install uv
uv pip install pre-commit
- uses: moonrepo/setup-rust@v1
with:
cache: false
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
PACKAGE_NAME: getdaft
PYTHON_VERSION: 3.11
DAFT_ANALYTICS_ENABLED: '0'
UV_SYSTEM_PYTHON: 1

IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')) }}
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
Expand Down Expand Up @@ -45,7 +46,8 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- run: pip install -U twine toml
- run: pip install uv
- run: uv pip install twine toml
- run: python tools/patch_package_version.py
- name: Build wheels - Mac and Windows x86
if: ${{ ((matrix.os == 'macos') || (matrix.os == 'windows')) && (matrix.compile_arch == 'x86_64') }}
Expand Down Expand Up @@ -90,7 +92,7 @@ jobs:
- name: Install and test built wheel - Linux and Mac x86_64
if: ${{ (matrix.os == 'ubuntu') && (matrix.compile_arch == 'x86_64') }}
run: |
pip install -r requirements-dev.txt dist/${{ env.PACKAGE_NAME }}-*x86_64*.whl --force-reinstall
uv pip install -r requirements-dev.txt dist/${{ env.PACKAGE_NAME }}-*x86_64*.whl --force-reinstall
rm -rf daft
pytest -v
# Disable until we figure out why are we getting FileNotFoundError: [WinError 3] Failed to open local file
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ray-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
DAFT_ANALYTICS_ENABLED: '0'
UV_SYSTEM_PYTHON: 1

jobs:
build:
Expand Down Expand Up @@ -40,21 +41,20 @@ jobs:
python -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH
- name: Upgrade Pip
run: pip install --upgrade pip
- name: Install uv
run: pip install uv

- name: Install to pin Ray versions
run: pip install ray[data,default]==${{ matrix.ray-version }}
run: uv pip install ray[data,default]==${{ matrix.ray-version }}

# Ray requires a pinned protobuf<4.0 for versions of Ray <1.13 (see: https://github.com/ray-project/ray/pull/25211)
- name: Install to pin Protobuf version (for Ray <1.13)
if: ${{ matrix.ray-version == '1.12.0' || matrix.ray-version == '1.11.0' || matrix.ray-version == '1.10.0' }}
run: pip install protobuf==3.20.3
run: uv pip install protobuf==3.20.3

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Build Rust Library
run: |
Expand Down

0 comments on commit a235f80

Please sign in to comment.