diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a807f85..6c9e4ec 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,13 @@ vNext ----- +Version 21.5.25 +--------------- + +- Fix click-realted bug https://github.com/nexB/scancode-toolkit/issues/2529 +- Add tests to run on the latest of every dependency + + Version 21.5.12 --------------- diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31ef36f..7c21072 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,3 @@ - ################################################################################ # We use Azure to run the full tests suites on multiple Python 3.x # on multiple Windows, macOS and Linux versions all on 64 bits @@ -62,3 +61,33 @@ jobs: python_versions: ['3.6', '3.7', '3.8', '3.9'] test_suites: all: tmp\Scripts\pytest -n 2 -vvs + + +################################################################################ +# Test using a plain pip install to get the latest of all wheels +################################################################################ + + + - template: etc/ci/azure-posix.yml + parameters: + job_name: ubuntu20_cpython_latest_from_pip + image_name: ubuntu-20.04 + python_versions: ['3.6', '3.7', '3.8', '3.9'] + test_suites: + all: tmp/bin/pip install --force-reinstall --upgrade -e . && tmp/bin/pytest -n 2 -vvs + + - template: etc/ci/azure-win.yml + parameters: + job_name: win2019_cpython_latest_from_pip + image_name: windows-2019 + python_versions: ['3.6', '3.7', '3.8', '3.9'] + test_suites: + all: tmp\Scripts\pip install --force-reinstall --upgrade -e . && tmp\Scripts\pytest -n 2 -vvs + + - template: etc/ci/azure-posix.yml + parameters: + job_name: macos1015_cpython_latest_from_pip + image_name: macos-10.15 + python_versions: ['3.6', '3.7', '3.8', '3.9'] + test_suites: + all: tmp/bin/pip install --force-reinstall --upgrade -e . && tmp/bin/pytest -n 2 -vvs diff --git a/src/commoncode/cliutils.py b/src/commoncode/cliutils.py index 9e51a46..1a2e427 100644 --- a/src/commoncode/cliutils.py +++ b/src/commoncode/cliutils.py @@ -9,7 +9,7 @@ import sys import click -click.disable_unicode_literals_warning = True + from click.utils import echo from click.termui import style from click.types import BoolParamType @@ -352,6 +352,7 @@ def __init__( allow_from_autoenv=True, type=None, # NOQA help=None, # NOQA + hidden=False, # custom additions # # a string that set the CLI help group for this option help_group=MISC_GROUP, @@ -365,24 +366,21 @@ def __init__( # a sequence of other option name strings that this option # conflicts with if they are set conflicting_options=(), - # a flag set to True if this option should be hidden from the CLI help - hidden=False, **kwargs ): - super(PluggableCommandLineOption, self).__init__( - param_decls, - show_default, - prompt, - confirmation_prompt, - hide_input, - is_flag, - flag_value, - multiple, - count, - allow_from_autoenv, - type, - help, + param_decls=param_decls, + show_default=show_default, + prompt=prompt, + confirmation_prompt=confirmation_prompt, + hide_input=hide_input, + is_flag=is_flag, + flag_value=flag_value, + multiple=multiple, + count=count, + allow_from_autoenv=allow_from_autoenv, + type=type, + help=help, **kwargs ) @@ -418,6 +416,7 @@ def get_help_record(self, ctx): return click.Option.get_help_record(self, ctx) + def validate_option_dependencies(ctx): """ Validate all PluggableCommandLineOption dependencies in the `ctx` Click diff --git a/tests/test_cliutils.py b/tests/test_cliutils.py index b30ac12..a65cfb1 100644 --- a/tests/test_cliutils.py +++ b/tests/test_cliutils.py @@ -138,8 +138,13 @@ def test_GroupedHelpCommand_help_with_group(self): from commoncode.cliutils import CORE_GROUP @click.command(name='scan', cls=GroupedHelpCommand) - @click.option('--opt', is_flag=True, help='Help text for option', - help_group=CORE_GROUP, cls=PluggableCommandLineOption) + @click.option( + '--opt', + is_flag=True, + help='Help text for option', + help_group=CORE_GROUP, + cls=PluggableCommandLineOption, + ) def scan(opt): pass