From e1f29dd5b655d00dbce242263e9b3be09570cb42 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 20 Mar 2023 16:47:55 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Make=20'Using=20...:test-github-?= =?UTF-8?q?actions=20red'=20message=20red?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wrapper/qurator/ocrd_galley/cli.py | 6 +++++- wrapper/requirements.txt | 2 ++ wrapper/setup.py | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 wrapper/requirements.txt diff --git a/wrapper/qurator/ocrd_galley/cli.py b/wrapper/qurator/ocrd_galley/cli.py index 199f614..8f3c8b9 100644 --- a/wrapper/qurator/ocrd_galley/cli.py +++ b/wrapper/qurator/ocrd_galley/cli.py @@ -1,7 +1,9 @@ import os import subprocess import sys +import colorama from pathlib import Path +from termcolor import colored DOCKER_IMAGE_PREFIX = os.environ.get("DOCKER_IMAGE_PREFIX", "quratorspk/ocrd-galley") @@ -56,6 +58,8 @@ sub_images = { def main(): + colorama.init() + argv = sys.argv.copy() argv[0] = os.path.basename(argv[0]) @@ -63,7 +67,7 @@ def main(): docker_image = "%s-%s:%s" % (DOCKER_IMAGE_PREFIX, sub_image, DOCKER_IMAGE_TAG) if DOCKER_IMAGE_TAG != "latest": - print(f"Using {docker_image}") + print(colored(f"Using {docker_image}", 'red')) docker_run(argv, docker_image) diff --git a/wrapper/requirements.txt b/wrapper/requirements.txt new file mode 100644 index 0000000..a994db4 --- /dev/null +++ b/wrapper/requirements.txt @@ -0,0 +1,2 @@ +colorama +termcolor diff --git a/wrapper/setup.py b/wrapper/setup.py index facee4c..558e080 100644 --- a/wrapper/setup.py +++ b/wrapper/setup.py @@ -4,6 +4,9 @@ from setuptools import find_packages, setup from qurator.ocrd_galley.cli import sub_images console_scripts = ["%s=qurator.ocrd_galley.cli:main" % command for command in sub_images.keys()] +with open("requirements.txt") as fp: + install_requires = fp.read() + setup( name="ocrd-galley", author="Mike Gerber, The QURATOR SPK Team", @@ -13,6 +16,7 @@ setup( license="Apache", packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), namespace_packages=["qurator"], + install_requires=install_requires, entry_points={ "console_scripts": console_scripts, },