Update Python type annotations to modern syntax and types #127
Workflow file for this run
This file contains hidden or 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
| name: Reference resource generation tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - test/generate_reference_resources.py | |
| - .github/workflows/reference_resources.yaml # self reference | |
| schedule: | |
| - cron: '0 0 * * 0' # on sunday | |
| defaults: | |
| run: | |
| shell: bash -l -eo pipefail {0} | |
| jobs: | |
| generate-matrix: | |
| uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main | |
| with: | |
| package-type: wheel | |
| os: linux | |
| test-infra-repository: pytorch/test-infra | |
| test-infra-ref: main | |
| with-xpu: disable | |
| with-rocm: disable | |
| with-cuda: disable | |
| build-python-only: "disable" | |
| build: | |
| needs: generate-matrix | |
| strategy: | |
| fail-fast: false | |
| name: Build and Upload Linux wheel | |
| uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main | |
| with: | |
| repository: meta-pytorch/torchcodec | |
| ref: "" | |
| test-infra-repository: pytorch/test-infra | |
| test-infra-ref: main | |
| build-matrix: ${{ needs.generate-matrix.outputs.matrix }} | |
| pre-script: packaging/pre_build_script.sh | |
| post-script: packaging/post_build_script.sh | |
| smoke-test-script: packaging/fake_smoke_test.py | |
| package-name: torchcodec | |
| trigger-event: ${{ github.event_name }} | |
| build-platform: "python-build-package" | |
| build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 python -m build --wheel -vvv --no-isolation" | |
| test-reference-resource-generation: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10'] | |
| ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64 | |
| path: pytorch/torchcodec/dist/ | |
| - name: Setup conda env | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| auto-update-conda: true | |
| miniconda-version: "latest" | |
| activate-environment: test | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install ffmpeg | |
| run: | | |
| conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge | |
| ffmpeg -version | |
| - name: Update pip | |
| run: python -m pip install --upgrade pip | |
| - name: Install generation dependencies | |
| run: | | |
| # Note that we're installing stable - this is for running a script where we're a normal PyTorch | |
| # user, not for building TorhCodec. | |
| python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| python -m pip install numpy pillow pytest | |
| - name: Install torchcodec from the wheel | |
| run: | | |
| wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"` | |
| echo Installing $wheel_path | |
| python -m pip install $wheel_path -vvv | |
| - name: Check out repo | |
| uses: actions/checkout@v3 | |
| - name: Run generation reference resources | |
| run: | | |
| python -m test.generate_reference_resources |