Skip to content

Commit

Permalink
use official github action for uv and uv build (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Sep 23, 2024
1 parent 551894c commit 4a7b17f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 40 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Upgrade nox and uv
run: |
python -m pip install --upgrade 'nox[uv]'
nox --version
uv --version
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: benchmarks
cache-dependency-glob: pyproject.toml

- name: Install nox and dvc
run: uv pip install dvc[gs] nox --system

- run: uv pip install dvc[gs] --system
- run: dvc --cd tests/benchmarks/datasets pull
- name: Pull dataset
run: dvc --cd tests/benchmarks/datasets pull
- name: Run benchmarks
run: nox -s bench
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Upgrade nox and uv
run: |
python -m pip install --upgrade 'nox[uv]'
nox --version
uv --version
- name: Setup uv
uses: astral-sh/setup-uv@v3

- name: Install nox
run: uv pip install nox --system
- name: Build package
run: nox -s build

Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/tests-studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
cache: 'pip'

- name: Install uv
run: |
python -m pip install --upgrade uv
uv --version
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: studio
cache-dependency-glob: |
backend/datachain_server/pyproject.toml
backend/datachain/pyproject.toml
- name: Install dependencies
run: uv pip install --system ./backend/datachain_server[tests] ./backend/datachain[tests]
Expand Down
45 changes: 27 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'

- name: Upgrade nox and uv
run: |
python -m pip install --upgrade 'nox[uv]'
nox --version
uv --version
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: lint
cache-dependency-glob: pyproject.toml

- name: Install nox
run: uv pip install nox --system

- name: Cache mypy
uses: actions/cache@v4
Expand Down Expand Up @@ -77,13 +80,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
cache: 'pip'

- name: Upgrade nox and uv
run: |
python -m pip install --upgrade 'nox[uv]'
nox --version
uv --version
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: tests-${{ matrix.pyv }}
cache-dependency-glob: pyproject.toml

- name: Install nox
run: uv pip install nox --system

- name: Skip flaky azure, gs remotes on macOS
if: runner.os == 'macOS'
Expand Down Expand Up @@ -134,13 +140,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
cache: 'pip'

- name: Upgrade nox and uv
run: |
python -m pip install --upgrade 'nox[uv]'
nox --version
uv --version
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: examples-${{ matrix.pyv }}
cache-dependency-glob: pyproject.toml

- name: Install nox
run: uv pip install nox --system

- name: Run examples
run: nox -s examples -p ${{ matrix.pyv }} -- -m "${{ matrix.group }}"
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def lint(session: nox.Session) -> None:

@nox.session
def build(session: nox.Session) -> None:
session.install("build", "twine", "uv")
session.run("python", "-m", "build", "--installer", "uv")
session.install("twine", "uv")
session.run("uv", "build")
dists = glob.glob("dist/*")
session.run("twine", "check", *dists, silent=True)

Expand Down

0 comments on commit 4a7b17f

Please sign in to comment.