-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (51 loc) · 1.69 KB
/
Copy pathsetup.py
File metadata and controls
57 lines (51 loc) · 1.69 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
import re
from pathlib import Path
from setuptools import find_packages, setup
# get version from himalaya/__init__.py
__version__ = 0.0
with open("himalaya/__init__.py") as f:
infos = f.readlines()
for line in infos:
if "__version__" in line:
match = re.search(r"__version__ = ['\"]([^'\"]*)['\"]", line)
__version__ = match.groups()[0]
# read the contents of the README file
this_directory = Path(__file__).parent
long_description = (this_directory / "README.rst").read_text()
requirements = [
"numpy",
"scikit-learn",
# "cupy", # optional backend
# "torch", # optional backend, 1.9+ preferred
# "matplotlib", # for visualization only
# "pytest", # for testing only
]
extras_require = {
"all_backends": ["cupy", "torch"],
"viz": ["matplotlib"],
"test": ["pytest", "matplotlib", "cupy", "torch"],
"github": ["pytest", "matplotlib", "torch", "pytest-rerunfailures"],
}
extras_require["all"] = sum(list(extras_require.values()), [])
extras_require["doc"] = [
"numpydoc",
"sphinx",
"sphinx_gallery",
"sphinxcontrib-mermaid",
]
extras_require["doc"] += extras_require["viz"] + extras_require["all_backends"]
if __name__ == "__main__":
setup(
name="himalaya",
maintainer="Tom Dupre la Tour",
maintainer_email="tomdlt@berkeley.edu",
description="Multiple-target machine learning",
license="BSD (3-clause)",
version=__version__,
packages=find_packages(),
url="https://github.com/gallantlab/himalaya",
install_requires=requirements,
extras_require=extras_require,
long_description=long_description,
long_description_content_type="text/x-rst",
)