-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
106 lines (89 loc) · 4.25 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
#! /usr/bin/env python
#
# Copyright (C) 2018 Paulius Šarka
# License: 3-clause BSD
#
# Based on scikit-learn
# Licence: 3-clause BSD
import os
import sys
import uplift
# Optional wheelhouse-uploader features
# To automate release of binary packages for scikit-learn we need a tool
# to download the packages generated by travis and appveyor workers (with
# version number matching the current release) and upload them all at once
# to PyPI at release time.
# The URL of the artifact repositories are configured in the setup.cfg file.
cmdclass = {}
WHEELHOUSE_UPLOADER_COMMANDS = set(['fetch_artifacts', 'upload_all'])
if WHEELHOUSE_UPLOADER_COMMANDS.intersection(sys.argv):
import wheelhouse_uploader.cmd
cmdclass.update(vars(wheelhouse_uploader.cmd))
def configuration(parent_package='', top_path=None):
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
from numpy.distutils.misc_util import Configuration
config = Configuration(None, parent_package, top_path)
# Avoid non-useful msg:
# "Ignoring attempt to set 'name' (from ... "
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
delegate_options_to_subpackages=True,
quiet=True)
config.add_subpackage('uplift')
return config
def setup_package():
metadata = dict(name='uplift',
maintainer='Paulius Šarka',
maintainer_email='[email protected]',
description='tree based uplift models',
license='3-clause BSD',
url='https://github.com/psarka/uplift',
version=uplift.__version__,
classifiers=['Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved',
'Programming Language :: C',
'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 :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'],
cmdclass=cmdclass,
zip_safe=False,
include_package_data=True,
install_requires=['numpy>=1.7',
'scipy>=0.9',
'cython',
'joblib'])
# These actions are required to succeed without numpy
if len(sys.argv) == 1 or (
len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
sys.argv[1] in ('--help-commands',
'egg_info',
'--version',
'clean'))):
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
else:
from numpy.distutils.core import setup
from Cython.Build import cythonize
metadata['configuration'] = configuration
metadata['ext_modules'] = cythonize(['uplift/tree/_criterion.pyx',
'uplift/tree/_splitter.pyx',
'uplift/tree/_tree.pyx',
'uplift/tree/_utils.pyx'])
setup(**metadata)
if __name__ == "__main__":
setup_package()