Repository navigation
70 lines (66 loc) · 2.37 KB
/
Copy pathci.yml
File metadata and controls
70 lines (66 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI
on:
push:
branches: [main]
pull_request:
workflow_call:
permissions:
contents: read
jobs:
checks:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.15"
- name: Check release version
if: startsWith(github.ref, 'refs/tags/')
run: test "${GITHUB_REF_NAME#v}" = "$(uv version --short)"
- run: uv run --locked ruff check .
- run: uv run --locked ruff format --check .
- run: uv run --locked basedpyright
- run: uv run --locked basedpyright --verifytypes partial_python --ignoreexternal
- run: uv build --no-sources
- name: Check minimum build backend
run: |
echo 'uv_build==0.7.19' > "$RUNNER_TEMP/build-constraints.txt"
uv build --no-sources --force-pep517 --build-constraints "$RUNNER_TEMP/build-constraints.txt" --out-dir "$RUNNER_TEMP/dist-minimum"
- name: Test installed distributions
run: |
for version in 3.11 3.15; do
for package in dist/* "$RUNNER_TEMP"/dist-minimum/*; do
uv run --isolated --no-project --python "$version" --with "$package" python -I -c 'from importlib.metadata import requires; from importlib.resources import files; assert not requires("partial-python"); assert files("partial_python").joinpath("py.typed").is_file()'
uv run --isolated --no-project --python "$version" --with "$package" python -I examples/streaming_tools.py
done
done
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
if-no-files-found: error
test:
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
include:
- os: macos-latest
python-version: "3.15"
- os: windows-latest
python-version: "3.15"
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- run: uv run --locked pytest