Skip to content

Commit

Permalink
uv package installer/resolver for speed
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed Feb 29, 2024
1 parent c6e1ec7 commit df3db34
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/lint-python.yml
Expand Up @@ -14,14 +14,15 @@ on:

jobs:
ruff:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -32,12 +33,27 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install uv and create venv
run: |
pip install -U pip uv
uv venv
- name: Enable macOS/Linux venv
if: runner.os != 'Windows'
run: |
source .venv/bin/activate
echo $PATH >> $GITHUB_PATH
- name: Enable Windows venv
if: runner.os == 'Windows'
run: |
.venv\Scripts\activate
echo $env:path >> $ENV:GITHUB_PATH
- name: Install dependencies
run: |
pip install -U pip
pip install .
pip install ruff ydiff
uv pip install -e . ruff ydiff
- name: Lint the code with ruff
run: |
ruff check $(git ls-files '*.py') --diff | ydiff -s
32 changes: 23 additions & 9 deletions .github/workflows/pytest.yml
Expand Up @@ -15,6 +15,7 @@ on:
jobs:
pytest:
strategy:
fail-fast: false
matrix:
os:
# - "ubuntu-latest" # doesn't work without headless
Expand All @@ -36,15 +37,28 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install uv and create venv
run: |
pip install -U pip uv
uv venv
- name: Enable macOS/Linux venv
if: runner.os != 'Windows'
run: |
source .venv/bin/activate
echo $PATH >> $GITHUB_PATH
- name: Enable Windows venv
if: runner.os == 'Windows'
run: |
.venv\Scripts\activate
echo $env:path >> $ENV:GITHUB_PATH
- name: Install dependencies
run: |
pip install -U pip
pip install .
pip install pytest-md
uv pip install -r requirements.txt
uv pip install -e . pytest pytest-cov
- name: Test code with pytest
uses: pavelzw/pytest-action@v2
with:
emoji: false
verbose: false
job-summary: true
- name: Test with pytest
run: |
pytest --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html

0 comments on commit df3db34

Please sign in to comment.