Skip to content

Commit

Permalink
Refactor dependency installation in workflows to handle optional pack…
Browse files Browse the repository at this point in the history
…ages gracefully
  • Loading branch information
david-zwicker committed Feb 10, 2025
1 parent 1e917db commit d56f499
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ jobs:
uses: AnimMouse/setup-ffmpeg@v1

- name: Install dependencies
# install all requirements. Note that the full requirements are installed separately
# so the job does not fail if one of the packages cannot be installed. This allows
# testing the package for newer python version even when some of the optional
# packages are not yet available.
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements_full.txt
pip install -r requirements.txt
cat tests/requirements_full.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 -I % sh -c "pip install % || true"
pip install -r tests/requirements.txt
- name: Generate serial coverage report
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ jobs:
python-version: ${{ matrix.pyversion }}

- name: Install dependencies
# install all requirements
# install all requirements. Note that the full requirements are installed separately
# so the job does not fail if one of the packages cannot be installed. This allows
# testing the package for newer python version even when some of the optional
# packages are not yet available.
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
cat tests/requirements_full.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 -I % sh -c "pip install % || true"
pip install -r tests/requirements.txt
pip install -r tests/requirements_full.txt
pip install types-PyYAML
- name: Test types with mypy
Expand Down

0 comments on commit d56f499

Please sign in to comment.