|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 |
|
3 |
| -"""Setup.py for PyKEEN.""" |
4 |
| - |
5 |
| -import codecs |
6 |
| -import os |
7 |
| -import re |
| 3 | +"""Setup module.""" |
8 | 4 |
|
9 | 5 | import setuptools
|
10 | 6 |
|
11 |
| -MODULE = 'pykeen' |
12 |
| -PACKAGES = setuptools.find_packages(where='src') |
13 |
| -META_PATH = os.path.join('src', MODULE, '__init__.py') |
14 |
| -KEYWORDS = ['Knowledge Graph Embeddings', 'Machine Learning', 'Data Mining', 'Linked Data'] |
15 |
| -CLASSIFIERS = [ |
16 |
| - 'Development Status :: 4 - Beta', |
17 |
| - 'Environment :: Console', |
18 |
| - 'Intended Audience :: Science/Research', |
19 |
| - 'License :: OSI Approved :: MIT License', |
20 |
| - 'Operating System :: OS Independent', |
21 |
| - 'Programming Language :: Python', |
22 |
| - 'Programming Language :: Python :: 3.6', |
23 |
| - 'Programming Language :: Python :: 3.7', |
24 |
| - 'Programming Language :: Python :: 3 :: Only', |
25 |
| - 'Topic :: Scientific/Engineering :: Artificial Intelligence', |
26 |
| - 'Topic :: Scientific/Engineering :: Chemistry', |
27 |
| - 'Topic :: Scientific/Engineering :: Bio-Informatics', |
28 |
| - 'Topic :: Scientific/Engineering :: Mathematics', |
29 |
| - 'Topic :: Scientific/Engineering :: Information Analysis', |
30 |
| -] |
31 |
| -INSTALL_REQUIRES = [ |
32 |
| - 'dataclasses; python_version < "3.7"', |
33 |
| - 'numpy', |
34 |
| - 'scikit-learn==0.19.1; python_version == "3.6"', |
35 |
| - 'scikit-learn; python_version == "3.7"', |
36 |
| - 'scipy', |
37 |
| - 'click', |
38 |
| - 'click_default_group', |
39 |
| - 'torch==0.4.0; python_version == "3.6"', |
40 |
| - 'torch==0.4.1; python_version == "3.7"', |
41 |
| - 'torchvision==0.2.1', |
42 |
| - 'prompt_toolkit', |
43 |
| - 'tqdm', |
44 |
| - 'pandas', |
45 |
| -] |
46 |
| -EXTRAS_REQUIRE = { |
47 |
| - 'docs': [ |
48 |
| - 'sphinx', |
49 |
| - 'sphinx-rtd-theme', |
50 |
| - 'sphinx-click', |
51 |
| - ], |
52 |
| - "rtd": [ |
53 |
| - 'dataclasses; python_version < "3.7"', |
54 |
| - 'numpy', |
55 |
| - 'scikit-learn==0.19.1; python_version == "3.6"', |
56 |
| - 'scikit-learn; python_version == "3.7"', |
57 |
| - 'scipy', |
58 |
| - 'click', |
59 |
| - 'click_default_group', |
60 |
| - 'prompt_toolkit', |
61 |
| - 'tqdm', |
62 |
| - 'pandas', |
63 |
| - ], |
64 |
| - 'ndex': [ |
65 |
| - 'ndex2', |
66 |
| - ], |
67 |
| - 'rdf': [ |
68 |
| - 'rdflib', |
69 |
| - ] |
70 |
| -} |
71 |
| -ENTRY_POINTS = { |
72 |
| - 'console_scripts': [ |
73 |
| - 'pykeen = pykeen.cli:main', |
74 |
| - 'pykeen-summarize = pykeen.cli.cli:summarize', |
75 |
| - 'pykeen-predict = pykeen.cli.cli:predict', |
76 |
| - ], |
77 |
| - 'pykeen.data.importer': [ |
78 |
| - 'ndex = pykeen.utilities.handlers:handle_ndex', |
79 |
| - ] |
80 |
| -} |
81 |
| - |
82 |
| -HERE = os.path.abspath(os.path.dirname(__file__)) |
83 |
| - |
84 |
| - |
85 |
| -def read(*parts): |
86 |
| - """Build an absolute path from *parts* and return the contents of the resulting file. Assume UTF-8 encoding.""" |
87 |
| - with codecs.open(os.path.join(HERE, *parts), 'rb', 'utf-8') as f: |
88 |
| - return f.read() |
89 |
| - |
90 |
| - |
91 |
| -META_FILE = read(META_PATH) |
92 |
| - |
93 |
| - |
94 |
| -def find_meta(meta): |
95 |
| - """Extract __*meta*__ from META_FILE.""" |
96 |
| - meta_match = re.search( |
97 |
| - r'^__{meta}__ = ["\']([^"\']*)["\']'.format(meta=meta), |
98 |
| - META_FILE, re.M |
99 |
| - ) |
100 |
| - if meta_match: |
101 |
| - return meta_match.group(1) |
102 |
| - raise RuntimeError('Unable to find __{meta}__ string'.format(meta=meta)) |
103 |
| - |
104 |
| - |
105 |
| -def get_long_description(): |
106 |
| - """Get the long_description from the README.rst file. Assume UTF-8 encoding.""" |
107 |
| - with codecs.open(os.path.join(HERE, 'README.rst'), encoding='utf-8') as f: |
108 |
| - long_description = f.read() |
109 |
| - return long_description |
110 |
| - |
111 |
| - |
112 | 7 | if __name__ == '__main__':
|
113 |
| - setuptools.setup( |
114 |
| - name=find_meta('title'), |
115 |
| - version=find_meta('version'), |
116 |
| - description=find_meta('description'), |
117 |
| - long_description=get_long_description(), |
118 |
| - url=find_meta('url'), |
119 |
| - author=find_meta('author'), |
120 |
| - author_email=find_meta('email'), |
121 |
| - maintainer=find_meta('author'), |
122 |
| - maintainer_email=find_meta('email'), |
123 |
| - license=find_meta('license'), |
124 |
| - classifiers=CLASSIFIERS, |
125 |
| - keywords=KEYWORDS, |
126 |
| - packages=PACKAGES, |
127 |
| - package_dir={'': 'src'}, |
128 |
| - include_package_data=True, |
129 |
| - install_requires=INSTALL_REQUIRES, |
130 |
| - entry_points=ENTRY_POINTS, |
131 |
| - zip_safe=False, |
132 |
| - ) |
| 8 | + setuptools.setup() |
0 commit comments