1414# limitations under the License.
1515
1616from setuptools import setup
17- from setuptools .command .test import test as TestCommand
18- import os
19- import sys
17+ from os import path
2018
19+ __version__ = '5.2.0'
2120
22- if sys .argv [- 1 ] == 'publish' :
23- # test server
24- os .system ('python setup.py register -r pypitest' )
25- os .system ('python setup.py sdist upload -r pypitest' )
26-
27- # production server
28- os .system ('python setup.py register -r pypi' )
29- os .system ('python setup.py sdist upload -r pypi' )
30- sys .exit ()
31-
32- # Convert README.md to README.rst for pypi
33- try :
34- from pypandoc import convert_file
35-
36- def read_md (f ):
37- return convert_file (f , 'rst' )
38-
39- # read_md = lambda f: convert(f, 'rst')
40- except :
41- print ('warning: pypandoc module not found, '
42- 'could not convert Markdown to RST' )
43-
44- def read_md (f ):
45- return open (f , 'rb' ).read ().decode (encoding = 'utf-8' )
46- # read_md = lambda f: open(f, 'rb').read().decode(encoding='utf-8')
47-
48-
49- class PyTest (TestCommand ):
50- def finalize_options (self ):
51- TestCommand .finalize_options (self )
52- self .test_args = ['--strict' , '--verbose' , '--tb=long' , 'test' ]
53- self .test_suite = True
54-
55- def run_tests (self ):
56- import pytest
57- errcode = pytest .main (self .test_args )
58- sys .exit (errcode )
59-
21+ # read contents of README file
22+ this_directory = path .abspath (path .dirname (__file__ ))
23+ with open (path .join (this_directory , 'README.md' ), encoding = 'utf-8' ) as file :
24+ readme_file = file .read ()
6025
6126setup (name = 'ibm-watson' ,
27+ version = __version__ ,
6228 description = 'Client library to use the IBM Watson Services' ,
29+ packages = ['ibm_watson' ],
30+ install_requires = ['requests>=2.0, <3.0' , 'python_dateutil>=2.5.3' , 'websocket-client==1.1.0' , 'ibm_cloud_sdk_core>=3.3.6, == 3.*' ],
31+ tests_require = ['responses' , 'pytest' , 'python_dotenv' , 'pytest-rerunfailures' ],
6332 license = 'Apache 2.0' ,
64- install_requires = ['requests>=2.0, <3.0' , 'python_dateutil>=2.5.3' , 'websocket-client==0.48.0' , 'ibm_cloud_sdk_core>=3.3.6, == 3.*' ],
65- tests_require = ['responses' , 'pytest' , 'python_dotenv' , 'pytest-rerunfailures' , 'tox' ],
66- cmdclass = {'test' : PyTest },
6733 author = 'IBM Watson' ,
683469- long_description = read_md ('README.md' ),
35+ long_description = readme_file ,
36+ long_description_content_type = 'text/markdown' ,
7037 url = 'https://github.com/watson-developer-cloud/python-sdk' ,
71- packages = ['ibm_watson' ],
7238 include_package_data = True ,
7339 keywords = 'language, vision, question and answer' +
7440 ' tone_analyzer, natural language classifier,' +
@@ -81,7 +47,7 @@ def run_tests(self):
8147 'Programming Language :: Python' ,
8248 'Programming Language :: Python :: 2' ,
8349 'Programming Language :: Python :: 3' ,
84- 'Development Status :: 4 - Beta ' ,
50+ 'Development Status :: 5 - Production/Stable ' ,
8551 'Intended Audience :: Developers' ,
8652 'License :: OSI Approved :: Apache Software License' ,
8753 'Operating System :: OS Independent' ,
0 commit comments