forked from fossasia/visdom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
77 lines (64 loc) · 2.03 KB
/
Copy pathsetup.py
File metadata and controls
77 lines (64 loc) · 2.03 KB
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
75
76
77
#!/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 importlib import metadata
from io import open
from setuptools import setup, find_packages
try:
import torch
from packaging.version import parse
if parse(torch.__version__) < parse("2.0.0"):
print(
"[visdom] WARNING: PyTorch >= 2.0.0 is recommended for full "
"visdom support. Detected version: " + torch.__version__
)
except Exception:
pass # User doesn't have torch
def get_dist(pkgname):
try:
return metadata.distribution(pkgname)
except metadata.PackageNotFoundError:
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",
"jsonpatch",
"websocket-client",
"networkx",
"openTSNE",
]
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.12",
# 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"]
},
)