setup.py: block unsafe 'upload', say to use twine instead

This commit is contained in:
James R. Barlow
2015-08-09 14:16:30 -07:00
parent 16d24f1166
commit 11dd9f14c3
+7
View File
@@ -130,8 +130,10 @@ def check_external_program(
print('Found {program} {found_version}'.format(
program=program, found_version=found_version))
command = next((arg for arg in sys.argv[1:] if not arg.startswith('-')), '')
if command.startswith('install') or \
command in ['check', 'test', 'nosetests', 'easy_install', 'egg_info']:
check_external_program(
@@ -163,6 +165,11 @@ if command.startswith('install') or \
version_check_args=['--version']
)
if 'upload' in sys.argv[1:]:
print('Use twine to upload the package - setup.py upload is insecure')
sys.exit(1)
setup(
name='ocrmypdf',
version='3.0rc4', # also update: release notes, main.py