Skip to content

Commit

Permalink
Add dogshell/dogshellwrap entry points (#305)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dwminer authored and zippolyte committed Jan 28, 2020
1 parent e945fc0 commit 1550d32
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions datadog/dogshell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Copyright 2015-Present Datadog, Inc
# stdlib
import os
import warnings
import sys

# 3p
import argparse
Expand All @@ -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)",
Expand Down
3 changes: 3 additions & 0 deletions datadog/dogshell/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import sys
import threading
import time
import warnings

# datadog
from datadog import initialize, api
Expand Down Expand Up @@ -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()
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1550d32

Please sign in to comment.