Repository navigation
62 lines (51 loc) · 1.58 KB
/
Copy pathsdk-python.yml
File metadata and controls
62 lines (51 loc) · 1.58 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
name: Core SDK (python)
permissions:
contents: read
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
env:
CONFORMANCE_SPEC_REPO: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: python/pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# If a constraints.txt file is present, use it to pin critical dependency versions.
if [ -f constraints.txt ]; then
pip install -e ".[all,dev]" -c constraints.txt
else
pip install -e ".[all,dev]"
fi
- name: Verify canonical conformance fixture checkout
run: pytest tests/conformance/test_fixture_checkout.py -q
- name: Lint with Ruff
run: |
ruff check src/ tests/
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
- name: Type check with Pyright
run: npx --yes --package pyright@1.1.414 -- pyright --pythonpath "$(command -v python)" src
- name: Run tests
run: |
pytest