This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 214
/
setup.py
91 lines (76 loc) · 2.82 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
#! /usr/bin/env python
#
# Copyright (C) 2012 Mathieu Blondel
import re
import sys
import os
import setuptools
from distutils.command.sdist import sdist
from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
DISTNAME = 'sklearn-contrib-lightning'
DESCRIPTION = ("Large-scale sparse linear classification, "
"regression and ranking in Python")
with open('README.rst', encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
MAINTAINER = 'Mathieu Blondel'
MAINTAINER_EMAIL = '[email protected]'
URL = 'https://github.com/scikit-learn-contrib/lightning'
LICENSE = 'new BSD'
with open(os.path.join('lightning', '__init__.py'), encoding='utf-8') as f:
match = re.search(r'__version__[ ]*=[ ]*[\"\'](?P<version>.+)[\"\']',
f.read())
VERSION = match.group('version').strip()
MIN_PYTHON_VERSION = '3.7'
with open('requirements.txt', encoding='utf-8') as f:
REQUIREMENTS = [
line.strip()
for line in f.read().splitlines()
if line.strip()
]
def configuration(parent_package='', top_path=None):
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
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('lightning')
return config
if __name__ == "__main__":
old_path = os.getcwd()
local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
os.chdir(local_path)
sys.path.insert(0, local_path)
setup(configuration=configuration,
name=DISTNAME,
maintainer=MAINTAINER,
python_requires=f'>={MIN_PYTHON_VERSION}',
install_requires=REQUIREMENTS,
include_package_data=True,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
license=LICENSE,
url=URL,
version=VERSION,
download_url=URL,
long_description=LONG_DESCRIPTION,
zip_safe=False, # the package can run out of an .egg file
cmdclass={"sdist": sdist},
classifiers=[
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved',
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS'
]
)