Skip to content
Commits on Source (4)
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
venv/
venv2/
venv3/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
......@@ -38,10 +38,15 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
......@@ -49,6 +54,15 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
......@@ -56,5 +70,42 @@ docs/_build/
# PyBuilder
target/
# Intellij PyCharm
.idea/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
......@@ -7,9 +7,9 @@ cache:
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
......@@ -18,7 +18,7 @@ install:
- pip install -e .\[dev\]
script:
- py.test tests --cov click_plugins --cov-report term-missing
- pytest tests --cov click_plugins --cov-report term-missing
after_success:
- coveralls
Changelog
=========
1.0.4 - 2018-09-15
------------------
- Preemptive fix for a breaking change in Click v7. CLI command names generated from functions with underscores will have dashes instead of underscores. See https://github.com/click-contrib/click-plugins/issues/19.
1.0.3 - 2016-01-05
------------------
- Include tests in MANIFEST.in - See further discussion in #8
1.0.2 - 2015-09-23
------------------
......
New BSD License
Copyright (c) 2015, Kevin D. Wurster, Sean C. Gillies
Copyright (c) 2015-2018, Kevin D. Wurster, Sean C. Gillies
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
......@@ -4,3 +4,4 @@ include LICENSE.txt
include MANIFEST.in
include README.rst
include setup.py
recursive-include tests *.py
......@@ -30,7 +30,7 @@ sub-group, across multiple sub-groups, or some combination.
Enabling Plugins
----------------
For a more detailed example see the `examples <https://github.com/click-contrib/click-plugins/tree/master/examples>`_ section.
For a more detailed example see the `examples <https://github.com/click-contrib/click-plugins/tree/master/example>`_ section.
The only requirement is decorating ``click.group()`` with ``click_plugins.with_plugins()``
which handles attaching external commands and groups. In this case the core CLI developer
......@@ -97,7 +97,7 @@ Best Practices and Extra Credit
-------------------------------
Opening a CLI to plugins encourages other developers to independently extend
functionality independently but their is no guarantee these new features will
functionality independently but there is no guarantee these new features will
be "on brand". Plugin developers are almost certainly already using features
in the core package the CLI belongs to so defining commonly used arguments and
options in one place lets plugin developers reuse these flags to produce a more
......@@ -164,9 +164,8 @@ Developing
$ git clone https://github.com/click-contrib/click-plugins.git
$ cd click-plugins
$ virtualenv venv && source venv/bin/activate
$ pip install -e .[dev]
$ py.test tests --cov click_plugins --cov-report term-missing
$ pip install -e .\[dev\]
$ pytest tests --cov click_plugins --cov-report term-missing
Changelog
......
......@@ -24,14 +24,14 @@ entry-points.
from click_plugins.core import with_plugins
__version__ = '1.0.2'
__version__ = '1.0.4'
__author__ = 'Kevin Wurster, Sean Gillies'
__email__ = 'wursterk@gmail.com, sean.gillies@gmail.com'
__source__ = 'https://github.com/click-contrib/click-plugins'
__license__ = '''
New BSD License
Copyright (c) 2015, Kevin D. Wurster, Sean C. Gillies
Copyright (c) 2015-2018, Kevin D. Wurster, Sean C. Gillies
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
python-click-plugins (1.0.2-4) UNRELEASED; urgency=medium
python-click-plugins (1.0.4-1) unstable; urgency=medium
* Team upload.
* New upstream release.
(closes: #908684)
* Bump Standards-Version to 4.2.1, no changes.
-- Bas Couwenberg <sebastic@debian.org> Tue, 28 Aug 2018 15:23:03 +0200
-- Bas Couwenberg <sebastic@debian.org> Sun, 16 Sep 2018 08:13:58 +0200
python-click-plugins (1.0.2-3) unstable; urgency=medium
......
......@@ -51,7 +51,7 @@ setup(
"via setuptools entry-points.",
extras_require={
'dev': [
'pytest',
'pytest>=3',
'pytest-cov',
'wheel',
'coveralls'
......@@ -62,7 +62,7 @@ setup(
keywords='click plugin setuptools entry-point',
license="New BSD",
long_description=long_desc,
packages=find_packages(exclude=['tests']),
packages=find_packages(exclude=['tests.*', 'tests']),
url=source,
version=version,
zip_safe=True
......
......@@ -115,18 +115,18 @@ def test_group_chain(runner):
# Same as above but the sub-group has plugins
@with_plugins(plugins=iter_entry_points('_test_click_plugins.test_plugins'))
@good_cli.group()
@good_cli.group(name='sub-cli-plugins')
def sub_cli_plugins():
"""Sub CLI with plugins."""
pass
result = runner.invoke(good_cli, ['sub_cli_plugins'])
result = runner.invoke(good_cli, ['sub-cli-plugins'])
assert result.exit_code is 0
for ep in iter_entry_points('_test_click_plugins.test_plugins'):
assert ep.name in result.output
# Execute one of the sub-group's commands
result = runner.invoke(good_cli, ['sub_cli_plugins', 'cmd1', 'something'])
result = runner.invoke(good_cli, ['sub-cli-plugins', 'cmd1', 'something'])
assert result.exit_code is 0
assert result.output.strip() == 'passed'
......