Skip to content

Commit

Permalink
Use UV instead of pip
Browse files Browse the repository at this point in the history
  • Loading branch information
ayalash committed Sep 27, 2024
1 parent b4dc78e commit b1585d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
env:
UV_PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout the repository
uses: actions/checkout@main
- name: Install the default version of uv
id: setup-uv
uses: astral-sh/setup-uv@v3
- name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: make env
- name: Test with pytest
run: make test
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
default: test

test: env
.env/bin/pytest -v
uv run --extra testing pytest tests

env: .env/.up-to-date

.env/.up-to-date: pyproject.toml Makefile
python -m venv .env
.env/bin/pip install -e ".[testing]"
uv venv
uv pip install -e ".[testing]"
touch $@

0 comments on commit b1585d6

Please sign in to comment.