1
1
#!/usr/bin/env python3
2
2
3
- # Template by pypi-mobans
3
+ """
4
+ Template by pypi-mobans
5
+ """
6
+
4
7
import os
5
8
import sys
6
9
import codecs
22
25
try :
23
26
lc = locale .getlocale ()
24
27
pf = platform .system ()
25
- if pf != ' Windows' and lc == (None , None ):
26
- locale .setlocale (locale .LC_ALL , ' C.UTF-8' )
28
+ if pf != " Windows" and lc == (None , None ):
29
+ locale .setlocale (locale .LC_ALL , " C.UTF-8" )
27
30
except (ValueError , UnicodeError , locale .Error ):
28
- locale .setlocale (locale .LC_ALL , ' en_US.UTF-8' )
31
+ locale .setlocale (locale .LC_ALL , " en_US.UTF-8" )
29
32
30
- NAME = ' gease'
31
- AUTHOR = ' C. W.'
32
- VERSION = ' 0.0.3'
33
-
34
- LICENSE = ' MIT'
33
+ NAME = " gease"
34
+ AUTHOR = " C. W."
35
+ VERSION = " 0.0.3"
36
+
37
+ LICENSE = " MIT"
35
38
ENTRY_POINTS = {
36
- ' console_scripts' : [
37
- ' gease = gease.main:main' ,
38
- ' fork = gease.fork:main' ,
39
+ " console_scripts" : [
40
+ " gease = gease.main:main" ,
41
+ " fork = gease.fork:main" ,
39
42
],
40
43
}
41
44
DESCRIPTION = (
42
- ' simply makes a git release using github api v3'
45
+ " simply makes a git release using github api v3"
43
46
)
44
- URL = ' https://github.com/moremoban/gease'
45
- DOWNLOAD_URL = ' %s/archive/0.0.3.tar.gz' % URL
46
- FILES = [' README.rst' , ' CHANGELOG.rst' ]
47
+ URL = " https://github.com/moremoban/gease"
48
+ DOWNLOAD_URL = " %s/archive/0.0.3.tar.gz" % URL
49
+ FILES = [" README.rst" , " CHANGELOG.rst" ]
47
50
KEYWORDS = [
48
- ' python' ,
51
+ " python" ,
49
52
]
50
53
51
54
CLASSIFIERS = [
52
- 'Topic :: Software Development :: Libraries' ,
53
- 'Programming Language :: Python' ,
54
- 'Intended Audience :: Developers' ,
55
- 'Programming Language :: Python :: 2.6' ,
56
- 'Programming Language :: Python :: 2.7' ,
57
- 'Programming Language :: Python :: 3.3' ,
58
- 'Programming Language :: Python :: 3.4' ,
59
- 'Programming Language :: Python :: 3.5' ,
60
- 'Programming Language :: Python :: 3.6' ,
55
+ "Topic :: Software Development :: Libraries" ,
56
+ "Programming Language :: Python" ,
57
+ "Intended Audience :: Developers" ,
58
+ "Programming Language :: Python :: 2.6" ,
59
+ "Programming Language :: Python :: 2.7" ,
60
+ "Programming Language :: Python :: 3.3" ,
61
+ "Programming Language :: Python :: 3.4" ,
62
+ "Programming Language :: Python :: 3.5" ,
63
+ "Programming Language :: Python :: 3.6" ,
64
+ "Programming Language :: Python :: 3.7" ,
65
+ "Programming Language :: Python :: 3.8" ,
66
+
61
67
]
62
68
69
+
63
70
INSTALL_REQUIRES = [
64
- ' crayons' ,
65
- ' requests' ,
71
+ " crayons" ,
72
+ " requests" ,
66
73
]
67
74
SETUP_COMMANDS = {}
68
75
69
-
70
- PACKAGES = find_packages (exclude = ['ez_setup' , 'examples' , 'tests' ])
76
+ PACKAGES = find_packages (exclude = ["ez_setup" , "examples" , "tests" , "tests.*" ])
71
77
EXTRAS_REQUIRE = {
72
78
}
73
79
# You do not need to read beyond this line
74
- PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi' .format (
75
- sys .executable )
76
- GS_COMMAND = ('gs gease v0.0.3 ' +
80
+ PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi" .format (sys .executable )
81
+ GS_COMMAND = ("gs gease v0.0.3 " +
77
82
"Find 0.0.3 in changelog for more details" )
78
- NO_GS_MESSAGE = (' Automatic github release is disabled. ' +
79
- ' Please install gease to enable it.' )
83
+ NO_GS_MESSAGE = (" Automatic github release is disabled. " +
84
+ " Please install gease to enable it." )
80
85
UPLOAD_FAILED_MSG = (
81
86
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND )
82
87
HERE = os .path .abspath (os .path .dirname (__file__ ))
85
90
class PublishCommand (Command ):
86
91
"""Support setup.py upload."""
87
92
88
- description = ' Build and publish the package on github and pypi'
93
+ description = " Build and publish the package on github and pypi"
89
94
user_options = []
90
95
91
96
@staticmethod
92
97
def status (s ):
93
98
"""Prints things in bold."""
94
- print (' \033 [1m{0}\033 [0m' .format (s ))
99
+ print (" \033 [1m{0}\033 [0m" .format (s ))
95
100
96
101
def initialize_options (self ):
97
102
pass
@@ -101,28 +106,28 @@ def finalize_options(self):
101
106
102
107
def run (self ):
103
108
try :
104
- self .status (' Removing previous builds...' )
105
- rmtree (os .path .join (HERE , ' dist' ))
106
- rmtree (os .path .join (HERE , ' build' ))
107
- rmtree (os .path .join (HERE , ' gease.egg-info' ))
109
+ self .status (" Removing previous builds..." )
110
+ rmtree (os .path .join (HERE , " dist" ))
111
+ rmtree (os .path .join (HERE , " build" ))
112
+ rmtree (os .path .join (HERE , " gease.egg-info" ))
108
113
except OSError :
109
114
pass
110
115
111
- self .status (' Building Source and Wheel (universal) distribution...' )
116
+ self .status (" Building Source and Wheel (universal) distribution..." )
112
117
run_status = True
113
118
if has_gease ():
114
119
run_status = os .system (GS_COMMAND ) == 0
115
120
else :
116
121
self .status (NO_GS_MESSAGE )
117
122
if run_status :
118
123
if os .system (PUBLISH_COMMAND ) != 0 :
119
- self .status (UPLOAD_FAILED_MSG % PUBLISH_COMMAND )
124
+ self .status (UPLOAD_FAILED_MSG )
120
125
121
126
sys .exit ()
122
127
123
128
124
129
SETUP_COMMANDS .update ({
125
- ' publish' : PublishCommand
130
+ " publish" : PublishCommand
126
131
})
127
132
128
133
@@ -151,7 +156,7 @@ def read_files(*files):
151
156
def read (afile ):
152
157
"""Read a file into setup"""
153
158
the_relative_file = os .path .join (HERE , afile )
154
- with codecs .open (the_relative_file , 'r' , ' utf-8' ) as opened_file :
159
+ with codecs .open (the_relative_file , "r" , " utf-8" ) as opened_file :
155
160
content = filter_out_test_code (opened_file )
156
161
content = "" .join (list (content ))
157
162
return content
@@ -160,11 +165,11 @@ def read(afile):
160
165
def filter_out_test_code (file_handle ):
161
166
found_test_code = False
162
167
for line in file_handle .readlines ():
163
- if line .startswith (' .. testcode:' ):
168
+ if line .startswith (" .. testcode:" ):
164
169
found_test_code = True
165
170
continue
166
171
if found_test_code is True :
167
- if line .startswith (' ' ):
172
+ if line .startswith (" " ):
168
173
continue
169
174
else :
170
175
empty_line = line .strip ()
@@ -174,14 +179,14 @@ def filter_out_test_code(file_handle):
174
179
found_test_code = False
175
180
yield line
176
181
else :
177
- for keyword in [' |version|' , ' |today|' ]:
182
+ for keyword in [" |version|" , " |today|" ]:
178
183
if keyword in line :
179
184
break
180
185
else :
181
186
yield line
182
187
183
188
184
- if __name__ == ' __main__' :
189
+ if __name__ == " __main__" :
185
190
setup (
186
191
test_suite = "tests" ,
187
192
name = NAME ,
@@ -195,7 +200,7 @@ def filter_out_test_code(file_handle):
195
200
license = LICENSE ,
196
201
keywords = KEYWORDS ,
197
202
extras_require = EXTRAS_REQUIRE ,
198
- tests_require = [' nose' ],
203
+ tests_require = [" nose" ],
199
204
install_requires = INSTALL_REQUIRES ,
200
205
packages = PACKAGES ,
201
206
include_package_data = True ,
0 commit comments