Skip to content

Commit

Permalink
Implement pipreqs in CI (squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Dec 22, 2023
1 parent 7ee6b15 commit 38dc630
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 9 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,39 @@ jobs:
- name: mypy --> Static type checking
# Configured in pyprojet.toml
run: mypy **/*.py

# Use pipreqs to check for missing dependencies
pipreqs-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install pipreqs
run: pip install pipreqs

- name: Install requirements
run: pip install -r requirements.txt

- name: Run pipreqs
run: pipreqs --savepath pipreqs.txt

- name: Compare requirements
run: |
# Extract and sort package names
awk '{print $1}' $1 | sort -u > "$1".compare
awk -F'==' '{print $1}' $2 | sort -u > "$2".compare
# Compare package lists
if cmp -s "$1".compare "$2".compare
then
echo "Requirements are the same"
exit 0
else
echo "Requirements are different"
exit 1
fi
26 changes: 17 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
CouchDB==1.2
genologics==1.0.0
google_api_python_client==2.111.0
httplib2==0.22.0
interop==1.3.1
oauth2client==4.1.3
pandas==2.1.4
protobuf==4.25.1
psycopg2==2.9.9
CouchDB
flowcell_parser @ git+https://github.com/SciLifeLab/flowcell_parser
genologics
google_api_python_client
httplib2
interop
Markdown
numpy
oauth2client
pandas
protobuf
psycopg2
PyYAML
Requests
scilifelab_parsers @ git+https://github.com/SciLifeLab/scilifelab_parsers
setuptools
tabulate

0 comments on commit 38dc630

Please sign in to comment.