Skip to content

Commit

Permalink
Add and use requirements.txt
Browse files Browse the repository at this point in the history
Add a `requirements.txt` file to pin dependencies, direct and
transitive. This was achieved by, in a clean Docker image, first running
`pip3 freeze` to get irrelevant packages, then running the existing
`pip3 install` (from CI) command, and then running `pip3 freeze` again
to get this project's dependencies.

Both CIs have been updated to use the requirements.txt file to install
dependencies. Besides improving reproducibility, this also avoids
duplication.

The benefit of doing this is that the same versions of Python
dependencies will always be used for this project. If the registry is
trusted you can also be sure that the same source code is always run
(the absence of local checksums means this isn't the case if the
registry isn't trusted).
  • Loading branch information
ericcornelissen committed May 1, 2024
1 parent e0b2117 commit b7c2e2a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- run: pip3 install jsonschema pytest
- run: pip3 install -r requirements.txt
- run: py.test -vv
- run: python3 validate.py
- run: php validate.php
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: python
python: 3.11.0

install:
- pip3 install jsonschema pytest
- pip3 install -r requirements.txt
- npm clean-install

script:
Expand Down
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
attrs==23.2.0
iniconfig==2.0.0
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
packaging==24.0
pluggy==1.5.0
pytest==8.2.0
referencing==0.35.0
rpds-py==0.18.0

0 comments on commit b7c2e2a

Please sign in to comment.