File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,14 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
77`Anaconda.org <https://anaconda.org/conda-forge/pytask >`_.
88
99
10- 0.0.15 - 2021-xx-xx
10+ 0.0.16 - 2021-xx-xx
11+ -------------------
12+
13+ - :gh: `111 ` fixes error when using ``pytask --version `` with click v8.
14+
15+
16+
17+ 0.0.15 - 2021-06-24
1118-------------------
1219
1320- :gh: `80 ` replaces some remaining formatting using ``pprint `` with ``rich ``.
Original file line number Diff line number Diff line change 55from _pytask .config import hookimpl
66from _pytask .pluginmanager import get_plugin_manager
77from click_default_group import DefaultGroup
8+ from pkg_resources import packaging
89
910
10- CONTEXT_SETTINGS = {"help_option_names" : ["-h" , "--help" ]}
11+ _CONTEXT_SETTINGS = {"help_option_names" : ["-h" , "--help" ]}
12+
13+ if packaging .version .parse (click .__version__ ) < packaging .version .parse ("8" ):
14+ _VERSION_OPTION_KWARGS = {}
15+ else :
16+ _VERSION_OPTION_KWARGS = {"package_name" : "pytask" }
1117
1218
1319def _extend_command_line_interface (command_line_interface ):
@@ -78,11 +84,11 @@ def pytask_add_hooks(pm):
7884
7985@click .group (
8086 cls = DefaultGroup ,
81- context_settings = CONTEXT_SETTINGS ,
87+ context_settings = _CONTEXT_SETTINGS ,
8288 default = "build" ,
8389 default_if_no_args = True ,
8490)
85- @click .version_option ()
91+ @click .version_option (** _VERSION_OPTION_KWARGS )
8692def cli ():
8793 """The command line interface of pytask."""
8894 pass
Original file line number Diff line number Diff line change 1+ import subprocess
2+
3+ from pytask import __version__
4+
5+
6+ def test_version_option ():
7+ process = subprocess .run (["pytask" , "--version" ], capture_output = True )
8+ assert "pytask, version " + __version__ in process .stdout .decode ("utf-8" )
You can’t perform that action at this time.
0 commit comments