mirror of
https://gitee.com/openharmony/third_party_jinja2
synced 2025-02-17 14:08:08 +00:00
Add wheel support.
This commit is contained in:
parent
b7d13f2787
commit
685d2ad34e
@ -16,6 +16,10 @@ import re
|
||||
from datetime import datetime, date
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
try:
|
||||
import wheel
|
||||
except ImportError:
|
||||
wheel = None
|
||||
|
||||
_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)')
|
||||
|
||||
@ -88,7 +92,10 @@ def set_setup_version(version):
|
||||
|
||||
|
||||
def build_and_upload():
|
||||
Popen([sys.executable, 'setup.py', 'release', 'sdist', 'upload']).wait()
|
||||
cmd = [sys.executable, 'setup.py', 'release', 'sdist', 'upload']
|
||||
if wheel is not None:
|
||||
cmd.insert(4, 'bdist_wheel')
|
||||
Popen(cmd).wait()
|
||||
|
||||
|
||||
def fail(message, *args):
|
||||
@ -140,6 +147,10 @@ def main():
|
||||
if not git_is_clean():
|
||||
fail('You have uncommitted changes in git')
|
||||
|
||||
if wheel is None:
|
||||
print ('Warning: You need to install the wheel package '
|
||||
'to upload a wheel distribution.')
|
||||
|
||||
set_init_version(version)
|
||||
set_setup_version(version)
|
||||
make_git_commit('Bump version number to %s', version)
|
||||
|
Loading…
x
Reference in New Issue
Block a user