forked from fossasia/visdom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
73 lines (61 loc) · 1.99 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
#!/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='[email protected]',
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',
# Package info
packages=find_packages(where="py"),
package_dir={'': 'py'},
package_data={'visdom': ['static/*.*', 'static/**/*', 'py.typed', '*.pyi']},
include_package_data=True,
zip_safe=False,
install_requires=requirements,
entry_points={'console_scripts': ['visdom=visdom.server.run_server:download_scripts_and_run']}
)