Assert that module was generated correctly on setup.py pypi

This commit is contained in:
Lonami Exo 2017-11-29 12:34:15 +01:00
parent 605c103f29
commit 7509ba9067

View File

@ -71,6 +71,16 @@ def main():
print('Done.') print('Done.')
elif len(argv) >= 2 and argv[1] == 'pypi': elif len(argv) >= 2 and argv[1] == 'pypi':
# (Re)generate the code to make sure we don't push without it
gen_tl()
# Try importing the telethon module to assert it has no errors
try:
import telethon
except:
print('Packaging for PyPi aborted, importing the module failed.')
return
# Need python3.5 or higher, but Telethon is supposed to support 3.x # Need python3.5 or higher, but Telethon is supposed to support 3.x
# Place it here since noone should be running ./setup.py pypi anyway # Place it here since noone should be running ./setup.py pypi anyway
from subprocess import run from subprocess import run