14
14
# limitations under the License.
15
15
16
16
from setuptools import setup
17
- from setuptools .command .test import test as TestCommand
18
- import os
19
- import sys
17
+ from os import path
20
18
19
+ __version__ = '5.2.0'
21
20
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 ()
60
25
61
26
setup (name = 'ibm-watson' ,
27
+ version = __version__ ,
62
28
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' ],
63
32
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 },
67
33
author = 'IBM Watson' ,
68
34
author_email = 'watdevex@us.ibm.com' ,
69
- long_description = read_md ('README.md' ),
35
+ long_description = readme_file ,
36
+ long_description_content_type = 'text/markdown' ,
70
37
url = 'https://github.com/watson-developer-cloud/python-sdk' ,
71
- packages = ['ibm_watson' ],
72
38
include_package_data = True ,
73
39
keywords = 'language, vision, question and answer' +
74
40
' tone_analyzer, natural language classifier,' +
@@ -81,7 +47,7 @@ def run_tests(self):
81
47
'Programming Language :: Python' ,
82
48
'Programming Language :: Python :: 2' ,
83
49
'Programming Language :: Python :: 3' ,
84
- 'Development Status :: 4 - Beta ' ,
50
+ 'Development Status :: 5 - Production/Stable ' ,
85
51
'Intended Audience :: Developers' ,
86
52
'License :: OSI Approved :: Apache Software License' ,
87
53
'Operating System :: OS Independent' ,
0 commit comments