forked from fossasia/visdom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
74 lines (62 loc) · 2.02 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
# Copyright 2017-present, The Visdom Authors
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
from io import open
from setuptools import setup, find_packages
from pkg_resources import get_distribution, DistributionNotFound
try:
import torch
if (torch.__version__ < "0.3.1"):
print(
"[visdom] WARNING: Visdom support for pytorch less than version "
"0.3.1 is unsupported. Visdom will still work for other purposes "
"though."
)
except Exception:
pass # User doesn't have torch
def get_dist(pkgname):
try:
return get_distribution(pkgname)
except DistributionNotFound:
return None
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'py/visdom/VERSION')) as version_file:
version = version_file.read().strip()
readme = open('README.md', 'rt', encoding='utf8').read()
requirements = [
'numpy>=1.8',
'scipy',
'requests',
'tornado',
'six',
'jsonpatch',
'websocket-client',
'networkx'
]
pillow_req = 'pillow-simd' if get_dist('pillow-simd') is not None else 'pillow'
requirements.append(pillow_req)
setup(
# Metadata
name='visdom',
version=version,
author='Jack Urbanek, Allan Jabri, Laurens van der Maaten',
author_email='jju@fb.com',
url='https://github.com/facebookresearch/visdom',
description='A tool for visualizing live, rich data for Torch and Numpy',
long_description_content_type="text/markdown",
long_description=readme,
license='Apache-2.0',
python_requires='>=3.8',
# Package info
packages=find_packages(where="py"),
package_dir={'': 'py'},
package_data={'visdom': ['static/*.*', 'static/**/*', 'py.typed', '*.pyi']},
include_package_data=True,