18
18
19
19
20
20
BUILD_CMD = "python setup.py sdist bdist_wheel"
21
- PUBLISH_CMD = "twine check register upload dist/*"
22
- TEST_PUBLISH_CMD = 'python setup.py register -r test sdist bdist_wheel upload -r test'
21
+ CHECK_DIST_CMD = "twine check dist/*"
22
+ PUBLISH_CMD = "twine upload dist/*"
23
+ REGISTER_CMD = "twine register textblob-de"
24
+ TEST_PUBLISH_CMD = 'twine upload --repository-url https://test.pypi.org/legacy/ dist/*'
23
25
TEST_CMD = 'python run_tests.py'
24
26
25
27
@@ -55,6 +57,7 @@ def find_version(fname):
55
57
print ("twine required. Run `pip install twine`." )
56
58
sys .exit (1 )
57
59
build = subprocess .call (BUILD_CMD , shell = True )
60
+ check_dist = subprocess .call (CHECK_DIST_CMD , shell = True )
58
61
status = subprocess .call (PUBLISH_CMD , shell = True )
59
62
sys .exit (status )
60
63
@@ -64,8 +67,24 @@ def find_version(fname):
64
67
except ImportError :
65
68
print ("wheel required. Run `pip install wheel`." )
66
69
sys .exit (1 )
70
+ try :
71
+ __import__ ('twine' )
72
+ except ImportError :
73
+ print ("twine required. Run `pip install twine`." )
74
+ sys .exit (1 )
75
+ build = subprocess .call (BUILD_CMD , shell = True )
76
+ check_dist = subprocess .call (CHECK_DIST_CMD , shell = True )
67
77
status = subprocess .call (TEST_PUBLISH_CMD , shell = True )
68
78
sys .exit (status )
79
+
80
+ if 'register' in sys .argv :
81
+ try :
82
+ __import__ ('twine' )
83
+ except ImportError :
84
+ print ("twine required. Run `pip install twine`." )
85
+ sys .exit (1 )
86
+ status = subprocess .call (REGISTER_CMD , shell = True )
87
+ sys .exit (status )
69
88
70
89
if 'run_tests' in sys .argv :
71
90
try :
@@ -87,7 +106,7 @@ def read(fname):
87
106
name = 'textblob-de' ,
88
107
version = __version__ ,
89
108
description = 'German language support for TextBlob.' ,
90
- long_description = (
109
+ long_description = (' \n ' +
91
110
read ("README.rst" ) + '\n \n ' + read ("HISTORY.rst" )),
92
111
author = 'Markus Killer' ,
93
112
author_email = 'm.killer@langui.ch' ,
@@ -105,7 +124,7 @@ def read(fname):
105
124
"ext/_pattern/text/de/*.*" ,
106
125
]},
107
126
install_requires = requires ,
108
- license = '\n \n ' + read ( "LICENSE" ) + ' \n \n ' ,
127
+ license = 'MIT ' ,
109
128
zip_safe = False ,
110
129
keywords = [
111
130
'textblob' ,
0 commit comments