Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
New upstream version 1.1
· f4c191d2
Bas Couwenberg
authored
Apr 05, 2019
f4c191d2
New upstream version 1.1.1
· 8cb81743
Bas Couwenberg
authored
Apr 05, 2019
8cb81743
Show whitespace changes
Inline
Side-by-side
.travis.yml
View file @
8cb81743
language
:
python
sudo
:
false
cache
:
directories
:
-
~/.cache/pip
dist
:
xenial
language
:
python
cache
:
pip
python
:
-
2.7
-
3.4
-
3.5
-
3.6
-
pypy
-
pypy3
-
3.7
env
:
matrix
:
-
CLICK_VERSION=4.1
-
CLICK_VERSION=5.1
-
CLICK_VERSION=6.7
-
CLICK_VERSION=7
install
:
-
pip install coveralls
-
pip install -e .\[dev\]
-
pip install -e ".[dev]"
-
pip install "click==${CLICK_VERSION}"
script
:
-
pytest tests --cov click_plugins --cov-report term-missing
...
...
CHANGES.md
View file @
8cb81743
Changelog
=========
1.
1.1 - 2019-04-04
------------------
-
Fixed a version mismatch in
`click_plugins/__init__.py`
See
`1.1`
.
1.
1 - 2019-04-04
----------------
-
Fix an issue where a broken command's traceback would not be emitted - https://github.com/click-contrib/click-plugins/issues/25
-
Bump required click version to
`click>=4`
- https://github.com/click-contrib/click-plugins/pull/28
-
Runs Travis tests for the latest release of click versions 4 -> 7 - https://github.com/click-contrib/click-plugins/pull/28
1.
0.4 - 2018-09-15
------------------
...
...
LICENSE.txt
View file @
8cb81743
New BSD License
Copyright (c) 2015-201
8
, Kevin D. Wurster, Sean C. Gillies
Copyright (c) 2015-201
9
, Kevin D. Wurster, Sean C. Gillies
All rights reserved.
Redistribution and use in source and binary forms, with or without
...
...
click_plugins/__init__.py
View file @
8cb81743
...
...
@@ -24,14 +24,14 @@ entry-points.
from
click_plugins.core
import
with_plugins
__version__
=
'
1.
0.4
'
__version__
=
'
1.
1.1
'
__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-201
8
, Kevin D. Wurster, Sean C. Gillies
Copyright (c) 2015-201
9
, Kevin D. Wurster, Sean C. Gillies
All rights reserved.
Redistribution and use in source and binary forms, with or without
...
...
click_plugins/core.py
View file @
8cb81743
...
...
@@ -87,3 +87,6 @@ class BrokenCommand(click.Command):
click
.
echo
(
self
.
help
,
color
=
ctx
.
color
)
ctx
.
exit
(
1
)
def
parse_args
(
self
,
ctx
,
args
):
return
args
setup.py
View file @
8cb81743
...
...
@@ -51,14 +51,14 @@ setup(
"
via setuptools entry-points.
"
,
extras_require
=
{
'
dev
'
:
[
'
pytest>=3
'
,
'
pytest>=3
.6
'
,
'
pytest-cov
'
,
'
wheel
'
,
'
coveralls
'
],
},
include_package_data
=
True
,
install_requires
=
[
'
click>=
3
.0
'
],
install_requires
=
[
'
click>=
4
.0
'
],
keywords
=
'
click plugin setuptools entry-point
'
,
license
=
"
New BSD
"
,
long_description
=
long_desc
,
...
...
tests/test_plugins.py
View file @
8cb81743
...
...
@@ -78,23 +78,23 @@ def test_registered():
def
test_register_and_run
(
runner
):
result
=
runner
.
invoke
(
good_cli
)
assert
result
.
exit_code
is
0
assert
result
.
exit_code
==
0
for
ep
in
iter_entry_points
(
'
_test_click_plugins.test_plugins
'
):
cmd_result
=
runner
.
invoke
(
good_cli
,
[
ep
.
name
,
'
something
'
])
assert
cmd_result
.
exit_code
is
0
assert
cmd_result
.
exit_code
==
0
assert
cmd_result
.
output
.
strip
()
==
'
passed
'
def
test_broken_register_and_run
(
runner
):
result
=
runner
.
invoke
(
broken_cli
)
assert
result
.
exit_code
is
0
assert
result
.
exit_code
==
0
assert
u
'
\U0001F4A9
'
in
result
.
output
or
u
'
\u2020
'
in
result
.
output
for
ep
in
iter_entry_points
(
'
_test_click_plugins.broken_plugins
'
):
cmd_result
=
runner
.
invoke
(
broken_cli
,
[
ep
.
name
])
assert
cmd_result
.
exit_code
is
not
0
assert
cmd_result
.
exit_code
!=
0
assert
'
Traceback
'
in
cmd_result
.
output
...
...
@@ -108,7 +108,7 @@ def test_group_chain(runner):
pass
result
=
runner
.
invoke
(
good_cli
)
assert
result
.
exit_code
is
0
assert
result
.
exit_code
==
0
assert
sub_cli
.
name
in
result
.
output
for
ep
in
iter_entry_points
(
'
_test_click_plugins.test_plugins
'
):
assert
ep
.
name
in
result
.
output
...
...
@@ -121,13 +121,13 @@ def test_group_chain(runner):
pass
result
=
runner
.
invoke
(
good_cli
,
[
'
sub-cli-plugins
'
])
assert
result
.
exit_code
is
0
assert
result
.
exit_code
==
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
'
])
assert
result
.
exit_code
is
0
assert
result
.
exit_code
==
0
assert
result
.
output
.
strip
()
==
'
passed
'
...
...
@@ -138,3 +138,25 @@ def test_exception():
@click.command
()
def
cli
():
"""
Whatever
"""
def
test_broken_register_and_run_with_help
(
runner
):
result
=
runner
.
invoke
(
broken_cli
)
assert
result
.
exit_code
==
0
assert
u
'
\U0001F4A9
'
in
result
.
output
or
u
'
\u2020
'
in
result
.
output
for
ep
in
iter_entry_points
(
'
_test_click_plugins.broken_plugins
'
):
cmd_result
=
runner
.
invoke
(
broken_cli
,
[
ep
.
name
,
"
--help
"
])
assert
cmd_result
.
exit_code
!=
0
assert
'
Traceback
'
in
cmd_result
.
output
def
test_broken_register_and_run_with_args
(
runner
):
result
=
runner
.
invoke
(
broken_cli
)
assert
result
.
exit_code
==
0
assert
u
'
\U0001F4A9
'
in
result
.
output
or
u
'
\u2020
'
in
result
.
output
for
ep
in
iter_entry_points
(
'
_test_click_plugins.broken_plugins
'
):
cmd_result
=
runner
.
invoke
(
broken_cli
,
[
ep
.
name
,
"
-a
"
,
"
b
"
])
assert
cmd_result
.
exit_code
!=
0
assert
'
Traceback
'
in
cmd_result
.
output