Skip to content

Commit

Permalink
Move to UV for dependency management (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
knifecake authored Dec 11, 2024
1 parent aa1c812 commit c3aea5f
Show file tree
Hide file tree
Showing 9 changed files with 796 additions and 988 deletions.
52 changes: 20 additions & 32 deletions .github/workflows/compatibility_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -21,86 +21,74 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
- name: Install UV
run: |
python -m pip install poetry==1.8.3
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
python -m pip install uv==0.5.8
- name: Install dependencies
run: |
poetry install --no-root
uv sync
- name: Run tests
run: |
poetry run python runtests.py
uv run runtests.py
django_compatibility_test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
django-version: ["4.2", "5.0"]
django-version: ["4.2", "5.1"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.11"

- name: Install poetry
run: |
python -m pip install poetry==1.8.3
python-version: "3.13"

- name: Configure poetry
- name: Install UV
run: |
python -m poetry config virtualenvs.in-project true
python -m pip install uv==0.5.8
- name: Install dependencies
run: |
poetry install --no-root
uv sync
- name: Install Django ${{ matrix.django-version }}
run: |
poetry add "Django==${{ matrix.django-version }}"
uv add "django==${{ matrix.django-version }}" --frozen
- name: Run tests
run: |
poetry run python runtests.py
uv run runtests.py
pillow_compatibility_test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
pillow-version: ["8.4.0", "9.5.0", "10.0.0"]
pillow-version: ["10.4.0", "11.0.0"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.13"

- name: Install poetry
- name: Install UV
run: |
python -m pip install poetry==1.8.3
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
python -m pip install uv==0.5.8
- name: Install dependencies
run: |
poetry install --no-root
uv sync
- name: Install Django ${{ matrix.django-version }}
- name: Install Pillow ${{ matrix.pillow-version }}
run: |
poetry add "Django==${{ matrix.django-version }}"
uv add "pillow==${{ matrix.pillow-version }}" --frozen
- name: Run tests
run: |
poetry run python runtests.py
uv run runtests.py
26 changes: 7 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.12"]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -21,34 +21,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
- name: Install UV
run: |
python -m pip install poetry==1.8.3
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Validate the structure of the pyproject.toml
run: |
poetry check
- name: Verify that poetry.lock is consistent with pyproject.toml
run: |
poetry check --lock
python -m pip install uv==0.5.8
- name: Install dependencies
run: |
poetry install --no-root
uv sync
- name: Run pre-commit hooks
run: |
poetry run pre-commit run --all-files
uv run pre-commit run --all-files
- name: Run tests
run: |
poetry run coverage run runtests.py
uv run coverage run runtests.py
- name: Report coverage
run: |
poetry run coverage report -m --skip-covered
uv run coverage report -m --skip-covered
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ demo/media
docs/_build
tmp
dist/
*.egg-info
.venv
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3.12
python: python3.13

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python 3.12.4
poetry 1.8.3
python 3.13.1
uv 0.5.8
3 changes: 3 additions & 0 deletions anchor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VERSION = (0, 5, 0)

__version__ = ".".join(map(str, VERSION))
Loading

0 comments on commit c3aea5f

Please sign in to comment.