From 38dc630086c43b9808f315ae6feeee452526828c Mon Sep 17 00:00:00 2001 From: kedhammar Date: Fri, 22 Dec 2023 14:05:51 +0100 Subject: [PATCH] Implement pipreqs in CI (squashed) --- .github/workflows/lint-code.yml | 36 +++++++++++++++++++++++++++++++++ requirements.txt | 26 +++++++++++++++--------- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index a4914135..2ef3ef13 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -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 diff --git a/requirements.txt b/requirements.txt index 2ba779c9..f4dfdcb5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file +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 \ No newline at end of file