From fcc6daa582400a68d9cbc9e834c018a8c90650c4 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sun, 9 Jul 2023 17:31:37 +0100 Subject: [PATCH] setuptools: use entry_points. --- get_trust_anchor.py => get_trust_anchor/__main__.py | 2 +- setup.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) rename get_trust_anchor.py => get_trust_anchor/__main__.py (99%) diff --git a/get_trust_anchor.py b/get_trust_anchor/__main__.py similarity index 99% rename from get_trust_anchor.py rename to get_trust_anchor/__main__.py index 42bd041..369ce54 100644 --- a/get_trust_anchor.py +++ b/get_trust_anchor/__main__.py @@ -474,4 +474,4 @@ def main(): print("Could not delete {}: '{}'. Continuing".format(this_file, this_exception)) if __name__ == "__main__": - main() + sys.exit(main()) diff --git a/setup.py b/setup.py index 491c832..7900037 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,10 @@ 'Programming Language :: Python :: 3' ], url='https://github.com/iana-org/get_trust_anchor/', - scripts=[ - 'get_trust_anchor.py' - ] + packages=['get_trust_anchor'], + entry_points={ + 'console_scripts': [ + 'get-trust-anchor = get_trust_anchor.__main__:main' + ] + } )