1+ """
2+ Setup script.
3+ """
4+ import os
5+ import io
6+ import sys
7+ import codecs
8+ import pathlib
9+
110from __future__ import print_function
211from setuptools import setup , find_packages
312from setuptools .command .test import test as TestCommand
4- import io
5- import codecs
6- import os
7- import sys
813
9- here = os .path .abspath (os .path .dirname (__file__ ))
1014
15+ class PyTest (TestCommand ):
16+ def finalize_options (self ):
17+ TestCommand .finalize_options (self )
18+ self .test_args = []
19+ self .test_suite = True
20+
21+ def run_tests (self ):
22+ import pytest
23+ errcode = pytest .main (self .test_args )
24+ sys .exit (errcode )
1125
1226def read (* filenames , ** kwargs ):
27+ here = os .path .abspath (os .path .dirname (__file__ ))
1328 encoding = kwargs .get ('encoding' , 'utf-8' )
1429 sep = kwargs .get ('sep' , '\n ' )
1530 buf = []
1631 for filename in filenames :
17- with io .open (filename , encoding = encoding ) as f :
32+ with io .open (os . path . join ( here , filename )) , encoding = encoding ) as f :
1833 buf .append (f .read ())
1934 return sep .join (buf )
2035
21- long_description = read ('README.md' )
22- # long_description = ''
36+ def get_version (rel_path ):
37+ for line in read (rel_path ).splitlines ():
38+ if line .startswith ("__version__" ):
39+ delim = '"' if '"' in line else "'"
40+ return line .split (delim )[1 ]
41+ raise RuntimeError ('Unable to find version string.' )
2342
2443
25- class PyTest (TestCommand ):
26- def finalize_options (self ):
27- TestCommand .finalize_options (self )
28- self .test_args = []
29- self .test_suite = True
30-
31- def run_tests (self ):
32- import pytest
33- errcode = pytest .main (self .test_args )
34- sys .exit (errcode )
44+ # HERE = os.path.abspath(os.path.dirname(__file__))
45+ HERE = pathlib .Path (__file__ ).parent
46+ README = (HERE / 'README.md' ).read_text ()
47+ VERSION = get_version ('scikitplot/__init__.py' )
3548
3649setup (
3750 name = 'scikit-plot' ,
38- version = '0.3.7' ,
51+ description = 'An intuitive library to add plotting functionality to scikit-learn objects.' ,
52+ long_description_content_type = "text/markdown" ,
53+ long_description = README ,
54+ version = VERSION ,
3955 url = 'https://github.com/reiinakano/scikit-plot' ,
40- license = 'MIT License' ,
4156 author = 'Reiichiro Nakano' ,
42- tests_require = ['pytest' ],
57+ author_email = 'reiichiro.s.nakano@gmail.com' ,
58+ license = 'MIT License' ,
4359 install_requires = [
4460 'matplotlib>=1.4.0' ,
4561 'scikit-learn>=0.18' ,
4662 'scipy>=0.9' ,
4763 'joblib>=0.10'
4864 ],
49- cmdclass = {'test' : PyTest },
50- author_email = 'reiichiro.s.nakano@gmail.com' ,
51- description = 'An intuitive library to add plotting functionality to scikit-learn objects.' ,
52- long_description = long_description ,
53- packages = ['scikitplot' ],
54- include_package_data = True ,
55- platforms = 'any' ,
56- test_suite = 'scikitplot.tests.test_scikitplot' ,
65+ # Supported Python versions
66+ # python_requires=">=2.7",
5767 classifiers = [
5868 'Programming Language :: Python' ,
5969 'Programming Language :: Python :: 2' ,
6070 'Programming Language :: Python :: 2.7' ,
6171 'Programming Language :: Python :: 3' ,
6272 'Programming Language :: Python :: 3.5' ,
6373 'Programming Language :: Python :: 3.6' ,
64- 'Natural Language :: English' ,
65- 'Intended Audience :: Developers' ,
66- 'Intended Audience :: Science/Research' ,
67- 'License :: OSI Approved :: MIT License' ,
6874 'Operating System :: OS Independent' ,
75+ 'Intended Audience :: Science/Research' ,
76+ 'Intended Audience :: Developers' ,
6977 'Topic :: Scientific/Engineering :: Visualization' ,
78+ 'License :: OSI Approved :: MIT License' ,
79+ 'Natural Language :: English' ,
7080 ],
81+ packages = ['scikitplot' ],
82+ include_package_data = True ,
83+ platforms = 'any' ,
84+ tests_require = ['pytest' ],
85+ test_suite = 'scikitplot.tests.test_scikitplot' ,
86+ cmdclass = {'test' : PyTest },
7187 extras_require = {
7288 'testing' : ['pytest' ],
7389 }
74- )
90+ )
0 commit comments