File tree 3 files changed +25
-4
lines changed
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
7
7
`Anaconda.org <https://anaconda.org/conda-forge/pytask >`_.
8
8
9
9
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
11
18
-------------------
12
19
13
20
- :gh: `80 ` replaces some remaining formatting using ``pprint `` with ``rich ``.
Original file line number Diff line number Diff line change 5
5
from _pytask .config import hookimpl
6
6
from _pytask .pluginmanager import get_plugin_manager
7
7
from click_default_group import DefaultGroup
8
+ from pkg_resources import packaging
8
9
9
10
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" }
11
17
12
18
13
19
def _extend_command_line_interface (command_line_interface ):
@@ -78,11 +84,11 @@ def pytask_add_hooks(pm):
78
84
79
85
@click .group (
80
86
cls = DefaultGroup ,
81
- context_settings = CONTEXT_SETTINGS ,
87
+ context_settings = _CONTEXT_SETTINGS ,
82
88
default = "build" ,
83
89
default_if_no_args = True ,
84
90
)
85
- @click .version_option ()
91
+ @click .version_option (** _VERSION_OPTION_KWARGS )
86
92
def cli ():
87
93
"""The command line interface of pytask."""
88
94
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