Skip to content

Commit 42cc5cc

Browse files
fix(ci): fix build with uv (#225)
fix(ci): fix build w/ uv Co-authored-by: Abhi Agarwal <[email protected]>
1 parent 5ff4a74 commit 42cc5cc

File tree

1 file changed

+21
-28
lines changed

1 file changed

+21
-28
lines changed

.github/workflows/main.yaml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,26 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030

31-
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
31+
- name: Set up uv and Python
32+
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
3333
with:
34+
version: "0.8.17"
35+
checksum: "920cbcaad514cc185634f6f0dcd71df5e8f4ee4456d440a22e0f8c0f142a8203"
3436
python-version: ${{ matrix.python-version }}
35-
cache: "pip"
36-
cache-dependency-path: |
37-
**/pyproject.toml
37+
enable-cache: true
38+
cache-dependency-glob: "**/pyproject.toml"
3839

3940
- name: Install dependencies
4041
run: |
41-
pip install uv
42-
export UV_LINK_MODE=copy && \
43-
uv sync --group dev && \
44-
uv run ruff check --select I --fix . && \
45-
uv run ruff format . && \
46-
uv build
42+
uv sync
43+
uv pip install "urllib3==${{ matrix.urllib3-version }}"
44+
45+
- if: matrix.python-version == '3.10' && matrix.urllib3-version == '1.26.19'
46+
name: Run `ruff`
47+
run: uv run ruff check
4748

4849
- name: Run tests and collect coverage
49-
run: |
50-
export UV_LINK_MODE=copy && \
51-
uv sync --group dev && \
52-
uv run --with "urllib3==${{ matrix.urllib3-version }}" \
53-
pytest --cov-report term-missing --cov=openfga_sdk --cov-fail-under=60 test/ && \
54-
uv run ruff check .
50+
run: uv run pytest --cov-fail-under 60 --cov openfga_sdk
5551

5652
- if: matrix.python-version == '3.10' && matrix.urllib3-version == '1.26.19'
5753
name: Upload coverage to Codecov
@@ -74,23 +70,20 @@ jobs:
7470
with:
7571
fetch-depth: 0
7672

77-
- name: Set up Python
78-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
73+
- name: Set up uv and Python
74+
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
7975
with:
76+
version: "0.8.17"
77+
checksum: "920cbcaad514cc185634f6f0dcd71df5e8f4ee4456d440a22e0f8c0f142a8203"
8078
python-version: "3.10"
81-
cache: "pip"
82-
cache-dependency-path: |
83-
**/pyproject.toml
84-
**/requirements*.txt
85-
**/test-requirements*.txt
79+
enable-cache: true
80+
cache-dependency-glob: "**/pyproject.toml"
8681

8782
- name: Install dependencies
88-
run: pip install -r test-requirements.txt --upgrade pip
83+
run: uv sync
8984

9085
- name: Build package
91-
run: |
92-
pip install setuptools wheel
93-
python setup.py sdist bdist_wheel
86+
run: uv build
9487

9588
- name: Publish package
9689
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4

0 commit comments

Comments
 (0)