package:
  name: torchvision
  version: "{{ environ.get('BUILD_VERSION') }}"

source:
 path: "{{ environ.get('SOURCE_ROOT_DIR') }}"

requirements:
  build:
    - {{ compiler('c') }} # [win]
    - libpng
    # NOTE: Pinned to fix issues with size_t on Windows
    - jpeg <=9b
    # NOTE: The only ffmpeg version that we build is actually 4.2
    - ffmpeg >=4.2  # [not win]

  host:
    - python
    - setuptools
    {{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }}
    {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }}
    {{ environ.get('CONDA_CPUONLY_FEATURE') }}

  run:
    - python
    - libpng
    - ffmpeg >=4.2  # [not win]
    # NOTE: Pinned to fix issues with size_t on Windows
    - jpeg <=9b
    - pillow >=5.3.0
    {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
    {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }}

build:
  string: py{{py}}_{{ environ['CU_VERSION'] }}
  script: python setup.py install --single-version-externally-managed --record=record.txt
  script_env:
    - CUDA_HOME
    - FORCE_CUDA
    - BUILD_VERSION
    - TORCH_CUDA_ARCH_LIST
  features:
    {{ environ.get('CONDA_CPUONLY_FEATURE') }}

test:
  imports:
    - torchvision
    - torchvision.datasets
    - torchvision.transforms
  source_files:
    - test
  requires:
    - pytest
    - scipy
    - av
    # NOTE: Pinned to fix issues with size_t on Windows
    - jpeg <=9b
    - ca-certificates


about:
  home: https://github.com/pytorch/vision
  license: BSD
  license_file: LICENSE
  summary: 'image and video datasets and models for torch deep learning'
