Skip to content

Commit

Permalink
TST: speed up env resolution with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jul 2, 2024
1 parent c0b48c1 commit 6605b2d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: |
pipx run uv pip compile pyproject.toml > deps.txt
pip install -r deps.txt
- uses: yezz123/setup-uv@v4
with:
uv-version: 0.2.18
uv-venv: .venv
- run: uv pip compile pyproject.toml | uv pip install -r -
- run: shopt -s globstar
# - run: pip install safety && safety check
37 changes: 22 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,26 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/dev.txt ${{ matrix.pip-args }}
- uses: yezz123/setup-uv@v4
with:
uv-version: 0.2.18
uv-venv: .venv

- run: uv pip install -r requirements/dev.txt ${{ matrix.pip-args }}

- if: matrix.with-viscm
run: python -m pip install "viscm>=0.10"
run: uv pip install "viscm>=0.10"

- if: matrix.deps == 'minimal'
run: |
pipx run uv pip compile pyproject.toml --resolution=lowest-direct > mindeps.txt
python -m pip install --requirement mindeps.txt \
uv pip compile pyproject.toml --resolution=lowest-direct | uv pip install -r - \
--only-binary ':all:' ${{ matrix.pip-args }}
- name: Build
run: |
python -m pip install -e .
uv pip install -e .
- run: python -m pip list
- run: uv pip list

- name: Test package
run: |
Expand Down Expand Up @@ -99,12 +101,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: yezz123/setup-uv@v4
with:
uv-version: 0.2.18
uv-venv: .venv

- name: Build
run: |
python -m pip install --upgrade pip
python -m pip install "."
python -m pip install -r requirements/typecheck.txt
uv pip install "."
uv pip install -r requirements/typecheck.txt
- name: Run mypy
run: mypy cmasher
Expand All @@ -123,11 +128,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: yezz123/setup-uv@v4
with:
uv-version: 0.2.18
uv-venv: .venv
- name: Setup env
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/docs.txt
- run: python -m pip freeze
run: uv pip install -r requirements/docs.txt
- run: uv pip freeze
- name: Build
run: |
sphinx-build -M html docs/source site -W
Expand Down

0 comments on commit 6605b2d

Please sign in to comment.