forked from facebook/Ax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
101 lines (84 loc) · 2.57 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from setuptools import find_packages, setup
# TODO: read pinned Botorch version from a shared source
PINNED_BOTORCH_VERSION = "0.6.2"
if os.environ.get("ALLOW_BOTORCH_LATEST"):
# allows a more recent previously installed version of botorch to remain
# if there is no previously installed version, installs the latest release
botorch_req = f"botorch>={PINNED_BOTORCH_VERSION}"
else:
botorch_req = f"botorch=={PINNED_BOTORCH_VERSION}"
REQUIRES = [
botorch_req,
"jinja2", # also a Plotly dep
"pandas",
"scipy",
"scikit-learn",
"plotly",
"typeguard",
]
# pytest-cov requires pytest >= 3.6
DEV_REQUIRES = [
"beautifulsoup4",
"black",
"flake8",
"hypothesis",
"pytest>=4.6",
"pytest-cov",
"sphinx<4.0",
"sphinx-autodoc-typehints",
"torchvision>=0.5.0",
"nbconvert<=5.6.1",
"jupyter-client==6.1.12",
]
MYSQL_REQUIRES = ["SQLAlchemy>=1.1.13"]
NOTEBOOK_REQUIRES = ["jupyter"]
def local_version(version):
"""
Patch in a version that can be uploaded to test PyPI
"""
return ""
def setup_package() -> None:
"""Used for installing the Ax package."""
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="ax-platform",
description="Adaptive Experimentation",
author="Facebook, Inc.",
license="MIT",
url="https://github.com/facebook/Ax",
keywords=["Experimentation", "Optimization"],
classifiers=[
"Development Status :: 4 - Beta",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
],
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=">=3.7",
install_requires=REQUIRES,
packages=find_packages(),
package_data={
# include all js, css, and html files in the package
"": ["*.js", "*.css", "*.html"]
},
extras_require={
"dev": DEV_REQUIRES,
"mysql": MYSQL_REQUIRES,
"notebook": NOTEBOOK_REQUIRES,
},
use_scm_version={
"write_to": "ax/version.py",
"local_scheme": local_version,
},
setup_requires=["setuptools_scm"],
)
if __name__ == "__main__":
setup_package()