-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow lhotse installation without torchaudio for a limited set of fea…
…tures (#1231) * Allow lhotse installation without torchaudio with a limited set of features * Add a CI runner with torchaudio absent * Add a CI runner with torchaudio absent * Skip some tests when torchaudio is not present * Add most basic tests only for missing torchaudio case * Rollback changes to unit tests so far * Restore previous CI setup but add a new test runner for non-torchaudio tests * Fix the name of the missing torchaudio CI test * Enable in-memory audio write/read with libsndfile when torchaudio is not available * Remove a flaky redundant test case --------- Co-authored-by: Piotr Żelasko <[email protected]>
- Loading branch information
Showing
18 changed files
with
220 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: missing_torchaudio | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
missing_torchaudio: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- python-version: "3.11" | ||
torch-install-cmd: "pip install torch==2.0 --extra-index-url https://download.pytorch.org/whl/cpu" | ||
|
||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
cache-dependency-path: | | ||
docs/requirements.txt | ||
setup.py | ||
- name: Install apt dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libsndfile1-dev libsndfile1 ffmpeg sox | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel numpy | ||
# Force the installation of a CPU-only PyTorch | ||
${{ matrix.torch-install-cmd }} | ||
# the torchaudio env var does nothing when torchaudio is installed, but doesn't require it's presence when it's not | ||
LHOTSE_REQUIRE_TORCHAUDIO=0 pip install '.[tests]' | ||
- name: Run basic tests only for missing torchaudio case | ||
run: | | ||
pytest test/test_missing_torchaudio.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.