Skip to content

Commit b450445

Browse files
committedJan 31, 2019
Switch to declarative setup
1 parent ca2276c commit b450445

File tree

3 files changed

+94
-136
lines changed

3 files changed

+94
-136
lines changed
 

‎setup.cfg

+92
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,95 @@
1+
##########################
2+
# Setup.py Configuration #
3+
##########################
4+
# Configuring setup()
5+
[metadata]
6+
name = pykeen
7+
version = 0.0.19
8+
description = A package for training and evaluating knowledge graph embeddings
9+
long_description = file: README.rst
10+
11+
# Links
12+
url = https://github.com/SmartDataAnalytics/PyKEEN
13+
download_url = https://github.com/SmartDataAnalytics/PyKEEN/releases
14+
project_urls =
15+
Bug Tracker = https://github.com/SmartDataAnalytics/PyKEEN/issues
16+
Documentation = https://pykeen.readthedocs.io
17+
18+
# Author information
19+
author = Mehdi Ali
20+
author_email = mehdi.ali@cs.uni-bonn.de
21+
maintainer = Mehdi Ali
22+
maintainer_email = mehdi.ali@cs.uni-bonn.de
23+
24+
# License information
25+
license = MIT
26+
license_file = LICENSE
27+
28+
# Search tags
29+
classifiers =
30+
Development Status :: 4 - Beta
31+
Environment :: Console
32+
Intended Audience :: Science/Research
33+
License :: OSI Approved :: MIT License
34+
Operating System :: OS Independent
35+
Programming Language :: Python
36+
Programming Language :: Python :: 3.6
37+
Programming Language :: Python :: 3.7
38+
Programming Language :: Python :: 3 :: Only
39+
Topic :: Scientific/Engineering :: Artificial Intelligence
40+
Topic :: Scientific/Engineering :: Chemistry
41+
Topic :: Scientific/Engineering :: Bio-Informatics
42+
Topic :: Scientific/Engineering :: Mathematics
43+
Topic :: Scientific/Engineering :: Information Analysis
44+
keywords =
45+
Knowledge Graph Embeddings
46+
Machine Learning
47+
Data Mining
48+
Linked Data
49+
50+
[options]
51+
install_requires =
52+
dataclasses; python_version < "3.7"
53+
numpy
54+
scikit-learn==0.19.1; python_version == "3.6"
55+
scikit-learn; python_version == "3.7"
56+
scipy
57+
click
58+
click_default_group
59+
torch==0.4.0; python_version == "3.6"
60+
torch==0.4.1; python_version == "3.7"
61+
torchvision==0.2.1
62+
prompt_toolkit
63+
tqdm
64+
pandas
65+
66+
zip_safe = false
67+
python_requires = >=3.6
68+
packages = find:
69+
package_dir =
70+
= src
71+
72+
[options.packages.find]
73+
where = src
74+
75+
[options.extras_require]
76+
docs =
77+
sphinx
78+
sphinx-rtd-theme
79+
sphinx-click
80+
ndex =
81+
ndex2
82+
rdf =
83+
rdflib
84+
85+
[options.entry_points]
86+
console_scripts =
87+
pykeen = pykeen.cli:main
88+
pykeen-summarize = pykeen.cli.cli:summarize
89+
pykeen-predict = pykeen.cli.cli:predict
90+
pykeen.data.importer =
91+
ndex = pykeen.utilities.handlers:handle_ndex
92+
193
#############################
294
# bdist_wheel Configuration #
395
#############################

‎setup.py

+2-126
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,8 @@
11
# -*- coding: utf-8 -*-
22

3-
"""Setup.py for PyKEEN."""
4-
5-
import codecs
6-
import os
7-
import re
3+
"""Setup module."""
84

95
import setuptools
106

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-
1127
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()

‎src/pykeen/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,3 @@
1515

1616
from .constants import get_version # noqa: F401
1717
from .run import run # noqa: F401
18-
19-
__version__ = '0.0.19'
20-
21-
__title__ = 'pykeen'
22-
__description__ = "A package for training and evaluating knowledge graph embeddings"
23-
__url__ = 'https://github.com/SmartDataAnalytics/PyKEEN.git'
24-
__author__ = 'Mehdi Ali'
25-
__email__ = 'mehdi.ali@cs.uni-bonn.de'
26-
__license__ = 'MIT License'
27-
__copyright__ = 'Copyright (c) 2018 Mehdi Ali'

0 commit comments

Comments
 (0)
Please sign in to comment.