|
6 | 6 | import sys
|
7 | 7 |
|
8 | 8 | from setuptools import find_packages, setup
|
| 9 | +from imblearn import __version__ |
9 | 10 |
|
10 | 11 |
|
11 |
| -def load_version(): |
12 |
| - """Executes imblearn/version.py in a globals dictionary and |
13 |
| - return it. |
14 |
| - """ |
15 |
| - # load all vars into globals, otherwise |
16 |
| - # the later function call using global vars doesn't work. |
17 |
| - globals_dict = {} |
18 |
| - with codecs.open(os.path.join('imblearn', 'version.py'), |
19 |
| - encoding='utf-8-sig') as fp: |
20 |
| - exec(fp.read(), globals_dict) |
21 |
| - |
22 |
| - return globals_dict |
23 |
| - |
24 |
| - |
25 |
| -def is_installing(): |
26 |
| - # Allow command-lines such as "python setup.py build install" |
27 |
| - install_commands = set(['install', 'develop']) |
28 |
| - return install_commands.intersection(set(sys.argv)) |
29 |
| - |
30 |
| - |
31 |
| -# Make sources available using relative paths from this file's directory. |
32 |
| -os.chdir(os.path.dirname(os.path.abspath(__file__))) |
33 |
| - |
34 |
| - |
35 |
| -_VERSION_GLOBALS = load_version() |
36 | 12 | DISTNAME = 'imbalanced-learn'
|
37 | 13 | DESCRIPTION = 'Toolbox for imbalanced dataset in machine learning.'
|
38 | 14 | with codecs.open('README.rst', encoding='utf-8-sig') as f:
|
39 | 15 | LONG_DESCRIPTION = f.read()
|
40 |
| -MAINTAINER = 'G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas' |
41 |
| - |
42 |
| - |
| 16 | +MAINTAINER = 'G. Lemaitre, C. Aridas' |
| 17 | + |
43 | 18 | URL = 'https://github.com/scikit-learn-contrib/imbalanced-learn'
|
44 | 19 | LICENSE = 'MIT'
|
45 | 20 | DOWNLOAD_URL = 'https://github.com/scikit-learn-contrib/imbalanced-learn'
|
46 |
| -VERSION = _VERSION_GLOBALS['__version__'] |
47 |
| - |
48 |
| - |
49 |
| -def configuration(parent_package='', top_path=None): |
50 |
| - if os.path.exists('MANIFEST'): |
51 |
| - os.remove('MANIFEST') |
52 |
| - |
53 |
| - from numpy.distutils.misc_util import Configuration |
54 |
| - config = Configuration(None, parent_package, top_path) |
55 |
| - |
56 |
| - config.add_subpackage('imblearn') |
57 |
| - |
58 |
| - return config |
59 |
| - |
60 |
| - |
61 |
| -if __name__ == "__main__": |
62 |
| - if is_installing(): |
63 |
| - module_check_fn = _VERSION_GLOBALS['_check_module_dependencies'] |
64 |
| - module_check_fn(is_imbalanced_dataset_installing=True) |
65 |
| - |
66 |
| - install_requires = \ |
67 |
| - ['%s>=%s' % (mod, meta['min_version']) |
68 |
| - for mod, meta in _VERSION_GLOBALS['REQUIRED_MODULE_METADATA'] |
69 |
| - if not meta['required_at_installation']] |
70 |
| - |
71 |
| - setup(configuration=configuration, |
72 |
| - name=DISTNAME, |
73 |
| - maintainer=MAINTAINER, |
74 |
| - maintainer_email=MAINTAINER_EMAIL, |
75 |
| - description=DESCRIPTION, |
76 |
| - license=LICENSE, |
77 |
| - url=URL, |
78 |
| - version=VERSION, |
79 |
| - download_url=DOWNLOAD_URL, |
80 |
| - long_description=LONG_DESCRIPTION, |
81 |
| - zip_safe=False, # the package can run out of an .egg file |
82 |
| - classifiers=[ |
83 |
| - 'Intended Audience :: Science/Research', |
84 |
| - 'Intended Audience :: Developers', |
85 |
| - 'License :: OSI Approved', |
86 |
| - 'Programming Language :: C', |
87 |
| - 'Programming Language :: Python', |
88 |
| - 'Topic :: Software Development', |
89 |
| - 'Topic :: Scientific/Engineering', |
90 |
| - 'Operating System :: Microsoft :: Windows', |
91 |
| - 'Operating System :: POSIX', |
92 |
| - 'Operating System :: Unix', |
93 |
| - 'Operating System :: MacOS', |
94 |
| - 'Programming Language :: Python :: 2.7', |
95 |
| - 'Programming Language :: Python :: 3.5', |
96 |
| - 'Programming Language :: Python :: 3.6' |
97 |
| - ], |
98 |
| - packages=find_packages(), |
99 |
| - install_requires=['scipy', |
100 |
| - 'numpy', |
101 |
| - 'scikit-learn']) |
| 21 | +VERSION = __version__ |
| 22 | +INSTALL_REQUIRES = ['numpy', 'scipy', 'scikit-learn'] |
| 23 | +CLASSIFIERS = ['Intended Audience :: Science/Research', |
| 24 | + 'Intended Audience :: Developers', |
| 25 | + 'License :: OSI Approved', |
| 26 | + 'Programming Language :: C', |
| 27 | + 'Programming Language :: Python', |
| 28 | + 'Topic :: Software Development', |
| 29 | + 'Topic :: Scientific/Engineering', |
| 30 | + 'Operating System :: Microsoft :: Windows', |
| 31 | + 'Operating System :: POSIX', |
| 32 | + 'Operating System :: Unix', |
| 33 | + 'Operating System :: MacOS', |
| 34 | + 'Programming Language :: Python :: 2.7', |
| 35 | + 'Programming Language :: Python :: 3.5', |
| 36 | + 'Programming Language :: Python :: 3.6'] |
| 37 | + |
| 38 | + |
| 39 | +setup(name=DISTNAME, |
| 40 | + maintainer=MAINTAINER, |
| 41 | + maintainer_email=MAINTAINER_EMAIL, |
| 42 | + description=DESCRIPTION, |
| 43 | + license=LICENSE, |
| 44 | + url=URL, |
| 45 | + version=VERSION, |
| 46 | + download_url=DOWNLOAD_URL, |
| 47 | + long_description=LONG_DESCRIPTION, |
| 48 | + zip_safe=False, # the package can run out of an .egg file |
| 49 | + classifiers=CLASSIFIERS, |
| 50 | + packages=find_packages(), |
| 51 | + install_requires=INSTALL_REQUIRES) |
0 commit comments