Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 74128b0

Browse files
committedDec 4, 2023
Add tox env to validate requirements
This will check that our requirements are appropriately compiled.
1 parent c5630a1 commit 74128b0

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
 

‎.github/workflows/backend.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ on:
44
workflow_dispatch:
55
paths:
66
- '**.py'
7-
- 'requirements/**.txt'
7+
- 'requirements/**.in'
88
- '**.html'
99
- '**.mo'
1010
- '**.po'
1111
pull_request:
1212
paths:
1313
- '**.py'
14-
- 'requirements/**.txt'
14+
- 'requirements/**.in'
1515
- '**.html'
1616
- '**.mo'
1717
- '**.po'
1818
merge_group:
1919
paths:
2020
- '**.py'
21-
- 'requirements/**.txt'
21+
- 'requirements/**.in'
2222
- '**.html'
2323
- '**.mo'
2424
- '**.po'
@@ -34,6 +34,7 @@ jobs:
3434
- validate-migrations
3535
- validate-assets
3636
- validate-translations
37+
- validate-requirements
3738
- unittest
3839

3940
services:

‎tox.ini

+19-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ commands=
172172
# Invoke with: tox -e validate-translations
173173
# Ensure that there are no changes to translatable strings that aren't
174174
# contained in the comitted portable object files.
175-
# This ultimate tests whether the generated django.mo file has changed
175+
# This ultimately tests whether the generated django.mo file has changed
176176
# (the django.po file will change because it includes the date it was
177177
# generated).
178178
# NOTE: Requires gettext. Will overwrite any existing
@@ -191,6 +191,24 @@ commands=
191191
git diff --quiet */locale/*/LC_MESSAGES/django.mo
192192

193193

194+
[testenv:validate-requirements]
195+
# Invoke with: tox -e validate-requirements
196+
# Ensure that there are no changes to dependencies in our requirements/*.in
197+
# files that haven't been compiled to the requirements/*.txt files.
198+
# NOTE: Will overwrite any existing requirements/*.txt files
199+
recreate=False
200+
envdir={toxworkdir}/unittest
201+
deps=
202+
{[unittest-config]deps}
203+
setenv={[unittest-config]setenv}
204+
allowlist_externals=
205+
./compile-requirements.sh
206+
git
207+
commands=
208+
./compile-requirements.sh
209+
git diff --quiet requirements/*.txt
210+
211+
194212
[testenv:coverage]
195213
# Invoke with: tox -e coverage
196214
# Report out the coverage of changes on the current branch against the main

0 commit comments

Comments
 (0)
Please sign in to comment.