Skip to content

Commit

Permalink
update pipreqs script in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Jul 1, 2024
1 parent 437a026 commit e6840c7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,19 @@ jobs:
with:
python-version: "3.10"

- name: Install pipreqs
run: pip install pipreqs

- name: Install requirements
run: pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipreqs
- name: Run pipreqs
run: pipreqs --savepath pipreqs.txt taca

- name: Compare requirements
run: |
# Extract and sort package names
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' requirements.txt | sort -u > requirements.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' pipreqs.txt | sort -u > pipreqs.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' requirements.txt | tr '[:upper:]' '[:lower:]' | sort -u > requirements.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{print $1}' pipreqs.txt | tr '[:upper:]' '[:lower:]' | sort -u > pipreqs.compare
# Compare package lists
if cmp -s requirements.compare pipreqs.compare
Expand Down

0 comments on commit e6840c7

Please sign in to comment.