Commit 5a0d079c authored by ngimel's avatar ngimel Committed by Soumith Chintala
Browse files

make vision depend on pillow-simd if already installed (#522)

* make vision depend on pillow-simd if already installed

* actually make pillow-simd optional
parent da67a1e9
......@@ -5,6 +5,7 @@ import re
import shutil
import sys
from setuptools import setup, find_packages
from pkg_resources import get_distribution, DistributionNotFound
def read(*names, **kwargs):
......@@ -15,6 +16,13 @@ def read(*names, **kwargs):
return fp.read()
def get_dist(pkgname):
try:
return get_distribution(pkgname)
except DistributionNotFound:
return None
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
......@@ -30,12 +38,15 @@ VERSION = find_version('torchvision', '__init__.py')
requirements = [
'numpy',
'pillow >= 4.1.1',
'six',
'torch',
'tqdm'
]
pillow_ver = ' >= 4.1.1'
pillow_req = 'pillow-simd' if get_dist('pillow-simd') is not None else 'pillow'
requirements.append(pillow_req + pillow_ver)
setup(
# Metadata
name='torchvision',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment