diff --git a/setup.py b/setup.py index 282776f3..eb5b7eda 100644 --- a/setup.py +++ b/setup.py @@ -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