16
16
17
17
from setuptools import setup
18
18
19
- # Get various parameters for this version, stored in ISLP/info.py
20
-
21
- class Bunch (object ):
22
- def __init__ (self , vars ):
23
- for key , name in vars .items ():
24
- if key .startswith ('__' ):
25
- continue
26
- self .__dict__ [key ] = name
27
-
28
- def read_vars_from (ver_file ):
29
- """ Read variables from Python text file
30
-
31
- Parameters
32
- ----------
33
- ver_file : str
34
- Filename of file to read
35
-
36
- Returns
37
- -------
38
- info_vars : Bunch instance
39
- Bunch object where variables read from `ver_file` appear as
40
- attributes
41
- """
42
- # Use exec for compabibility with Python 3
43
- ns = {}
44
- with open (ver_file , 'rt' ) as fobj :
45
- exec (fobj .read (), ns )
46
- return Bunch (ns )
47
-
48
- info = read_vars_from (pjoin ('ISLP' , 'info.py' ))
49
-
50
- # Try to preempt setuptools monkeypatching of Extension handling when Pyrex
51
- # is missing. Otherwise the monkeypatched Extension will change .pyx
52
- # filenames to .c filenames, and we probably don't have the .c files.
53
- sys .path .insert (0 , pjoin (dirname (__file__ ), 'fake_pyrex' ))
54
- # Set setuptools extra arguments
55
- extra_setuptools_args = dict (
56
- tests_require = ['nose' ],
57
- test_suite = 'nose.collector' ,
58
- zip_safe = False ,
59
- extras_require = dict (
60
- doc = ['Sphinx>=1.0' ],
61
- test = ['nose>=0.10.1' ]))
62
19
63
20
# Define extensions
64
21
EXTS = []
65
22
66
- cmdclass = versioneer .get_cmdclass ()
23
+ cmdclass = versioneer .get_cmdclass ()
67
24
68
25
# get long_description
69
26
70
27
long_description = open ('README.md' , 'rt' , encoding = 'utf-8' ).read ()
71
28
72
29
def main (** extra_args ):
73
- setup (name = info .NAME ,
74
- maintainer = info .MAINTAINER ,
75
- maintainer_email = info .MAINTAINER_EMAIL ,
76
- description = info .DESCRIPTION ,
77
- url = info .URL ,
78
- download_url = info .DOWNLOAD_URL ,
79
- license = info .LICENSE ,
80
- classifiers = info .CLASSIFIERS ,
81
- author = info .AUTHOR ,
82
- author_email = info .AUTHOR_EMAIL ,
83
- platforms = info .PLATFORMS ,
84
- version = versioneer .get_version (),
85
- requires = info .REQUIRES ,
86
- provides = info .PROVIDES ,
30
+ setup (version = versioneer .get_version (),
87
31
packages = ['ISLP' ,
88
32
'ISLP.models' ,
89
33
'ISLP.models' ,
@@ -104,4 +48,4 @@ def main(**extra_args):
104
48
#simple way to test what setup will do
105
49
#python setup.py install --prefix=/tmp
106
50
if __name__ == "__main__" :
107
- main (** extra_setuptools_args )
51
+ main ()
0 commit comments