setup.py update for click cli proper

This commit is contained in:
Xevion
2019-11-02 02:16:04 -05:00
parent 5865819aa0
commit 19a52c2a55
2 changed files with 13 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import sys
import os
import logging
import click
from package import app
log = logging.getLogger('main')
@@ -8,6 +9,12 @@ log = logging.getLogger('main')
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.path.join(
sys.path[0], 'package', 'key', 'photo_tagging_service.json')
if __name__ == "__main__":
@click.command()
def cli():
log.info('Executing package...')
sys.exit(app.run())
if __name__ == "__main__":
main()

View File

@@ -3,7 +3,7 @@ import os
import io
from setuptools import find_packages, setup
DEPENDENCIES = []
DEPENDENCIES = ['Click']
EXCLUDE_FROM_PACKAGES = []
CURDIR = sys.path[0]
@@ -23,7 +23,10 @@ setup(
include_package_data=True,
keywords=[],
scripts=[],
entry_points={"console_scripts": ["phototag=phototag.main:main"]},
entry_points='''
[console_scripts]
phototag=phototag.phototag:cli
''',
zip_safe=False,
install_requires=DEPENDENCIES,
python_requires=">=3.6",