From a54e7720b402e8228dd3190a0a903290777845c8 Mon Sep 17 00:00:00 2001 From: Serge Koudoro Date: Mon, 8 Jan 2024 23:05:45 -0500 Subject: [PATCH] simplify installation --- .github/workflows/test.yml | 4 +++- gapps/cardservice/utilities.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83bdecd..8af3a5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,10 +24,12 @@ jobs: - name: Install the package and its dependencies run: | python -m pip install --upgrade pip - pip install ".[test]" + pip install . - name: Lint run: | + pip install flake8 flake8 . - name: Test run: | + pip install pytest cd && mkdir for_test && cd for_test && pytest -svv --pyargs gapps --durations=0 \ No newline at end of file diff --git a/gapps/cardservice/utilities.py b/gapps/cardservice/utilities.py index 8fc6f9b..03b8a70 100644 --- a/gapps/cardservice/utilities.py +++ b/gapps/cardservice/utilities.py @@ -129,7 +129,9 @@ def floats2hex(rgb): """Takes an RGB tuple or list and returns a hex RGB string.""" if not rgb or not isinstance(rgb, (tuple, list)): return None - return f'#{int(rgb[0]*255):02x}{int(rgb[1]*255):02x}{int(rgb[2]*255):02x}' + str_hex = f'#{int(rgb[0] * 255):02x}{int(rgb[1] * 255):02x}' + str_hex += f'{int(rgb[2] * 255):02x}' + return str_hex def get_form_value(form, key):