Skip to content

Commit 7461321

Browse files
committed
try lock test dependencies
1 parent fb2ffa0 commit 7461321

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Install Dependencies
5555
run: |
5656
just init ${{ steps.sp.outputs.python-path }} install-docs
57-
just lock Django~=${{ matrix.django-version }}.0
57+
just lock ${{ matrix.python-version }} Django~=${{ matrix.django-version }}.0
5858
- name: Install Emacs
5959
if: ${{ github.event.inputs.debug == 'true' }}
6060
run: |

.github/workflows/test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
run: |
108108
just init ${{ steps.sp.outputs.python-path }}
109109
just install-${{ matrix.psycopg-version }}
110-
just lock Django~=${{ matrix.django-version }}.0
110+
just test-lock ${{ matrix.python-version }} Django~=${{ matrix.django-version }}.0
111111
- name: Install Emacs
112112
if: ${{ github.event.inputs.debug == 'true' }}
113113
run: |
@@ -167,7 +167,7 @@ jobs:
167167
run: |
168168
just init ${{ steps.sp.outputs.python-path }}
169169
just install
170-
just lock Django~=${{ matrix.django-version }}.0
170+
just test-lock ${{ matrix.python-version }} Django~=${{ matrix.django-version }}.0
171171
- name: Install Emacs
172172
if: ${{ github.event.inputs.debug == 'true' }}
173173
run: |
@@ -271,11 +271,11 @@ jobs:
271271
run: |
272272
just init ${{ steps.sp.outputs.python-path }}
273273
just install-mysql
274-
just lock Django~=${{ matrix.django-version }}.0
274+
just test-lock ${{ matrix.python-version }} Django~=${{ matrix.django-version }}.0
275275
276276
- name: Install mysqlclient if needed
277277
if: ${{ matrix.mysqlclient-version != '' }}
278-
run: just lock mysqlclient==${{ matrix.mysqlclient-version }}
278+
run: just test-lock ${{ matrix.python-version }} mysqlclient==${{ matrix.mysqlclient-version }}
279279
- name: Run Unit Tests
280280
run: |
281281
just run ./manage.py makemigrations
@@ -373,11 +373,11 @@ jobs:
373373
run: |
374374
just init ${{ steps.sp.outputs.python-path }}
375375
just install-mysql
376-
just lock Django~=${{ matrix.django-version }}.0
376+
just test-lock ${{ matrix.python-version }} Django~=${{ matrix.django-version }}.0
377377
378378
- name: Install mysqlclient if needed
379379
if: ${{ matrix.mysqlclient-version != '' }}
380-
run: just lock mysqlclient==${{ matrix.mysqlclient-version }}
380+
run: just test-lock ${{ matrix.python-version }} mysqlclient==${{ matrix.mysqlclient-version }}
381381
- name: Run Unit Tests
382382
run: |
383383
just run ./manage.py makemigrations
@@ -480,7 +480,7 @@ jobs:
480480
run: |
481481
just init ${{ steps.sp.outputs.python-path }}
482482
just install-oracle
483-
just lock Django~=${{ matrix.django-version }}.0
483+
just test-lock ${{ matrix.python-version }} Django~=${{ matrix.django-version }}.0
484484
- name: Run Full Unit Tests
485485
run: |
486486
just run ./manage.py makemigrations

justfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ install-mysql:
4242
install-oracle:
4343
poetry install --with oracle
4444

45-
# install a dependency to a specific version e.g. just lock Django~=5.1.0
46-
lock +PACKAGES:
45+
# lock to specific python and versions of given dependencies
46+
test-lock PYTHON +PACKAGES:
47+
python -c 'import re; s=open("pyproject.toml").read(); open("pyproject.toml", "w").write(re.sub(r"^requires-python = .*$", "requires-python = \"{{ PYTHON }}\"", s, flags=re.M))'
4748
poetry add {{ PACKAGES }}
4849

4950
# run static type checking

0 commit comments

Comments
 (0)