test old requirement versions, tidy workflows (#11)
authorShane Jaroch <chown_tee@proton.me>
Wed, 20 Jul 2022 20:28:48 +0000 (16:28 -0400)
committerGitHub <noreply@github.com>
Wed, 20 Jul 2022 20:28:48 +0000 (16:28 -0400)
.github/workflows/coveralls.yml
.github/workflows/test-linux.yml
.github/workflows/test-win32.yml
README.rst
ntclient/__init__.py
ntclient/services/analyze.py
ntclient/utils/__init__.py
requirements.txt

index b33b19664a40fa5ecc43a55f4942b14b1a4398c0..10deae0b436a9628af2c9c0e804c2fbcf9db85b9 100644 (file)
@@ -23,10 +23,8 @@ jobs:
             ${{ runner.os }}-pip-
 
       - name: Install requirements
-        # NOTE: container lacks OS dist for testresources/launchpadlib
         run: |
           pip install coveralls==3.3.1
-          pip install testresources==2.0.1
           pip install -r requirements.txt
           pip install -r requirements-test.txt
 
index 7c970d58ab5ec248d7b9961d0187d202d2efcb8f..7018608d1ae3d533a90b56899bcae6cd23f0004b 100644 (file)
@@ -27,15 +27,9 @@ jobs:
         uses: actions/cache@v3
         with:
           path: ~/.cache/pip
-          key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements*.txt') }}
+          key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements*.txt') }}
           restore-keys: |
-            ${{ runner.os }}-pip-
-
-      # NOTE: These are the last supported versions on Python 3.4
-      - name: Install requirements (Python 3.4)
-        if: matrix.python-version == '3.4.10'
-        run: |
-          pip install colorama==0.4.1
+            ${{ runner.os }}-${{ matrix.python-version }}-pip-
 
       - name: Install CLI
         env:
index 575abddbf24cadcd58fb1bbd04891b781ad65da5..0e5003095db603bf9385bfb5d49694194b5cdb44 100644 (file)
@@ -1,5 +1,6 @@
 ---
 name: test-win32
+
 "on":
   push: {}
 
index cca93f9b3a5da1b378c17250a6e11ddd578a2e24..1615c2f2de0d8f706692753dc879828aba643f48 100644 (file)
@@ -167,7 +167,7 @@ I've run the command to seed the autocomplete script.
 .. code-block:: bash
 
   mkdir -p $HOME/.bash_completion.d
-  activate-global-python-argcomplete --dest=$HOME/.bash_completion.d
+  activate-global-python-argcomplete --user
 
 And my ``~/.bashrc`` file looks like this.
 
index 485ab424493cc8a98b32663b8726b1825a12fb71..30d9e38dd3adb8ebd2bb57b589820f690995ca22 100755 (executable)
@@ -35,7 +35,7 @@ from ntclient.ntsqlite.sql import NT_DB_NAME
 
 # Package info
 __title__ = "nutra"
-__version__ = "0.2.5.dev0"
+__version__ = "0.2.5.dev1"
 __author__ = "Shane Jaroch"
 __email__ = "chown_tee@proton.me"
 __license__ = "GPL v3"
index 5ccc979cfb5ca46f284ca84ad76aa5c3c3af70db..35c3b1ba520435ded78f0e13b3390dcf1b1f1187 100755 (executable)
@@ -71,8 +71,8 @@ def foods_analyze(food_ids: set, grams: int = 0) -> tuple:
     ################################################################################
     servings_rows = []
     nutrients_rows = []
-    for food_id in analyses:
-        food_name = food_des[food_id][2]
+    for food_id, food_des_tuple in analyses.items():
+        food_name = food_des_tuple[2]
         print(
             "\n======================================\n"
             + "==> {0} ({1})\n".format(food_name, food_id)
@@ -105,7 +105,7 @@ def foods_analyze(food_ids: set, grams: int = 0) -> tuple:
         ################################################################################
         headers = ["id", "nutrient", "rda", "amount", "units"]
         nutrient_rows = []
-        for nutrient_id, amount in analyses[food_id]:
+        for nutrient_id, amount in food_des_tuple:
             # Skip zero values
             if not amount:
                 continue
index db8f3aaac5b17069608b002705f069ae39286e32..12c579705fe88b71a3f907824ce806305858f4df 100644 (file)
@@ -1,5 +1,5 @@
 """Constants and default settings"""
-from colorama import Fore
+from colorama import Fore, Style
 
 ################################################################################
 # Colors and buffer settings
@@ -14,9 +14,9 @@ THRESH_CRIT = 0.4
 COLOR_CRIT = Fore.RED
 
 THRESH_OVER = 1.9
-COLOR_OVER = Fore.MAGENTA  # Fore.LIGHTMAGENTA_EX, Fore.LIGHTBLACK_EX
+COLOR_OVER = Style.DIM + Fore.MAGENTA
 
-COLOR_DEFAULT = Fore.LIGHTCYAN_EX  # Fore.BLUE, Fore.LIGHTBLUE_EX
+COLOR_DEFAULT = Style.BRIGHT + Fore.CYAN
 
 ################################################################################
 # Nutrient IDs
index 4bf2690ae68b2b9625003f8f6bbfc4daf5b2ea01..575e698d3a6342f46f49739dd94adb4cd6927afa 100644 (file)
@@ -1,4 +1,4 @@
-argcomplete>=1.12.3
-colorama>=0.4.1
-fuzzywuzzy==0.18.0
-tabulate>=0.8.9
+argcomplete<=1.12.3,>=1.8.0
+colorama<=0.4.1,>=0.1.16
+fuzzywuzzy<=0.18.0,>=0.3.0
+tabulate<=0.8.9,>=0.4.3