Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-tcolorpy for openSUSE:Factory
checked in at 2021-08-23 10:08:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tcolorpy (Old)
and /work/SRC/openSUSE:Factory/.python-tcolorpy.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tcolorpy"
Mon Aug 23 10:08:05 2021 rev:2 rq:913353 version:0.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tcolorpy/python-tcolorpy.changes
2021-04-24 23:10:14.739487503 +0200
+++
/work/SRC/openSUSE:Factory/.python-tcolorpy.new.1899/python-tcolorpy.changes
2021-08-23 10:09:05.524181872 +0200
@@ -1,0 +2,7 @@
+Fri Aug 20 12:29:39 UTC 2021 - Martin Hauke <[email protected]>
+
+- Update to version 0.1.0
+ * Add hsv property to Color class
+ * Drop support for Python 3.5
+
+-------------------------------------------------------------------
Old:
----
tcolorpy-0.0.8.tar.gz
New:
----
tcolorpy-0.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-tcolorpy.spec ++++++
--- /var/tmp/diff_new_pack.RM4DME/_old 2021-08-23 10:09:06.100181200 +0200
+++ /var/tmp/diff_new_pack.RM4DME/_new 2021-08-23 10:09:06.104181195 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-tcolorpy
-Version: 0.0.8
+Version: 0.1.0
Release: 0
Summary: Python library to apply true color for terminal text
License: MIT
++++++ tcolorpy-0.0.8.tar.gz -> tcolorpy-0.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/PKG-INFO new/tcolorpy-0.1.0/PKG-INFO
--- old/tcolorpy-0.0.8/PKG-INFO 2020-08-14 16:16:32.000000000 +0200
+++ new/tcolorpy-0.1.0/PKG-INFO 2021-06-12 15:33:34.150000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tcolorpy
-Version: 0.0.8
+Version: 0.1.0
Summary: tcolopy is a Python library to apply true color for terminal text.
Home-page: https://github.com/thombashi/tcolorpy
Author: Tsuyoshi Hombashi
@@ -8,146 +8,18 @@
License: MIT License
Project-URL: Source, https://github.com/thombashi/tcolorpy
Project-URL: Tracker, https://github.com/thombashi/tcolorpy/issues
-Description: .. contents:: **tcolorpy**
- :backlinks: top
- :depth: 2
-
-
- Summary
- ============================================
- tcolopy is a Python library to apply true color for terminal text.
-
- .. image:: https://badge.fury.io/py/tcolorpy.svg
- :target: https://badge.fury.io/py/tcolorpy
- :alt: PyPI package version
-
- .. image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg
- :target: https://pypi.org/project/tcolorpy
- :alt: Supported Python versions
-
- .. image:: https://img.shields.io/pypi/implementation/tcolorpy.svg
- :target: https://pypi.org/project/tcolorpy
- :alt: Supported Python implementations
-
- .. image::
https://img.shields.io/travis/thombashi/tcolorpy/master.svg?label=Linux/macOS%20CI
- :target: https://travis-ci.org/thombashi/tcolorpy
- :alt: Linux/macOS CI status
-
- .. image::
https://img.shields.io/appveyor/ci/thombashi/tcolorpy/master.svg?label=Windows%20CI
- :target:
https://ci.appveyor.com/project/thombashi/tcolorpy/branch/master
- :alt: Windows CI status
-
- .. image::
https://codecov.io/gh/thombashi/tcolorpy/branch/master/graph/badge.svg
- :target: https://codecov.io/gh/thombashi/tcolorpy
- :alt: Test coverage: codecov
-
-
- Installation
- ============================================
- ::
-
- pip install tcolorpy
-
-
- Usage
- ============================================
-
- Library usage
- --------------------------------------------
-
- :Sample Code:
- .. code-block:: python
-
- from tcolorpy import tcolor
-
- print(tcolor("tcolopy example", color="#ee1177",
styles=["bold", "italic", "underline"]))
-
- :Output:
- .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/oneline.png
- :scale: 60%
- :alt:
https://github.com/thombashi/tcolorpy/blob/master/ss/oneline.png
-
- You can set the following ``tcolor`` arguments:
-
- - ``color``/``bg_color``
- - color names (``"red"``, ``"red"``, etc.) or color code
(``"#RRGGBB"``)
- - ``styles``
- - ``"bold"``, ``"italic"``, etc.
-
-
- Other examples
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Apply true color and styles to text:
-
- .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/styles.png
- :scale: 60%
- :alt:
https://github.com/thombashi/tcolorpy/blob/master/ss/styles.png
-
- `tcolorpy/ansi_styles.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_styles.py>`__
-
- You can also specify colors by names:
-
- .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/ansi_colors.png
- :scale: 60%
- :alt:
https://github.com/thombashi/tcolorpy/blob/master/ss/ansi_colors.png
-
- `tcolorpy/ansi_colors.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_colors.py>`__
-
-
- CLI usage
- --------------------------------------------
- ``tcolorpy`` can be used via CLI:
-
- ::
-
- $ python -m tcolorpy "tcolopy example" -c "#ee1177" -s
bold,italic,underline
-
- Command help
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ::
-
- usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES]
[--encode ENCODE]
- string
-
- positional arguments:
- string string to apply styles.
-
- optional arguments:
- -h, --help show this help message and exit
- -c COLOR, --color COLOR
- specify a color code (#XXXXXX) or a name.
valid names
- are: black, red, green, yellow, blue,
magenta, cyan,
- white, lightblack, lightred, lightgreen,
lightyellow,
- lightblue, lightmagenta, lightcyan,
lightwhite
- -b BG_COLOR, --bg-color BG_COLOR
- specify a background color code (#XXXXXX)
or a name.
- valid names are: black, red, green,
yellow, blue,
- magenta, cyan, white, lightblack, lightred,
- lightgreen, lightyellow, lightblue,
lightmagenta,
- lightcyan, lightwhite
- -s STYLES, --styles STYLES
- specify a comma separated styles. valid
values are:
- bold, dim, italic, underline, blink,
invert, strike
- --encode ENCODE output a text encoded with the specified
encoding
-
-
- Dependencies
- ============================================
- Python 3.5+
- No external dependencies.
-
Keywords: ANSI escape,terminal color,truecolor
Platform: UNKNOWN
-Classifier: Development Status :: 3 - Alpha
+Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -155,6 +27,146 @@
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing
-Requires-Python: >=3.5
+Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Provides-Extra: test
+License-File: LICENSE
+
+.. contents:: **tcolorpy**
+ :backlinks: top
+ :depth: 2
+
+
+Summary
+============================================
+tcolopy is a Python library to apply true color for terminal text.
+
+.. image:: https://badge.fury.io/py/tcolorpy.svg
+ :target: https://badge.fury.io/py/tcolorpy
+ :alt: PyPI package version
+
+.. image:: https://anaconda.org/conda-forge/tcolorpy/badges/version.svg
+ :target: https://anaconda.org/conda-forge/tcolorpy
+ :alt: conda-forge package version
+
+.. image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg
+ :target: https://pypi.org/project/tcolorpy
+ :alt: Supported Python versions
+
+.. image:: https://img.shields.io/pypi/implementation/tcolorpy.svg
+ :target: https://pypi.org/project/tcolorpy
+ :alt: Supported Python implementations
+
+.. image:: https://github.com/thombashi/tcolorpy/workflows/Tests/badge.svg
+ :target:
https://github.com/thombashi/tcolorpy/actions?query=workflow%3ATests
+ :alt: Linux/macOS/Windows CI status
+
+.. image::
https://coveralls.io/repos/github/thombashi/tcolorpy/badge.svg?branch=master
+ :target: https://coveralls.io/github/thombashi/tcolorpy?branch=master
+ :alt: Test coverage: coveralls
+
+
+Installation
+============================================
+
+Installation: pip
+------------------------------
+::
+
+ pip install tcolorpy
+
+Installation: conda
+------------------------------
+::
+
+ conda install -c conda-forge tcolorpy
+
+
+Usage
+============================================
+
+Library usage
+--------------------------------------------
+
+:Sample Code:
+ .. code-block:: python
+
+ from tcolorpy import tcolor
+
+ print(tcolor("tcolopy example", color="#ee1177", styles=["bold",
"italic", "underline"]))
+
+:Output:
+ .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/oneline.png
+ :scale: 60%
+ :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/oneline.png
+
+You can set the following ``tcolor`` arguments:
+
+- ``color``/``bg_color``
+ - color names (``"red"``, ``"red"``, etc.) or color code (``"#RRGGBB"``)
+- ``styles``
+ - ``"bold"``, ``"italic"``, etc.
+
+
+Other examples
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Apply true color and styles to text:
+
+.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/styles.png
+ :scale: 60%
+ :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/styles.png
+
+ `tcolorpy/ansi_styles.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_styles.py>`__
+
+You can also specify colors by names:
+
+.. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/ansi_colors.png
+ :scale: 60%
+ :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/ansi_colors.png
+
+ `tcolorpy/ansi_colors.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_colors.py>`__
+
+
+CLI usage
+--------------------------------------------
+``tcolorpy`` can be used via CLI:
+
+::
+
+ $ python -m tcolorpy "tcolopy example" -c "#ee1177" -s
bold,italic,underline
+
+Command help
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+::
+
+ usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES] [--encode
ENCODE]
+ string
+
+ positional arguments:
+ string string to apply styles.
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -c COLOR, --color COLOR
+ specify a color code (#XXXXXX) or a name. valid
names
+ are: black, red, green, yellow, blue, magenta,
cyan,
+ white, lightblack, lightred, lightgreen,
lightyellow,
+ lightblue, lightmagenta, lightcyan, lightwhite
+ -b BG_COLOR, --bg-color BG_COLOR
+ specify a background color code (#XXXXXX) or a
name.
+ valid names are: black, red, green, yellow, blue,
+ magenta, cyan, white, lightblack, lightred,
+ lightgreen, lightyellow, lightblue, lightmagenta,
+ lightcyan, lightwhite
+ -s STYLES, --styles STYLES
+ specify a comma separated styles. valid values are:
+ bold, dim, italic, underline, blink, invert, strike
+ --encode ENCODE output a text encoded with the specified encoding
+
+
+Dependencies
+============================================
+Python 3.6+
+No external dependencies.
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/README.rst
new/tcolorpy-0.1.0/README.rst
--- old/tcolorpy-0.0.8/README.rst 2020-08-14 16:16:17.000000000 +0200
+++ new/tcolorpy-0.1.0/README.rst 2021-06-12 15:33:19.000000000 +0200
@@ -11,6 +11,10 @@
:target: https://badge.fury.io/py/tcolorpy
:alt: PyPI package version
+.. image:: https://anaconda.org/conda-forge/tcolorpy/badges/version.svg
+ :target: https://anaconda.org/conda-forge/tcolorpy
+ :alt: conda-forge package version
+
.. image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg
:target: https://pypi.org/project/tcolorpy
:alt: Supported Python versions
@@ -19,25 +23,30 @@
:target: https://pypi.org/project/tcolorpy
:alt: Supported Python implementations
-.. image::
https://img.shields.io/travis/thombashi/tcolorpy/master.svg?label=Linux/macOS%20CI
- :target: https://travis-ci.org/thombashi/tcolorpy
- :alt: Linux/macOS CI status
-
-.. image::
https://img.shields.io/appveyor/ci/thombashi/tcolorpy/master.svg?label=Windows%20CI
- :target: https://ci.appveyor.com/project/thombashi/tcolorpy/branch/master
- :alt: Windows CI status
-
-.. image::
https://codecov.io/gh/thombashi/tcolorpy/branch/master/graph/badge.svg
- :target: https://codecov.io/gh/thombashi/tcolorpy
- :alt: Test coverage: codecov
+.. image:: https://github.com/thombashi/tcolorpy/workflows/Tests/badge.svg
+ :target:
https://github.com/thombashi/tcolorpy/actions?query=workflow%3ATests
+ :alt: Linux/macOS/Windows CI status
+
+.. image::
https://coveralls.io/repos/github/thombashi/tcolorpy/badge.svg?branch=master
+ :target: https://coveralls.io/github/thombashi/tcolorpy?branch=master
+ :alt: Test coverage: coveralls
Installation
============================================
+
+Installation: pip
+------------------------------
::
pip install tcolorpy
+Installation: conda
+------------------------------
+::
+
+ conda install -c conda-forge tcolorpy
+
Usage
============================================
@@ -123,5 +132,5 @@
Dependencies
============================================
-Python 3.5+
+Python 3.6+
No external dependencies.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/pyproject.toml
new/tcolorpy-0.1.0/pyproject.toml
--- old/tcolorpy-0.0.8/pyproject.toml 2020-08-14 16:16:17.000000000 +0200
+++ new/tcolorpy-0.1.0/pyproject.toml 2021-06-12 15:33:19.000000000 +0200
@@ -1,3 +1,6 @@
+[build-system]
+requires = ["setuptools", "wheel"]
+
[tool.black]
line-length = 100
exclude = '''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/setup.py new/tcolorpy-0.1.0/setup.py
--- old/tcolorpy-0.0.8/setup.py 2020-08-14 16:16:17.000000000 +0200
+++ new/tcolorpy-0.1.0/setup.py 2021-06-12 15:33:19.000000000 +0200
@@ -5,10 +5,10 @@
MODULE_NAME = "tcolorpy"
-REPOSITORY_URL = "https://github.com/thombashi/{:s}".format(MODULE_NAME)
+REPOSITORY_URL = f"https://github.com/thombashi/{MODULE_NAME:s}"
REQUIREMENT_DIR = "requirements"
-pkg_info = {} # type: Dict[str, str]
+pkg_info: Dict[str, str] = {}
def get_release_command_class() -> Dict[str, setuptools.Command]:
@@ -43,20 +43,23 @@
long_description_content_type="text/x-rst",
packages=setuptools.find_packages(exclude=["test*"]),
package_data={MODULE_NAME: ["py.typed"]},
- project_urls={"Source": REPOSITORY_URL, "Tracker":
"{:s}/issues".format(REPOSITORY_URL),},
- python_requires=">=3.5",
+ project_urls={
+ "Source": REPOSITORY_URL,
+ "Tracker": f"{REPOSITORY_URL:s}/issues",
+ },
+ python_requires=">=3.6",
extras_require={"test": TESTS_REQUIRES},
classifiers=[
- "Development Status :: 3 - Alpha",
+ "Development Status :: 4 - Beta",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/tcolorpy/__main__.py
new/tcolorpy-0.1.0/tcolorpy/__main__.py
--- old/tcolorpy-0.0.8/tcolorpy/__main__.py 2020-08-14 16:16:17.000000000
+0200
+++ new/tcolorpy-0.1.0/tcolorpy/__main__.py 2021-06-12 15:33:19.000000000
+0200
@@ -33,7 +33,8 @@
),
)
parser.add_argument(
- "--encode", help="output a text encoded with the specified encoding",
+ "--encode",
+ help="output a text encoded with the specified encoding",
)
return parser.parse_args()
@@ -49,7 +50,7 @@
try:
ansi_string = tcolor(ns.string, color=ns.color, bg_color=ns.bg_color,
styles=styles)
except ValueError as e:
- print("{}: {}".format(e.__class__.__name__, e), file=sys.stderr)
+ print(f"{e.__class__.__name__}: {e}", file=sys.stderr)
return 1
if ns.encode:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/tcolorpy/__version__.py
new/tcolorpy-0.1.0/tcolorpy/__version__.py
--- old/tcolorpy-0.0.8/tcolorpy/__version__.py 2020-08-14 16:16:17.000000000
+0200
+++ new/tcolorpy-0.1.0/tcolorpy/__version__.py 2021-06-12 15:33:19.000000000
+0200
@@ -1,6 +1,6 @@
__author__ = "Tsuyoshi Hombashi"
-__copyright__ = "Copyright 2020, {}".format(__author__)
+__copyright__ = f"Copyright 2020, {__author__}"
__license__ = "MIT License"
-__version__ = "0.0.8"
+__version__ = "0.1.0"
__maintainer__ = __author__
__email__ = "[email protected]"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/tcolorpy/_truecolor.py
new/tcolorpy-0.1.0/tcolorpy/_truecolor.py
--- old/tcolorpy-0.0.8/tcolorpy/_truecolor.py 2020-08-14 16:16:17.000000000
+0200
+++ new/tcolorpy-0.1.0/tcolorpy/_truecolor.py 2021-06-12 15:33:19.000000000
+0200
@@ -1,4 +1,6 @@
import re
+from collections import namedtuple
+from colorsys import rgb_to_hsv
from enum import Enum
from typing import List, Optional, Sequence, Tuple, Type, Union, cast # noqa
@@ -7,6 +9,8 @@
RGBTuple = Tuple[int, int, int]
+HSV = namedtuple("HSV", "hue saturation value")
+
_regexp_color_code = re.compile(
"^#?(?P<red>[0-9a-f]{2})(?P<green>[0-9a-f]{2})(?P<blue>[0-9a-f]{2})$",
re.IGNORECASE
)
@@ -55,14 +59,16 @@
try:
# from a RGBTuple instance
self.red, self.green, self.blue = color # type: ignore
- self.__validate_color_value(self.red)
- self.__validate_color_value(self.green)
- self.__validate_color_value(self.blue)
+ self.__validate_rgb_value(self.red)
+ self.__validate_rgb_value(self.green)
+ self.__validate_rgb_value(self.blue)
except TypeError:
# from a Color instance
self.__name = color.name # type: ignore
self.red, self.green, self.blue = color.red, color.green,
color.blue # type: ignore
+ self.__hsv: Optional[HSV] = None
+
def __eq__(self, other) -> bool:
if self.name and other.name:
return self.name == other.name
@@ -78,19 +84,17 @@
return not self.__eq__(other)
def __repr__(self) -> str:
- items = [
- "code={}, rgb=({}, {}, {})".format(self.color_code, self.red,
self.green, self.blue)
- ]
+ items = [f"code={self.color_code}, rgb=({self.red}, {self.green},
{self.blue})"]
if self.__name:
- items.append("name={}".format(self.__name))
+ items.append(f"name={self.__name}")
return "Color({})".format(", ".join(items))
def __from_color_code(self, color_code: str) -> None:
match = _regexp_color_code.search(color_code)
if match is None:
- raise ValueError("invalid color code found: {}".format(color_code))
+ raise ValueError(f"invalid color code found: {color_code}")
self.__is_color_code_src = True
red, green, blue = match.group(1, 2, 3)
@@ -102,7 +106,7 @@
self.red, self.green, self.blue = name_to_rgb[name]
self.__name = name
- def __validate_color_value(self, n: int) -> None:
+ def __validate_rgb_value(self, n: int) -> None:
if not (0 <= n <= 255):
raise ValueError("value must be within 0-255")
@@ -116,7 +120,14 @@
@property
def color_code(self) -> str:
- return "#{:02x}{:02x}{:02x}".format(self.red, self.green, self.blue)
+ return f"#{self.red:02x}{self.green:02x}{self.blue:02x}"
+
+ @property
+ def hsv(self) -> HSV:
+ if self.__hsv is None:
+ self.__hsv = HSV(*rgb_to_hsv(self.red / 255, self.green / 255,
self.blue / 255))
+
+ return self.__hsv
def calc_scaler(self) -> int:
return self.red + self.green + self.blue
@@ -134,7 +145,7 @@
try:
return enum_class[_normalize_name(value)]
except AttributeError:
- raise TypeError("value must be a {} or a str:
actual={}".format(enum_class, type(value)))
+ raise TypeError(f"value must be a {enum_class} or a str:
actual={type(value)}")
except KeyError:
raise ValueError(
"invalid value found: expected={}, actual={}".format(
@@ -144,27 +155,27 @@
def _ansi_escape(value: str) -> str:
- return "{}{}m".format(CSI, value)
+ return f"{CSI}{value}m"
def _to_ansi_style(style: Union[str, AnsiStyle]) -> str:
- return _ansi_escape("{}".format(_normalize_enum(style, AnsiStyle).value))
+ return _ansi_escape(f"{_normalize_enum(style, AnsiStyle).value}")
def _to_ansi_fg_truecolor(color: Color) -> str:
- return _ansi_escape("38;2;{};{};{}".format(color.red, color.green,
color.blue))
+ return _ansi_escape(f"38;2;{color.red};{color.green};{color.blue}")
def _to_ansi_bg_truecolor(color: Color) -> str:
- return _ansi_escape("48;2;{};{};{}".format(color.red, color.green,
color.blue))
+ return _ansi_escape(f"48;2;{color.red};{color.green};{color.blue}")
def _to_ansi_fg_color(color: AnsiFGColor) -> str:
- return _ansi_escape("{}".format(color.value))
+ return _ansi_escape(f"{color.value}")
def _to_ansi_bg_color(color: AnsiBGColor) -> str:
- return _ansi_escape("{}".format(color.value))
+ return _ansi_escape(f"{color.value}")
def _make_ansi_fg_truecolor(color: Union[Color, str, RGBTuple, AnsiFGColor,
None]) -> str:
@@ -222,7 +233,7 @@
ansi_fg_color = _make_ansi_fg_truecolor(color)
ansi_bg_color = _make_ansi_bg_truecolor(bg_color)
- ansi_styles = [] # type: List[str]
+ ansi_styles: List[str] = []
if styles:
ansi_styles = [_to_ansi_style(style) for style in styles]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/tcolorpy.egg-info/PKG-INFO
new/tcolorpy-0.1.0/tcolorpy.egg-info/PKG-INFO
--- old/tcolorpy-0.0.8/tcolorpy.egg-info/PKG-INFO 2020-08-14
16:16:32.000000000 +0200
+++ new/tcolorpy-0.1.0/tcolorpy.egg-info/PKG-INFO 2021-06-12
15:33:34.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tcolorpy
-Version: 0.0.8
+Version: 0.1.0
Summary: tcolopy is a Python library to apply true color for terminal text.
Home-page: https://github.com/thombashi/tcolorpy
Author: Tsuyoshi Hombashi
@@ -8,146 +8,18 @@
License: MIT License
Project-URL: Source, https://github.com/thombashi/tcolorpy
Project-URL: Tracker, https://github.com/thombashi/tcolorpy/issues
-Description: .. contents:: **tcolorpy**
- :backlinks: top
- :depth: 2
-
-
- Summary
- ============================================
- tcolopy is a Python library to apply true color for terminal text.
-
- .. image:: https://badge.fury.io/py/tcolorpy.svg
- :target: https://badge.fury.io/py/tcolorpy
- :alt: PyPI package version
-
- .. image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg
- :target: https://pypi.org/project/tcolorpy
- :alt: Supported Python versions
-
- .. image:: https://img.shields.io/pypi/implementation/tcolorpy.svg
- :target: https://pypi.org/project/tcolorpy
- :alt: Supported Python implementations
-
- .. image::
https://img.shields.io/travis/thombashi/tcolorpy/master.svg?label=Linux/macOS%20CI
- :target: https://travis-ci.org/thombashi/tcolorpy
- :alt: Linux/macOS CI status
-
- .. image::
https://img.shields.io/appveyor/ci/thombashi/tcolorpy/master.svg?label=Windows%20CI
- :target:
https://ci.appveyor.com/project/thombashi/tcolorpy/branch/master
- :alt: Windows CI status
-
- .. image::
https://codecov.io/gh/thombashi/tcolorpy/branch/master/graph/badge.svg
- :target: https://codecov.io/gh/thombashi/tcolorpy
- :alt: Test coverage: codecov
-
-
- Installation
- ============================================
- ::
-
- pip install tcolorpy
-
-
- Usage
- ============================================
-
- Library usage
- --------------------------------------------
-
- :Sample Code:
- .. code-block:: python
-
- from tcolorpy import tcolor
-
- print(tcolor("tcolopy example", color="#ee1177",
styles=["bold", "italic", "underline"]))
-
- :Output:
- .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/oneline.png
- :scale: 60%
- :alt:
https://github.com/thombashi/tcolorpy/blob/master/ss/oneline.png
-
- You can set the following ``tcolor`` arguments:
-
- - ``color``/``bg_color``
- - color names (``"red"``, ``"red"``, etc.) or color code
(``"#RRGGBB"``)
- - ``styles``
- - ``"bold"``, ``"italic"``, etc.
-
-
- Other examples
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Apply true color and styles to text:
-
- .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/styles.png
- :scale: 60%
- :alt:
https://github.com/thombashi/tcolorpy/blob/master/ss/styles.png
-
- `tcolorpy/ansi_styles.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_styles.py>`__
-
- You can also specify colors by names:
-
- .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/ansi_colors.png
- :scale: 60%
- :alt:
https://github.com/thombashi/tcolorpy/blob/master/ss/ansi_colors.png
-
- `tcolorpy/ansi_colors.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_colors.py>`__
-
-
- CLI usage
- --------------------------------------------
- ``tcolorpy`` can be used via CLI:
-
- ::
-
- $ python -m tcolorpy "tcolopy example" -c "#ee1177" -s
bold,italic,underline
-
- Command help
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ::
-
- usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES]
[--encode ENCODE]
- string
-
- positional arguments:
- string string to apply styles.
-
- optional arguments:
- -h, --help show this help message and exit
- -c COLOR, --color COLOR
- specify a color code (#XXXXXX) or a name.
valid names
- are: black, red, green, yellow, blue,
magenta, cyan,
- white, lightblack, lightred, lightgreen,
lightyellow,
- lightblue, lightmagenta, lightcyan,
lightwhite
- -b BG_COLOR, --bg-color BG_COLOR
- specify a background color code (#XXXXXX)
or a name.
- valid names are: black, red, green,
yellow, blue,
- magenta, cyan, white, lightblack, lightred,
- lightgreen, lightyellow, lightblue,
lightmagenta,
- lightcyan, lightwhite
- -s STYLES, --styles STYLES
- specify a comma separated styles. valid
values are:
- bold, dim, italic, underline, blink,
invert, strike
- --encode ENCODE output a text encoded with the specified
encoding
-
-
- Dependencies
- ============================================
- Python 3.5+
- No external dependencies.
-
Keywords: ANSI escape,terminal color,truecolor
Platform: UNKNOWN
-Classifier: Development Status :: 3 - Alpha
+Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -155,6 +27,146 @@
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Terminals
Classifier: Topic :: Text Processing
-Requires-Python: >=3.5
+Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Provides-Extra: test
+License-File: LICENSE
+
+.. contents:: **tcolorpy**
+ :backlinks: top
+ :depth: 2
+
+
+Summary
+============================================
+tcolopy is a Python library to apply true color for terminal text.
+
+.. image:: https://badge.fury.io/py/tcolorpy.svg
+ :target: https://badge.fury.io/py/tcolorpy
+ :alt: PyPI package version
+
+.. image:: https://anaconda.org/conda-forge/tcolorpy/badges/version.svg
+ :target: https://anaconda.org/conda-forge/tcolorpy
+ :alt: conda-forge package version
+
+.. image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg
+ :target: https://pypi.org/project/tcolorpy
+ :alt: Supported Python versions
+
+.. image:: https://img.shields.io/pypi/implementation/tcolorpy.svg
+ :target: https://pypi.org/project/tcolorpy
+ :alt: Supported Python implementations
+
+.. image:: https://github.com/thombashi/tcolorpy/workflows/Tests/badge.svg
+ :target:
https://github.com/thombashi/tcolorpy/actions?query=workflow%3ATests
+ :alt: Linux/macOS/Windows CI status
+
+.. image::
https://coveralls.io/repos/github/thombashi/tcolorpy/badge.svg?branch=master
+ :target: https://coveralls.io/github/thombashi/tcolorpy?branch=master
+ :alt: Test coverage: coveralls
+
+
+Installation
+============================================
+
+Installation: pip
+------------------------------
+::
+
+ pip install tcolorpy
+
+Installation: conda
+------------------------------
+::
+
+ conda install -c conda-forge tcolorpy
+
+
+Usage
+============================================
+
+Library usage
+--------------------------------------------
+
+:Sample Code:
+ .. code-block:: python
+
+ from tcolorpy import tcolor
+
+ print(tcolor("tcolopy example", color="#ee1177", styles=["bold",
"italic", "underline"]))
+
+:Output:
+ .. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/oneline.png
+ :scale: 60%
+ :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/oneline.png
+
+You can set the following ``tcolor`` arguments:
+
+- ``color``/``bg_color``
+ - color names (``"red"``, ``"red"``, etc.) or color code (``"#RRGGBB"``)
+- ``styles``
+ - ``"bold"``, ``"italic"``, etc.
+
+
+Other examples
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Apply true color and styles to text:
+
+.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/styles.png
+ :scale: 60%
+ :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/styles.png
+
+ `tcolorpy/ansi_styles.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_styles.py>`__
+
+You can also specify colors by names:
+
+.. figure::
https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/ansi_colors.png
+ :scale: 60%
+ :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/ansi_colors.png
+
+ `tcolorpy/ansi_colors.py
<https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_colors.py>`__
+
+
+CLI usage
+--------------------------------------------
+``tcolorpy`` can be used via CLI:
+
+::
+
+ $ python -m tcolorpy "tcolopy example" -c "#ee1177" -s
bold,italic,underline
+
+Command help
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+::
+
+ usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES] [--encode
ENCODE]
+ string
+
+ positional arguments:
+ string string to apply styles.
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -c COLOR, --color COLOR
+ specify a color code (#XXXXXX) or a name. valid
names
+ are: black, red, green, yellow, blue, magenta,
cyan,
+ white, lightblack, lightred, lightgreen,
lightyellow,
+ lightblue, lightmagenta, lightcyan, lightwhite
+ -b BG_COLOR, --bg-color BG_COLOR
+ specify a background color code (#XXXXXX) or a
name.
+ valid names are: black, red, green, yellow, blue,
+ magenta, cyan, white, lightblack, lightred,
+ lightgreen, lightyellow, lightblue, lightmagenta,
+ lightcyan, lightwhite
+ -s STYLES, --styles STYLES
+ specify a comma separated styles. valid values are:
+ bold, dim, italic, underline, blink, invert, strike
+ --encode ENCODE output a text encoded with the specified encoding
+
+
+Dependencies
+============================================
+Python 3.6+
+No external dependencies.
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/tcolorpy.egg-info/SOURCES.txt
new/tcolorpy-0.1.0/tcolorpy.egg-info/SOURCES.txt
--- old/tcolorpy-0.0.8/tcolorpy.egg-info/SOURCES.txt 2020-08-14
16:16:32.000000000 +0200
+++ new/tcolorpy-0.1.0/tcolorpy.egg-info/SOURCES.txt 2021-06-12
15:33:34.000000000 +0200
@@ -18,6 +18,5 @@
tcolorpy.egg-info/not-zip-safe
tcolorpy.egg-info/requires.txt
tcolorpy.egg-info/top_level.txt
-test/__init__.py
test/test_color.py
test/test_truecolor.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/test/__init__.py
new/tcolorpy-0.1.0/test/__init__.py
--- old/tcolorpy-0.0.8/test/__init__.py 2020-08-14 16:16:17.000000000 +0200
+++ new/tcolorpy-0.1.0/test/__init__.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-# this file temporarily required to get coverage:
-# pytest-dev/pytest-cov#391
-# https://github.com/pytest-dev/pytest-cov/issues/391
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/test/test_truecolor.py
new/tcolorpy-0.1.0/test/test_truecolor.py
--- old/tcolorpy-0.0.8/test/test_truecolor.py 2020-08-14 16:16:17.000000000
+0200
+++ new/tcolorpy-0.1.0/test/test_truecolor.py 2021-06-12 15:33:19.000000000
+0200
@@ -30,7 +30,11 @@
assert tcolor(string, bg_color=color) != string
@pytest.mark.parametrize(
- ["value", "expected"], [["#fffff", ValueError], ["#GGGGGG",
ValueError],],
+ ["value", "expected"],
+ [
+ ["#fffff", ValueError],
+ ["#GGGGGG", ValueError],
+ ],
)
def test_exception(self, value, expected):
with pytest.raises(expected):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tcolorpy-0.0.8/tox.ini new/tcolorpy-0.1.0/tox.ini
--- old/tcolorpy-0.0.8/tox.ini 2020-08-14 16:16:17.000000000 +0200
+++ new/tcolorpy-0.1.0/tox.ini 2021-06-12 15:33:19.000000000 +0200
@@ -1,6 +1,6 @@
[tox]
envlist =
- py{35,36,37,38,39}
+ py{36,37,38,39,310}
pypy3
build
clean
@@ -15,7 +15,7 @@
pytest {posargs}
[testenv:build]
-basepython = python3.7
+basepython = python3.8
deps =
twine
wheel
@@ -25,21 +25,24 @@
python setup.py clean --all
[testenv:clean]
+skip_install = true
deps =
- cleanpy
+ cleanpy>=0.2
commands =
- cleanpy --all --exclude-envs .
+ cleanpy --force --all --exclude-envs .
[testenv:cov]
+passenv = *
deps =
.[test]
- coverage[toml]
- pytest-cov
+ coverage[toml]>=5
commands =
- pytest --cov {posargs:-vv}
+ coverage run -m pytest {posargs:-vv}
+ coverage report -m
[testenv:fmt]
-basepython = python3.7
+basepython = python3.8
+skip_install = true
deps =
autoflake
black
@@ -50,11 +53,12 @@
black setup.py test tcolorpy examples
[testenv:lint]
-basepython = python3.7
+basepython = python3.8
+skip_install = true
deps =
mypy>=0.761
pylama
commands =
python setup.py check
- -mypy tcolorpy setup.py --ignore-missing-imports --show-error-context
--show-error-codes --python-version 3.5
+ -mypy tcolorpy setup.py
-pylama