Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-click-help-colors for
openSUSE:Factory checked in at 2021-07-28 19:21:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-click-help-colors (Old)
and /work/SRC/openSUSE:Factory/.python-click-help-colors.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-click-help-colors"
Wed Jul 28 19:21:41 2021 rev:4 rq:908886 version:0.9.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-click-help-colors/python-click-help-colors.changes
2020-03-31 17:17:51.327727056 +0200
+++
/work/SRC/openSUSE:Factory/.python-click-help-colors.new.1899/python-click-help-colors.changes
2021-07-28 19:21:45.711499992 +0200
@@ -1,0 +2,7 @@
+Wed Jul 28 09:51:35 UTC 2021 - Mark??ta Machov?? <[email protected]>
+
+- Update to 0.9.1
+ * Add support for Click 8
+ * Drop support for Python 2 and 3.5.
+
+-------------------------------------------------------------------
Old:
----
click-help-colors-0.8.tar.gz
New:
----
click-help-colors-0.9.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-click-help-colors.spec ++++++
--- /var/tmp/diff_new_pack.AQc7jf/_old 2021-07-28 19:21:46.147499420 +0200
+++ /var/tmp/diff_new_pack.AQc7jf/_new 2021-07-28 19:21:46.151499415 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-click-help-colors
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,8 +17,9 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
Name: python-click-help-colors
-Version: 0.8
+Version: 0.9.1
Release: 0
Summary: Colorization of help messages in Click
License: MIT
++++++ click-help-colors-0.8.tar.gz -> click-help-colors-0.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/CHANGES.rst
new/click-help-colors-0.9.1/CHANGES.rst
--- old/click-help-colors-0.8/CHANGES.rst 2020-03-13 15:03:35.000000000
+0100
+++ new/click-help-colors-0.9.1/CHANGES.rst 2021-07-11 11:12:29.000000000
+0200
@@ -1,3 +1,16 @@
+[0.9.1]
+-------------------------------
+- Fix issue with options with multiple names. `PR #16
<https://github.com/click-contrib/click-help-colors/pull/16>`_
+
+[0.9]
+-------------------------------
+- Add support for Click 8
+- Drop support for Python 2 and 3.5.
+
+[0.8.1]
+-------------------------------
+- Changed required version of Click to >=7.0,<8
+
[0.8]
-------------------------------
- Add missing files to sdist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/PKG-INFO
new/click-help-colors-0.9.1/PKG-INFO
--- old/click-help-colors-0.8/PKG-INFO 2020-03-13 15:08:10.000000000 +0100
+++ new/click-help-colors-0.9.1/PKG-INFO 2021-07-11 12:03:11.915329200
+0200
@@ -1,176 +1,179 @@
Metadata-Version: 2.1
Name: click-help-colors
-Version: 0.8
+Version: 0.9.1
Summary: Colorization of help messages in Click
Home-page: https://github.com/r-m-n/click-help-colors
License: MIT
-Description: =================
- click-help-colors
- =================
-
- |build| |pypi| |downloads|
-
- Colorization of help messages in Click_.
-
- Usage
- -----
-
- .. code:: python
-
- import click
- from click_help_colors import HelpColorsGroup, HelpColorsCommand
-
- @click.group(
- cls=HelpColorsGroup,
- help_headers_color='yellow',
- help_options_color='green'
- )
- def cli():
- pass
-
- @cli.command()
- @click.option('--count', default=1, help='Some number.')
- def command1(count):
- click.echo('command 1')
-
- @cli.command(
- cls=HelpColorsCommand,
- help_options_color='blue'
- )
- @click.option('--name', help='Some string.')
- def command2(name):
- click.echo('command 2')
-
- .. code-block:: console
-
- $ python example.py --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/1.png
-
- .. code-block:: console
-
- $ python example.py command1 --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/2.png
-
- .. code-block:: console
-
- $ python example.py command2 --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/3.png
-
- .. code:: python
-
- import click
- from click_help_colors import HelpColorsGroup, HelpColorsCommand
-
- @click.group(
- cls=HelpColorsGroup,
- help_headers_color='yellow',
- help_options_color='green',
- help_options_custom_colors={'command3': 'red', 'command4':
'cyan'}
- )
- def cli():
- pass
-
-
- @cli.command(
- cls=HelpColorsCommand,
- help_headers_color=None,
- help_options_color=None,
- help_options_custom_colors={'--count': 'red', '--subtract':
'green'}
- )
- @click.option('--count', default=1, help='Count help text.')
- @click.option('--add', default=1, help='Add help text.')
- @click.option('--subtract', default=1, help='Subtract help text.')
- def command1(count, add, subtract):
- """A command"""
- click.echo('command 1')
-
- ...
-
- .. code-block:: console
-
- $ python example_with_custom_colors.py --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/4.png
-
- .. code-block:: console
-
- $ python example_with_custom_colors.py --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/5.png
-
- .. code:: python
-
- from click_help_colors import version_option
-
- @click.group()
- def cli():
- pass
-
- @cli.command()
- @version_option(
- version='1.0',
- prog_name='example',
- message_color='green'
- )
- def cmd1():
- pass
-
- @cli.command()
- @version_option(
- version='1.0',
- prog_name='example',
- version_color='green',
- prog_name_color='yellow'
- )
- def cmd2():
- pass
-
- @cli.command()
- @version_option(
- version='1.0',
- prog_name='example',
- version_color='green',
- prog_name_color='white',
- message='%(prog)s %(version)s\n python=3.7',
- message_color='bright_black'
- )
- def cmd3():
- pass
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/6.png
-
- Installation
- ------------
-
- With ``pip``:
-
- .. code-block:: console
-
- $ pip install click-help-colors
-
- From source:
-
- .. code-block:: console
-
- $ git clone https://github.com/r-m-n/click-help-colors.git
- $ cd click-help-colors
- $ python setup.py install
-
- .. _Click: http://click.pocoo.org/
-
-
- .. |pypi| image:: https://img.shields.io/pypi/v/click-help-colors
- :alt: PyPI
-
- .. |build| image::
https://travis-ci.com/click-contrib/click-help-colors.svg?branch=master
- :target: https://travis-ci.com/click-contrib/click-help-colors
-
- .. |downloads| image:: https://img.shields.io/pypi/dm/click-help-colors
- :alt: PyPI - Downloads
-
Keywords: click
Platform: UNKNOWN
Provides-Extra: dev
+License-File: LICENSE.txt
+
+=================
+click-help-colors
+=================
+
+|build| |pypi| |downloads|
+
+Colorization of help messages in Click_.
+
+Usage
+-----
+
+.. code:: python
+
+ import click
+ from click_help_colors import HelpColorsGroup, HelpColorsCommand
+
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green'
+ )
+ def cli():
+ pass
+
+ @cli.command()
+ @click.option('--count', default=1, help='Some number.')
+ def command1(count):
+ click.echo('command 1')
+
+ @cli.command(
+ cls=HelpColorsCommand,
+ help_options_color='blue'
+ )
+ @click.option('--name', help='Some string.')
+ def command2(name):
+ click.echo('command 2')
+
+.. code-block:: console
+
+ $ python example.py --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/1.png
+
+.. code-block:: console
+
+ $ python example.py command1 --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/2.png
+
+.. code-block:: console
+
+ $ python example.py command2 --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/3.png
+
+.. code:: python
+
+ import click
+ from click_help_colors import HelpColorsGroup, HelpColorsCommand
+
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green',
+ help_options_custom_colors={'command3': 'red', 'command4': 'cyan'}
+ )
+ def cli():
+ pass
+
+
+ @cli.command(
+ cls=HelpColorsCommand,
+ help_headers_color=None,
+ help_options_color=None,
+ help_options_custom_colors={'--count': 'red', '--subtract': 'green'}
+ )
+ @click.option('--count', default=1, help='Count help text.')
+ @click.option('--add', default=1, help='Add help text.')
+ @click.option('--subtract', default=1, help='Subtract help text.')
+ def command1(count, add, subtract):
+ """A command"""
+ click.echo('command 1')
+
+ ...
+
+.. code-block:: console
+
+ $ python example_with_custom_colors.py --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/4.png
+
+.. code-block:: console
+
+ $ python example_with_custom_colors.py --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/5.png
+
+.. code:: python
+
+ from click_help_colors import version_option
+
+ @click.group()
+ def cli():
+ pass
+
+ @cli.command()
+ @version_option(
+ version='1.0',
+ prog_name='example',
+ message_color='green'
+ )
+ def cmd1():
+ pass
+
+ @cli.command()
+ @version_option(
+ version='1.0',
+ prog_name='example',
+ version_color='green',
+ prog_name_color='yellow'
+ )
+ def cmd2():
+ pass
+
+ @cli.command()
+ @version_option(
+ version='1.0',
+ prog_name='example',
+ version_color='green',
+ prog_name_color='white',
+ message='%(prog)s %(version)s\n python=3.7',
+ message_color='bright_black'
+ )
+ def cmd3():
+ pass
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/6.png
+
+Installation
+------------
+
+With ``pip``:
+
+.. code-block:: console
+
+ $ pip install click-help-colors
+
+From source:
+
+.. code-block:: console
+
+ $ git clone https://github.com/r-m-n/click-help-colors.git
+ $ cd click-help-colors
+ $ python setup.py install
+
+.. _Click: http://click.pocoo.org/
+
+
+.. |pypi| image:: https://img.shields.io/pypi/v/click-help-colors
+ :alt: PyPI
+
+.. |build| image::
https://travis-ci.com/click-contrib/click-help-colors.svg?branch=master
+ :target: https://travis-ci.com/click-contrib/click-help-colors
+
+.. |downloads| image:: https://img.shields.io/pypi/dm/click-help-colors
+ :alt: PyPI - Downloads
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/click_help_colors/__init__.py
new/click-help-colors-0.9.1/click_help_colors/__init__.py
--- old/click-help-colors-0.8/click_help_colors/__init__.py 2020-03-13
14:55:20.000000000 +0100
+++ new/click-help-colors-0.9.1/click_help_colors/__init__.py 2021-07-11
11:56:04.000000000 +0200
@@ -16,4 +16,4 @@
]
-__version__ = '0.8'
+__version__ = '0.9.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/click_help_colors/core.py
new/click-help-colors-0.9.1/click_help_colors/core.py
--- old/click-help-colors-0.8/click_help_colors/core.py 2020-02-29
08:50:17.000000000 +0100
+++ new/click-help-colors-0.9.1/click_help_colors/core.py 2021-07-11
10:52:59.000000000 +0200
@@ -1,9 +1,13 @@
+import re
+
import click
from .utils import _colorize, _extend_instance
class HelpColorsFormatter(click.HelpFormatter):
+ options_regex = re.compile(r'-{1,2}[\w\-]+')
+
def __init__(self, headers_color=None, options_color=None,
options_custom_colors=None, *args, **kwargs):
self.headers_color = headers_color
@@ -11,13 +15,22 @@
self.options_custom_colors = options_custom_colors
super(HelpColorsFormatter, self).__init__(*args, **kwargs)
- def _pick_color(self, option_name):
- opt = option_name.split()[0]
- if (self.options_custom_colors and
- (opt in self.options_custom_colors.keys())):
- return self.options_custom_colors[opt]
+ def _get_opt_names(self, option_name):
+ opts = self.options_regex.findall(option_name)
+ if not opts:
+ return [option_name]
else:
- return self.options_color
+ # Include this for backwards compatibility
+ opts.append(option_name.split()[0])
+ return opts
+
+ def _pick_color(self, option_name):
+ opts = self._get_opt_names(option_name)
+ for opt in opts:
+ if (self.options_custom_colors and
+ (opt in self.options_custom_colors.keys())):
+ return self.options_custom_colors[opt]
+ return self.options_color
def write_usage(self, prog, args='', prefix='Usage: '):
colorized_prefix = _colorize(prefix, color=self.headers_color)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/click-help-colors-0.8/click_help_colors/decorators.py
new/click-help-colors-0.9.1/click_help_colors/decorators.py
--- old/click-help-colors-0.8/click_help_colors/decorators.py 2020-02-29
10:47:05.000000000 +0100
+++ new/click-help-colors-0.9.1/click_help_colors/decorators.py 2021-07-11
10:52:59.000000000 +0200
@@ -1,79 +1,41 @@
-import sys
import re
-from click import echo
-from click.decorators import option
-from click._compat import iteritems
-
from .utils import _colorize
-def version_option(version=None, *param_decls, **attrs):
- """Adds a ``--version`` option which immediately ends the program
- printing out the version number. This is implemented as an eager
- option that prints the version and exits the program in the callback.
-
- :param version: the version number to show. If not provided Click
- attempts an auto discovery via setuptools.
- :param prog_name: the name of the program (defaults to autodetection)
- :param message: custom message to show instead of the default
- (``'%(prog)s, version %(version)s'``)
- :param prog_name_color: color of the prog_name
- :param version_color: color of the version
- :param message_color: default color of the message
- :param others: everything else is forwarded to :func:`option`.
+from click import version_option as click_version_option
+
+
+def version_option(
+ version=None,
+ prog_name=None,
+ message="%(prog)s, version %(version)s",
+ message_color=None,
+ prog_name_color=None,
+ version_color=None,
+ **kwargs
+ ):
+ """
+ :param prog_name_color: color of the prog_name.
+ :param version_color: color of the version.
+ :param message_color: default color of the message.
+
+ for other params see Click's version_option decorator:
+ https://click.palletsprojects.com/en/7.x/api/#click.version_option
"""
- if version is None:
- if hasattr(sys, '_getframe'):
- module = sys._getframe(1).f_globals.get('__name__')
+ msg_parts = []
+ for s in re.split(r'(%\(version\)s|%\(prog\)s)', message):
+ if s == '%(prog)s':
+ msg_parts.append(_colorize(prog_name, prog_name_color or
message_color))
+ elif s == '%(version)s':
+ msg_parts.append(_colorize(version, version_color or
message_color))
else:
- module = ''
+ msg_parts.append(_colorize(s, message_color))
+ message = ''.join(msg_parts)
- def decorator(f):
- prog_name = attrs.pop('prog_name', None)
- message = attrs.pop('message', '%(prog)s, version %(version)s')
- message_color = attrs.pop('message_color', None)
- prog_name_color = attrs.pop('prog_name_color', message_color)
- version_color = attrs.pop('version_color', message_color)
-
- def callback(ctx, param, value):
- if not value or ctx.resilient_parsing:
- return
- prog = prog_name
- if prog is None:
- prog = ctx.find_root().info_name
- ver = version
- if ver is None:
- try:
- import pkg_resources
- except ImportError:
- pass
- else:
- for dist in pkg_resources.working_set:
- scripts = dist.get_entry_map().get('console_scripts')
or {}
- for script_name, entry_point in iteritems(scripts):
- if entry_point.module_name == module:
- ver = dist.version
- break
- if ver is None:
- raise RuntimeError('Could not determine version')
-
- msg_parts = []
- for s in re.split(r'(%\(version\)s|%\(prog\)s)', message):
- if s == '%(prog)s':
- msg_parts.append(_colorize(prog_name, prog_name_color))
- elif s == '%(version)s':
- msg_parts.append(_colorize(version, version_color))
- else:
- msg_parts.append(_colorize(s, message_color))
-
- echo(''.join(msg_parts))
- ctx.exit()
-
- attrs.setdefault('is_flag', True)
- attrs.setdefault('expose_value', False)
- attrs.setdefault('is_eager', True)
- attrs.setdefault('help', 'Show the version and exit.')
- attrs['callback'] = callback
- return option(*(param_decls or ('--version',)), **attrs)(f)
- return decorator
+ return click_version_option(
+ version=version,
+ prog_name=prog_name,
+ message=message,
+ **kwargs
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/click-help-colors-0.8/click_help_colors.egg-info/PKG-INFO
new/click-help-colors-0.9.1/click_help_colors.egg-info/PKG-INFO
--- old/click-help-colors-0.8/click_help_colors.egg-info/PKG-INFO
2020-03-13 15:08:10.000000000 +0100
+++ new/click-help-colors-0.9.1/click_help_colors.egg-info/PKG-INFO
2021-07-11 12:03:11.000000000 +0200
@@ -1,176 +1,179 @@
Metadata-Version: 2.1
Name: click-help-colors
-Version: 0.8
+Version: 0.9.1
Summary: Colorization of help messages in Click
Home-page: https://github.com/r-m-n/click-help-colors
License: MIT
-Description: =================
- click-help-colors
- =================
-
- |build| |pypi| |downloads|
-
- Colorization of help messages in Click_.
-
- Usage
- -----
-
- .. code:: python
-
- import click
- from click_help_colors import HelpColorsGroup, HelpColorsCommand
-
- @click.group(
- cls=HelpColorsGroup,
- help_headers_color='yellow',
- help_options_color='green'
- )
- def cli():
- pass
-
- @cli.command()
- @click.option('--count', default=1, help='Some number.')
- def command1(count):
- click.echo('command 1')
-
- @cli.command(
- cls=HelpColorsCommand,
- help_options_color='blue'
- )
- @click.option('--name', help='Some string.')
- def command2(name):
- click.echo('command 2')
-
- .. code-block:: console
-
- $ python example.py --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/1.png
-
- .. code-block:: console
-
- $ python example.py command1 --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/2.png
-
- .. code-block:: console
-
- $ python example.py command2 --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/3.png
-
- .. code:: python
-
- import click
- from click_help_colors import HelpColorsGroup, HelpColorsCommand
-
- @click.group(
- cls=HelpColorsGroup,
- help_headers_color='yellow',
- help_options_color='green',
- help_options_custom_colors={'command3': 'red', 'command4':
'cyan'}
- )
- def cli():
- pass
-
-
- @cli.command(
- cls=HelpColorsCommand,
- help_headers_color=None,
- help_options_color=None,
- help_options_custom_colors={'--count': 'red', '--subtract':
'green'}
- )
- @click.option('--count', default=1, help='Count help text.')
- @click.option('--add', default=1, help='Add help text.')
- @click.option('--subtract', default=1, help='Subtract help text.')
- def command1(count, add, subtract):
- """A command"""
- click.echo('command 1')
-
- ...
-
- .. code-block:: console
-
- $ python example_with_custom_colors.py --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/4.png
-
- .. code-block:: console
-
- $ python example_with_custom_colors.py --help
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/5.png
-
- .. code:: python
-
- from click_help_colors import version_option
-
- @click.group()
- def cli():
- pass
-
- @cli.command()
- @version_option(
- version='1.0',
- prog_name='example',
- message_color='green'
- )
- def cmd1():
- pass
-
- @cli.command()
- @version_option(
- version='1.0',
- prog_name='example',
- version_color='green',
- prog_name_color='yellow'
- )
- def cmd2():
- pass
-
- @cli.command()
- @version_option(
- version='1.0',
- prog_name='example',
- version_color='green',
- prog_name_color='white',
- message='%(prog)s %(version)s\n python=3.7',
- message_color='bright_black'
- )
- def cmd3():
- pass
-
- .. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/6.png
-
- Installation
- ------------
-
- With ``pip``:
-
- .. code-block:: console
-
- $ pip install click-help-colors
-
- From source:
-
- .. code-block:: console
-
- $ git clone https://github.com/r-m-n/click-help-colors.git
- $ cd click-help-colors
- $ python setup.py install
-
- .. _Click: http://click.pocoo.org/
-
-
- .. |pypi| image:: https://img.shields.io/pypi/v/click-help-colors
- :alt: PyPI
-
- .. |build| image::
https://travis-ci.com/click-contrib/click-help-colors.svg?branch=master
- :target: https://travis-ci.com/click-contrib/click-help-colors
-
- .. |downloads| image:: https://img.shields.io/pypi/dm/click-help-colors
- :alt: PyPI - Downloads
-
Keywords: click
Platform: UNKNOWN
Provides-Extra: dev
+License-File: LICENSE.txt
+
+=================
+click-help-colors
+=================
+
+|build| |pypi| |downloads|
+
+Colorization of help messages in Click_.
+
+Usage
+-----
+
+.. code:: python
+
+ import click
+ from click_help_colors import HelpColorsGroup, HelpColorsCommand
+
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green'
+ )
+ def cli():
+ pass
+
+ @cli.command()
+ @click.option('--count', default=1, help='Some number.')
+ def command1(count):
+ click.echo('command 1')
+
+ @cli.command(
+ cls=HelpColorsCommand,
+ help_options_color='blue'
+ )
+ @click.option('--name', help='Some string.')
+ def command2(name):
+ click.echo('command 2')
+
+.. code-block:: console
+
+ $ python example.py --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/1.png
+
+.. code-block:: console
+
+ $ python example.py command1 --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/2.png
+
+.. code-block:: console
+
+ $ python example.py command2 --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/3.png
+
+.. code:: python
+
+ import click
+ from click_help_colors import HelpColorsGroup, HelpColorsCommand
+
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green',
+ help_options_custom_colors={'command3': 'red', 'command4': 'cyan'}
+ )
+ def cli():
+ pass
+
+
+ @cli.command(
+ cls=HelpColorsCommand,
+ help_headers_color=None,
+ help_options_color=None,
+ help_options_custom_colors={'--count': 'red', '--subtract': 'green'}
+ )
+ @click.option('--count', default=1, help='Count help text.')
+ @click.option('--add', default=1, help='Add help text.')
+ @click.option('--subtract', default=1, help='Subtract help text.')
+ def command1(count, add, subtract):
+ """A command"""
+ click.echo('command 1')
+
+ ...
+
+.. code-block:: console
+
+ $ python example_with_custom_colors.py --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/4.png
+
+.. code-block:: console
+
+ $ python example_with_custom_colors.py --help
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/5.png
+
+.. code:: python
+
+ from click_help_colors import version_option
+
+ @click.group()
+ def cli():
+ pass
+
+ @cli.command()
+ @version_option(
+ version='1.0',
+ prog_name='example',
+ message_color='green'
+ )
+ def cmd1():
+ pass
+
+ @cli.command()
+ @version_option(
+ version='1.0',
+ prog_name='example',
+ version_color='green',
+ prog_name_color='yellow'
+ )
+ def cmd2():
+ pass
+
+ @cli.command()
+ @version_option(
+ version='1.0',
+ prog_name='example',
+ version_color='green',
+ prog_name_color='white',
+ message='%(prog)s %(version)s\n python=3.7',
+ message_color='bright_black'
+ )
+ def cmd3():
+ pass
+
+.. image::
https://raw.githubusercontent.com/r-m-n/click-help-colors/master/examples/screenshots/6.png
+
+Installation
+------------
+
+With ``pip``:
+
+.. code-block:: console
+
+ $ pip install click-help-colors
+
+From source:
+
+.. code-block:: console
+
+ $ git clone https://github.com/r-m-n/click-help-colors.git
+ $ cd click-help-colors
+ $ python setup.py install
+
+.. _Click: http://click.pocoo.org/
+
+
+.. |pypi| image:: https://img.shields.io/pypi/v/click-help-colors
+ :alt: PyPI
+
+.. |build| image::
https://travis-ci.com/click-contrib/click-help-colors.svg?branch=master
+ :target: https://travis-ci.com/click-contrib/click-help-colors
+
+.. |downloads| image:: https://img.shields.io/pypi/dm/click-help-colors
+ :alt: PyPI - Downloads
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/click-help-colors-0.8/click_help_colors.egg-info/requires.txt
new/click-help-colors-0.9.1/click_help_colors.egg-info/requires.txt
--- old/click-help-colors-0.8/click_help_colors.egg-info/requires.txt
2020-03-13 15:08:10.000000000 +0100
+++ new/click-help-colors-0.9.1/click_help_colors.egg-info/requires.txt
2021-07-11 12:03:11.000000000 +0200
@@ -1,4 +1,4 @@
-click>=7.0
+click<9,>=7.0
[dev]
pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/setup.py
new/click-help-colors-0.9.1/setup.py
--- old/click-help-colors-0.8/setup.py 2020-03-13 13:50:41.000000000 +0100
+++ new/click-help-colors-0.9.1/setup.py 2021-07-11 10:52:59.000000000
+0200
@@ -22,7 +22,7 @@
keywords=['click'],
license='MIT',
install_requires=[
- 'click>=7.0'
+ 'click>=7.0,<9'
],
extras_require={
"dev": [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/tests/test_custom_colors.py
new/click-help-colors-0.9.1/tests/test_custom_colors.py
--- old/click-help-colors-0.8/tests/test_custom_colors.py 2020-02-09
14:28:54.000000000 +0100
+++ new/click-help-colors-0.9.1/tests/test_custom_colors.py 2021-07-11
10:52:59.000000000 +0200
@@ -1,3 +1,4 @@
+import pytest
import click
from click_help_colors import HelpColorsGroup, HelpColorsCommand
@@ -62,3 +63,83 @@
' \x1b[31mcommand1\x1b[0m',
' \x1b[32mcommand2\x1b[0m'
]
+
+
+def test_option_color(runner):
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green',
+ help_options_custom_colors={'--name': 'red'}
+ )
+ def cli():
+ pass
+
+ @cli.command()
+ @click.option('--name', help='The person to greet.')
+ def command(name):
+ pass
+
+ result = runner.invoke(cli, ['command', '--help'], color=True)
+ assert not result.exception
+ assert result.output.splitlines() == [
+ '\x1b[33mUsage: \x1b[0mcli command [OPTIONS]',
+ '',
+ '\x1b[33mOptions\x1b[0m:',
+ ' \x1b[31m--name TEXT\x1b[0m The person to greet.',
+ ' \x1b[32m--help\x1b[0m Show this message and exit.'
+ ]
+
+
[email protected]('option_name', ['-n', '--name', '-n,'])
+def test_multi_name_option_color(runner, option_name):
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green',
+ help_options_custom_colors={option_name: 'red'}
+ )
+ def cli():
+ pass
+
+ @cli.command()
+ @click.option('-n', '--name', help='The person to greet.')
+ def command(name):
+ pass
+
+ result = runner.invoke(cli, ['command', '--help'], color=True)
+ assert not result.exception
+ assert result.output.splitlines() == [
+ '\x1b[33mUsage: \x1b[0mcli command [OPTIONS]',
+ '',
+ '\x1b[33mOptions\x1b[0m:',
+ ' \x1b[31m-n, --name TEXT\x1b[0m The person to greet.',
+ ' \x1b[32m--help\x1b[0m Show this message and exit.'
+ ]
+
+
[email protected]('option_name', ['--shout', '--no-shout'])
+def test_flag_option_color(runner, option_name):
+ @click.group(
+ cls=HelpColorsGroup,
+ help_headers_color='yellow',
+ help_options_color='green',
+ help_options_custom_colors={option_name: 'red'}
+ )
+ def cli():
+ pass
+
+ @cli.command()
+ @click.option('--shout/--no-shout', default=False)
+ def command(name):
+ pass
+
+ result = runner.invoke(cli, ['command', '--help'], color=True)
+ assert not result.exception
+ assert result.output.splitlines() == [
+ '\x1b[33mUsage: \x1b[0mcli command [OPTIONS]',
+ '',
+ '\x1b[33mOptions\x1b[0m:',
+ ' \x1b[31m--shout / --no-shout\x1b[0m',
+ ' \x1b[32m--help\x1b[0m Show this message and exit.'
+ ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/click-help-colors-0.8/tox.ini
new/click-help-colors-0.9.1/tox.ini
--- old/click-help-colors-0.8/tox.ini 2020-02-09 14:28:54.000000000 +0100
+++ new/click-help-colors-0.9.1/tox.ini 2021-07-11 10:52:59.000000000 +0200
@@ -1,7 +1,14 @@
[tox]
-envlist = py27,py37
+envlist =
+ py36-{7,8}
+ py37-{7,8}
+ py38-{7,8}
+ py39-{7,8}
[testenv]
-deps = pytest
-commands =
+deps =
pytest
+ 7: click >= 7.0, < 8
+ 8: click >= 8.0.0a1, < 9
+commands = pytest
+skip_missing_interpreters = true