Skip to content

Commit

Permalink
[feat] speedup CI with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jan 8, 2025
1 parent 5093684 commit ae56af6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,19 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.7", "pypy3.8", "pypy3.9", "pypy3.10"]
exclude:
- os: windows-latest
python-version: "3.7"
- os: windows-latest
python-version: "pypy3.7"
- os: windows-latest
python-version: "pypy3.8"
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install uv
run: pip install uv --disable-pip-version-check
- name: Install pdm
if: matrix.os != 'windows-latest'
run: uv tool install pdm
- name: Setup Python ${{ matrix.python-version }}
if: matrix.os != 'windows-latest' && matrix.python-version != '3.7' && matrix.python-version != 'pypy3.7'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup PDM and Python ${{ matrix.python-version }}
uses: pdm-project/setup-pdm@v4
if: matrix.os == 'windows-latest'
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create venv
run: uv v -p ${{ matrix.python-version }} || pdm venv create --force
enable-cache: true
cache-dependency-glob: pyproject.toml
- name: Install dependencies
run: pdm export --pyproject | uv pip install -r - .[playground]
run: uv export --no-hashes | uv pip install -r - .[playground]
- name: Run tests
run: |
pdm test
uvx pdm test
- name: Run static type checking
run: |
npm i -g pyright
pdm run pyright ./src/
uvx basedpyright ./src/
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build-backend = "pdm.backend"
[tool.pdm.build]
excludes = ["tests"]

[tool.pdm.dev-dependencies]
[dependency-groups]
dev = ["hypothesis", "tqdm", "pytest"]

[tool.pdm.scripts]
Expand All @@ -47,3 +47,4 @@ profile = "black"

[tool.pyright]
reportPossiblyUnboundVariable = false
typeCheckingMode = "standard"

0 comments on commit ae56af6

Please sign in to comment.