Create public shim around main and make that the entry point

This commit is contained in:
Erica Portnoy 2019-11-20 14:13:01 -08:00
parent 7f951071dc
commit 14e6401efc
3 changed files with 22 additions and 2 deletions

20
certbot/certbot/main.py Normal file
View file

@ -0,0 +1,20 @@
"""Certbot main public entry point."""
import logging.handlers
import sys
from certbot._internal import main as internal_main
logger = logging.getLogger(__name__)
def main(*args, **kwargs):
"""Shim around internal main function"""
return internal_main.main(*args, **kwargs)
if __name__ == "__main__":
err_string = main()
if err_string:
logger.warning("Exiting with message %s", err_string)
sys.exit(err_string) # pragma: no cover

View file

@ -163,7 +163,7 @@ setup(
entry_points={
'console_scripts': [
'certbot = certbot._internal.main:main',
'certbot = certbot.main:main',
],
'certbot.plugins': [
'manual = certbot._internal.plugins.manual:Authenticator',

View file

@ -147,7 +147,7 @@ files=run.bat
renew-down.ps1
[Command certbot]
entry_point=certbot._internal.main:main
entry_point=certbot.main:main
extra_preamble=pywin32_paths.py
'''.format(certbot_version=certbot_version,
installer_suffix='win_amd64' if PYTHON_BITNESS == 64 else 'win32',