setup.py: block unsafe 'upload', say to use twine instead
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user