setup.py 1.19 KB
Newer Older
soumith's avatar
soumith committed
1
2
#!/usr/bin/env python
import os
Sasank Chilamkurthy's avatar
Sasank Chilamkurthy committed
3
4
import io
import re
soumith's avatar
soumith committed
5
6
7
8
9
import shutil
import sys
from setuptools import setup, find_packages


Sasank Chilamkurthy's avatar
Sasank Chilamkurthy committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def read(*names, **kwargs):
    with io.open(
        os.path.join(os.path.dirname(__file__), *names),
        encoding=kwargs.get("encoding", "utf8")
    ) as fp:
        return fp.read()

def find_version(*file_paths):
    version_file = read(*file_paths)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string.")

Thomas Grainger's avatar
Thomas Grainger committed
25
26
readme = open('README.rst').read()

Sasank Chilamkurthy's avatar
Sasank Chilamkurthy committed
27
VERSION = find_version('torchvision', '__init__.py')
soumith's avatar
soumith committed
28

29
30
requirements = [
    'numpy',
31
    'pillow >= 4.1.1',
32
33
34
35
    'six',
    'torch',
]

Thomas Grainger's avatar
Thomas Grainger committed
36
setup(
soumith's avatar
soumith committed
37
38
39
40
41
42
43
    # Metadata
    name='torchvision',
    version=VERSION,
    author='PyTorch Core Team',
    author_email='soumith@pytorch.org',
    url='https://github.com/pytorch/vision',
    description='image and video datasets and models for torch deep learning',
Thomas Grainger's avatar
Thomas Grainger committed
44
    long_description=readme,
soumith's avatar
soumith committed
45
46
47
    license='BSD',

    # Package info
soumith's avatar
soumith committed
48
    packages=find_packages(exclude=('test',)),
soumith's avatar
soumith committed
49
50

    zip_safe=True,
51
    install_requires=requirements,
soumith's avatar
soumith committed
52
)