Skip to content

Commit

Permalink
remove pipreqs from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Oct 23, 2024
1 parent 72cf543 commit 75694e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,3 @@ jobs:
pip install ruff
- name: ruff --> Check code formatting
run: ruff format --check .

# 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.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run pipreqs
run: |
pipreqs --savepath pipreqs.txt . 2>&1 | tee pipreqs_output.log
if grep -q 'WARNING: Package .* does not exist or network problems' pipreqs_output.log; then
missing_packages=$(grep 'WARNING: Package .* does not exist or network problems' pipreqs_output.log | sed -E 's/.*Package "(.*)" does not exist.*/\1/')
echo "ERROR: Add unresolved packages to requirements. Missing package(s): $missing_packages. Example: '<pkg> @ git+https://github.com/<author>/<repo>.git'"
exit 1
fi
- name: Compare requirements
run: |
# Extract and sort package names
awk -F'(=|==|>|>=|<|<=| @ )' '{gsub("-", "_", $1); print $1}' requirements.txt | tr '[:upper:]' '[:lower:]' | sort -u > requirements.compare
awk -F'(=|==|>|>=|<|<=| @ )' '{gsub("-", "_", $1); print $1}' pipreqs.txt | tr '[:upper:]' '[:lower:]' | sort -u > pipreqs.compare
# Compare package lists
missing_packages=$(comm -23 pipreqs.compare requirements.compare)
if [ -z "$missing_packages" ]; then
echo "All packages in pipreqs are listed in requirements"
exit 0
else
echo "Some packages in pipreqs are not listed in requirements"
echo ""
echo "=== Missing packages ==="
echo "$missing_packages"
exit 1
fi
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ipdb
pipreqs
ruff
selenium

0 comments on commit 75694e1

Please sign in to comment.