Skip to content

Commit

Permalink
feat(cli): add plugins configuration through click-plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineDao committed Nov 10, 2019
1 parent 844fcf2 commit ad8e01d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sphinxcontrib-fulltoc==1.2.0
sphinxcontrib-websupport==1.1.0
twine==1.13.0
click>=7.0
click-plugins==1.1.1
5 changes: 4 additions & 1 deletion queenbee/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ def run():

try:
import click
from click_plugins import with_plugins
except ImportError:
raise ImportError(
'click module is not installed. Try `pip install queenbee[cli]` command.'
'click modules not installed. Try `pip install queenbee[cli]` command.'
)

import webbrowser
import urllib.parse
from pkg_resources import iter_entry_points
from queenbee.schema.workflow import Workflow

# TODO: Comment out and use for logging once we are adding commands to this file.
Expand All @@ -81,6 +83,7 @@ def parse_workflow(filepath):
raise click.ClickException(e)


@with_plugins(iter_entry_points('queenbee.plugins'))
@click.group()
@click.version_option()
@click.pass_context
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ladybug-tools/queenbee",
packages=setuptools.find_packages(exclude=["tests"]),
packages=setuptools.find_packages(exclude=["tests", "docs"]),
install_requires=requirements,
extra_requires={
'cli': ['click>=7.0']
'cli': ['click>=7.0', 'click_plugins==1.1.1']
},
entry_points={
"console_scripts": ["queenbee = queenbee.cli:main"]
Expand Down

0 comments on commit ad8e01d

Please sign in to comment.