fix uv test locking

This commit is contained in:
Brian Kohan 2025-08-24 18:18:27 -07:00
parent 7645431fb9
commit 1aab9121dc
No known key found for this signature in database
GPG Key ID: 827B6A3B1AAE16EE
2 changed files with 14 additions and 1 deletions

View File

@ -69,7 +69,7 @@ jobs:
- name: Install Dependencies
run: |
just setup ${{ steps.sp.outputs.python-path }}
uv add Django~=${{ matrix.django-version }}.0
just test-lock Django~=${{ matrix.django-version }}.0
just install-docs
- name: Install Emacs
if: ${{ github.event.inputs.debug == 'true' }}

View File

@ -162,6 +162,19 @@ fix: lint format
# run all static checks
check: check-lint check-format check-types check-package check-docs check-docs-links _check-readme-quiet
[script]
_lock-python:
import tomlkit
import sys
f='pyproject.toml'
d=tomlkit.parse(open(f).read())
d['project']['requires-python']='=={}'.format(sys.version.split()[0])
open(f,'w').write(tomlkit.dumps(d))
# lock to specific python and versions of given dependencies
test-lock +PACKAGES: _lock-python
uv add {{ PACKAGES }}
# run tests
test *TESTS:
@just run pytest --cov-append {{ TESTS }}