From 564564ec5ed9e4246558aa43cd364825e7176e7d Mon Sep 17 00:00:00 2001 From: Dalton Miner Date: Fri, 24 Jan 2020 21:15:25 -0500 Subject: [PATCH] Add dogshell/dogshellwrap entry points Currently, the 'dog' entrypoint conflicts with a binary of the same name from sheepdog, a package available in major linux distributions. In packaging, we've renamed the dog entrypoint from this package to dogshell to match the source module's name and to avoid conflicts. I think it makes sense to also add it as an entrypoint here for consistency. I've marked it as Pending Deprecation, so that in the future we can transition users to dogshell and retire the dog name. --- datadog/dogshell/__init__.py | 5 +++++ datadog/dogshell/wrap.py | 3 +++ setup.py | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/datadog/dogshell/__init__.py b/datadog/dogshell/__init__.py index 3fc1ac78b..f5bd955a5 100644 --- a/datadog/dogshell/__init__.py +++ b/datadog/dogshell/__init__.py @@ -3,6 +3,8 @@ # Copyright 2015-Present Datadog, Inc # stdlib import os +import warnings +import sys # 3p import argparse @@ -28,6 +30,9 @@ def main(): + if sys.argv[0].endswith("dog"): + warnings.warn("dog is pending deprecation. Please use dogshell instead.", PendingDeprecationWarning) + parser = argparse.ArgumentParser(description="Interact with the Datadog API", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--config', help="location of your dogrc file (default ~/.dogrc)", diff --git a/datadog/dogshell/wrap.py b/datadog/dogshell/wrap.py index f558e7f5d..fbacef618 100644 --- a/datadog/dogshell/wrap.py +++ b/datadog/dogshell/wrap.py @@ -28,6 +28,7 @@ import sys import threading import time +import warnings # datadog from datadog import initialize, api @@ -405,4 +406,6 @@ def main(): if __name__ == '__main__': + if sys.argv[0].endswith("dogwrap"): + warnings.warn("dogwrap is pending deprecation. Please use dogshellwrap instead.", PendingDeprecationWarning) main() diff --git a/setup.py b/setup.py index 737c4e5b7..92ae45026 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,14 @@ def get_readme_md_contents(): "Documentation": "https://datadogpy.readthedocs.io/en/latest/", "Source Code": "https://github.com/DataDog/datadogpy", }, - entry_points={"console_scripts": ["dog = datadog.dogshell:main", "dogwrap = datadog.dogshell.wrap:main"]}, + entry_points={ + "console_scripts": [ + "dog = datadog.dogshell:main", + "dogwrap = datadog.dogshell.wrap:main" + "dogshell = datadog.dogshell:main", + "dogshellwrap = datadog.dogshell.wrap:main" + ] + }, test_suite="tests", classifiers=[ "License :: OSI Approved :: BSD License",