Skip to content

Commit

Permalink
Use uv for CI (#412)
Browse files Browse the repository at this point in the history
* Use uv for CI

* Set default shell to bash

* Explicitly provide package name

* Use find

* Remove default shell

* Fix syntax for install with extras

* Move quote

* Update codecov-action to v4

* Don't cache for now

* Pin to v1
  • Loading branch information
jayqi authored Mar 1, 2024
1 parent fc28ff9 commit 8a4198a
Showing 1 changed file with 26 additions and 44 deletions.
70 changes: 26 additions & 44 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
cache: "pip" # caching pip dependencies
cache-dependency-path: |
pyproject.toml
requirements-dev.txt
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Lint package
run: |
Expand All @@ -45,21 +40,16 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: ${{ matrix.python-version }}
cache: "pip" # caching pip dependencies
cache-dependency-path: |
pyproject.toml
requirements-dev.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Run mocked tests
run: |
Expand All @@ -69,14 +59,14 @@ jobs:
shell: bash
run: |
make dist
python -m pip install dist/cloudpathlib-*.whl --no-deps --force-reinstall
uv pip install cloudpathlib@$(find dist -name 'cloudpathlib*.whl') --no-deps --force-reinstall
python -c "import cloudpathlib"
python -m pip install dist/cloudpathlib-*.tar.gz --no-deps --force-reinstall
uv pip install cloudpathlib@$(find dist -name 'cloudpathlib*.tar.gz') --no-deps --force-reinstall
python -c "import cloudpathlib"
- name: Upload coverage to codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand All @@ -88,21 +78,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
cache: "pip" # caching pip dependencies
cache-dependency-path: |
pyproject.toml
requirements-dev.txt
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
uv pip install -r requirements-dev.txt
- name: Set up Cloud SDK
uses: google-github-actions/[email protected]
Expand All @@ -127,8 +112,9 @@ jobs:
CUSTOM_S3_ENDPOINT: ${{secrets.CUSTOM_S3_ENDPOINT}}

- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true

Expand All @@ -148,30 +134,26 @@ jobs:
extra: "gs"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
cache: "pip"
cache-dependency-path: |
pyproject.toml
requirements-dev.txt
python-version: "3.11"

- name: Build cloudpathlib
run: |
pip install --upgrade pip build
uv pip install build
make dist # build cloudpathlib wheel
- name: Create empty venv
run: |
python -m venv ${{ matrix.extra }}-env
uv venv ${{ matrix.extra }}-env
- name: Install cloudpathlib[${{ matrix.extra }}]
run: |
source ${{ matrix.extra }}-env/bin/activate
pip install "$(find dist -name 'cloudpathlib*.whl')[${{ matrix.extra }}]"
uv pip install "cloudpathlib[${{ matrix.extra }}]@$(find dist -name 'cloudpathlib*.whl')"
- name: Test ${{ matrix.extra }} usage
run: |
Expand Down

0 comments on commit 8a4198a

Please sign in to comment.