diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 5dc7550d868..dfff261571f 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -16,7 +16,7 @@ jobs: tests: strategy: matrix: - python_version: ["3.8", "3.9", "3.10"] + python_version: ["3.8", "3.9", "3.10", "3.11"] fail-fast: false uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: @@ -24,6 +24,7 @@ jobs: repository: pytorch/vision script: | # Mark Build Directory Safe + set -euxo pipefail git config --global --add safe.directory /__w/vision/vision # Set up Environment Variables @@ -39,18 +40,34 @@ jobs: fi # Create Conda Env - conda create -yp ci_env python="${PYTHON_VERSION}" numpy libpng jpeg scipy + if [[ "${PYTHON_VERSION}" = "3.11" ]]; then + conda create -yp ci_env -c conda-forge python="${PYTHON_VERSION}" libpng jpeg + # conda install -c pytorch-nightly numpy + python3 -m pip install numpy + else + conda create -yp ci_env python="${PYTHON_VERSION}" numpy libpng jpeg + fi + conda activate /work/ci_env # Install PyTorch, Torchvision, and testing libraries - set -ex - conda install \ - --yes \ - -c "pytorch-${CHANNEL}" \ - -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ - "${CUDATOOLKIT}" + if [[ "${PYTHON_VERSION}" = "3.11" ]]; then + conda install \ + --yes \ + -c "pytorch-${CHANNEL}" \ + -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ + "${CUDATOOLKIT}" + else + python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu + fi + python3 setup.py develop - python3 -m pip install pytest pytest-mock 'av<10' + if [[ "${PYTHON_VERSION}" = "3.11" ]]; then + # Looks like the av libraries are not available for 3.11 + python3 -m pip install pytest pytest-mock + else + python3 -m pip install pytest pytest-mock 'av<10' + fi # Run Tests python3 -m torch.utils.collect_env