Skip to content

Commit

Permalink
added new entry point that doesnt use click for running with circus
Browse files Browse the repository at this point in the history
  • Loading branch information
ntelfer committed Oct 15, 2018
1 parent e0cbeeb commit dcfe22a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import re

v = sys.version_info
if v < (3, 6):
if v < (3, 5):
msg = "FAIL: Requires Python 3.6 or later, but setup.py was run using {}.{}.{}"
print(msg.format(v.major, v.minor, v.micro))
print("NOTE: Installation failed. Run setup.py using python3")
Expand Down Expand Up @@ -92,7 +92,7 @@ def _unavailable(self, e):

setup(
name='didery',
version="0.0.3",
version="0.1.0",
license='Apache2',
description='DIDery Key Management Server',
long_description="Redundant persistent backup of key rotation events and otp encrypted private keys.",
Expand Down Expand Up @@ -128,6 +128,7 @@ def _unavailable(self, e):
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Utilities',
],
Expand All @@ -149,7 +150,8 @@ def _unavailable(self, e):
] if Cython else [],
entry_points={
'console_scripts': [
'dideryd = didery.cli:main',
'didery = didery.cli:main',
'dideryd = didery.app:main',
]
},
cmdclass={'build_ext': optional_build_ext},
Expand Down
2 changes: 1 addition & 1 deletion src/didery/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3"
__version__ = "0.1.0"
1 change: 0 additions & 1 deletion src/didery/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def parseArgs(version=__version__):

def main():
args = parseArgs(version=__version__)
print(args)

projectDirpath = os.path.dirname(
os.path.dirname(
Expand Down
15 changes: 14 additions & 1 deletion src/didery/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ioflo.aid import odict
from ioflo.aid.consoling import VERBIAGE_NAMES

from didery import __version__
from didery.db.dbing import DATABASE_DIR_PATH


Expand All @@ -33,6 +34,14 @@
type=click.IntRange(1, 65535),
help='Port number the server should listen on. Default is 8080.'
)
@click.option(
'--version',
'-V',
multiple=False,
is_flag=True,
default=False,
help="Return version."
)
@click.option(
'--verbose',
'-v',
Expand All @@ -46,7 +55,11 @@
type=click.Path(file_okay=False, resolve_path=True, writable=True),
help='Path to the database folder. Defaults to {}.'.format(DATABASE_DIR_PATH)
)
def main(port, verbose, path):
def main(port, version, verbose, path):
if version:
click.echo(__version__)
return

projectDirpath = os.path.dirname(
os.path.dirname(
os.path.abspath(
Expand Down

0 comments on commit dcfe22a

Please sign in to comment.