diff --git a/.github/workflows/build-m1-binaries.yml b/.github/workflows/build-m1-binaries.yml index 09fb74ee273..b03cefbf25d 100644 --- a/.github/workflows/build-m1-binaries.yml +++ b/.github/workflows/build-m1-binaries.yml @@ -24,11 +24,13 @@ jobs: PY_VERS: ${{ matrix.py_vers }} run: | . ~/miniconda3/etc/profile.d/conda.sh + # Needed for JPEG library detection as setup.py detects conda presence by running `shlex.which('conda')` + export PATH=~/miniconda3/bin:$PATH set -ex . packaging/pkg_helpers.bash setup_build_version WHL_NAME=torchvision-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl - conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng openjpeg wheel pkg-config + conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng "jpeg<=9b" wheel pkg-config conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/nightly conda run -p ${ENV_NAME} python3 -mpip install delocate conda run -p ${ENV_NAME} python3 setup.py bdist_wheel @@ -49,6 +51,7 @@ jobs: # Test torch is importable, by changing cwd and running import commands conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print('torchvision version is ', torchvision.__version__)" conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torch;import torchvision;print('Is torchvision useable?', all(x is not None for x in [torch.ops.image.decode_png, torch.ops.torchvision.roi_align]))" + conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print(torchvision.io.read_image('${PWD}/gallery/assets/dog1.jpg').shape)" conda env remove -p ${ENV_NAME} - name: Upload wheel to GitHub uses: actions/upload-artifact@v3