forked from pbalapra/scikit-optimize
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
172 lines (134 loc) · 4.44 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import os
import sys
from shutil import rmtree
try:
from setuptools import Command, setup
except ImportError:
from distutils.core import setup
try:
import builtins
except ImportError:
# Python 2 compat: just to be able to declare that Python >=3.5 is needed.
import __builtin__ as builtins
# This is a bit (!) hackish: we are setting a global variable so that the
# main skopt __init__ can detect if it is being loaded by the setup
# routine
here = os.path.abspath(os.path.dirname(__file__))
builtins.__SKOPT_SETUP__ = True
import skopt
VERSION = skopt.__version__
CLASSIFIERS = [
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
]
class UploadCommand(Command):
"""Support setup.py upload."""
description = "Build and publish the package."
user_options = []
@staticmethod
def status(s):
"""Prints things in bold."""
print("\033[1m{0}\033[0m".format(s))
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
self.status("Removing previous builds…")
rmtree(os.path.join(here, "dist"))
except OSError:
pass
self.status("Building Source and Wheel (universal) distribution…")
os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))
self.status("Uploading the package to PyPI via Twine…")
os.system("twine upload dist/*")
# self.status('Pushing git tags…')
# os.system('git tag v{0}'.format(about['__version__']))
# os.system('git push --tags')
sys.exit()
class TestUploadCommand(Command):
"""Support setup.py testupload."""
description = "Build and publish the package."
user_options = []
@staticmethod
def status(s):
"""Prints things in bold."""
print("\033[1m{0}\033[0m".format(s))
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
self.status("Removing previous builds…")
rmtree(os.path.join(here, "dist"))
except OSError:
pass
self.status("Building Source and Wheel (universal) distribution…")
os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))
self.status("Uploading the package to PyPI via Twine…")
os.system("twine upload --repository-url https://test.pypi.org/legacy/ dist/*")
sys.exit()
class TestInstallCommand(Command):
"""Support setup.py testinstall"""
description = "Install deephyper from TestPyPI."
user_options = []
@staticmethod
def status(s):
"""Prints things in bold."""
print("\033[1m{0}\033[0m".format(s))
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.status("Downloading the package from Test PyPI and installing it")
os.system(
"pip install --index-url https://test.pypi.org/simple/ dh-scikit-optimize"
)
sys.exit()
setup(
name="dh-scikit-optimize",
version=VERSION,
description="A Modified version of scikit-optimize a Sequential model-based optimization toolbox for DeepHyper.",
long_description=open("README.rst").read(),
url="https://scikit-optimize.github.io/",
license="BSD 3-clause",
author="The scikit-optimize contributors",
classifiers=CLASSIFIERS,
packages=[
"skopt",
"skopt.learning",
"skopt.optimizer",
"skopt.space",
"skopt.learning.gaussian_process",
"skopt.sampler",
],
install_requires=[
"joblib>=0.11",
"pyaml>=16.9",
"numpy>=1.13.3",
"scipy>=0.19.1",
"scikit-learn>=0.20.0",
"pandas",
"ConfigSpace"
],
extras_require={"plots": ["matplotlib>=2.0.0"]},
cmdclass={
"upload": UploadCommand,
"testupload": TestUploadCommand,
"testinstall": TestInstallCommand,
},
)