setup.py 1.2 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
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()

Sasank Chilamkurthy's avatar
Sasank Chilamkurthy committed
17

Sasank Chilamkurthy's avatar
Sasank Chilamkurthy committed
18
19
20
21
22
23
24
25
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.")

Sasank Chilamkurthy's avatar
Sasank Chilamkurthy committed
26

Thomas Grainger's avatar
Thomas Grainger committed
27
28
readme = open('README.rst').read()

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

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

Thomas Grainger's avatar
Thomas Grainger committed
38
setup(
soumith's avatar
soumith committed
39
40
41
42
43
44
45
    # 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
46
    long_description=readme,
soumith's avatar
soumith committed
47
48
49
    license='BSD',

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

    zip_safe=True,
53
    install_requires=requirements,
soumith's avatar
soumith committed
54
)