]> Nutra Git (v2) - nutratech/cli.git/commitdiff
use --debug, no "-d". Update black. Changelog.
authorShane Jaroch <chown_tee@proton.me>
Thu, 14 Dec 2023 16:53:50 +0000 (11:53 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 14 Dec 2023 16:53:50 +0000 (11:53 -0500)
.github/workflows/install-linux.yml
.github/workflows/install-win32.yml
CHANGELOG.rst
ntclient/__main__.py
requirements-lint.txt
tests/test_cli.py

index d04e24a8d10f29b0adbc019320eaeddb2772dca2..eac988dea7a76fe6978c40a8ffb21619c3919cbb 100644 (file)
@@ -53,5 +53,5 @@ jobs:
       - name: Basic Tests / CLI / Integration
         run: |
           n --version
-          nutra -d recipe init -f
+          nutra --debug recipe init -f
           nutra --no-pager recipe
index 646b44d2bc2353f46afffe27cc4aca8323fd2bf8..c327b6d7c2c1dd327450f8b7d824b8a2a0e800e8 100644 (file)
@@ -44,7 +44,7 @@ jobs:
       - name: Basic Tests / CLI / Integration
         run: |
           n --version
-          nutra -d init -y
+          nutra --debug init -y
           nutra --no-pager nt
           nutra --no-pager sort -c 789
           nutra --no-pager search ultraviolet mushrooms
index 23c6b48395606a962fa44987cec398c237533daf..eae36500c5ef6b290c3e1a78c10be9a1964c920e 100644 (file)
@@ -12,6 +12,18 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
 [0.2.8] - Unreleased
 ########################################################################
 
+Added
+~~~~~
+
+- ``Nutrient`` class, and partially completed ``nnest`` nested list.
+- Print statement for average of 1-rep maxes (for 3 different formulas)
+- ``print_header()`` function inside of ``services/analyze.py``
+
+Removed
+~~~~~~~
+
+- ``-d`` and ``-v`` shortcuts for ``--debug`` and ``--version``
+
 
 
 [0.2.7] - 2023-03-27
index 2b3eda31f68b00066c0f0f9399b585efb4452234..99964c2e37c46c848f82d7dd3003e137cd5da6cc 100644 (file)
@@ -39,7 +39,7 @@ def build_arg_parser() -> argparse.ArgumentParser:
     )
 
     arg_parser.add_argument(
-        "-d", "--debug", action="store_true", help="enable detailed error messages"
+        "--debug", action="store_true", help="enable detailed error messages"
     )
     arg_parser.add_argument(
         "--no-pager", action="store_true", help="disable paging (print full output)"
@@ -113,7 +113,7 @@ def main(args: list = None) -> int:  # type: ignore
         if CLI_CONFIG.debug:
             raise
     except Exception as exception:  # pylint: disable=broad-except  # pragma: no cover
-        print("Unforeseen error, run with -d for more info: " + repr(exception))
+        print("Unforeseen error, run with --debug for more info: " + repr(exception))
         print("You can open an issue here: %s" % __url__)
         print("Or send me an email with the debug output: %s" % __email__)
         if CLI_CONFIG.debug:
index b18ed43d48624530f66c3b599499bf0d097b88bb..029d8116c4275e64f43ecb1ec7d98dd94245f36a 100644 (file)
@@ -1,5 +1,5 @@
 bandit==1.7.6
-black==23.11.0
+black==23.12.0
 doc8==1.1.1
 flake8==6.1.0
 mypy==1.7.1
index 42d8c7ea3b4b1a258ee87b20253384f8880b6d64..ab85c4c61779ae1cf9bd7ebc706a7a1c0ed84ebc 100644 (file)
@@ -91,7 +91,7 @@ class TestCli(unittest.TestCase):
 
     def test_300_argparser_debug_no_paging(self):
         """Verifies the debug and no_paging flags are set"""
-        args = arg_parser.parse_args(args=["-d", "--no-pager"])
+        args = arg_parser.parse_args(args=["--debug", "--no-pager"])
         CLI_CONFIG.set_flags(args)
 
         assert args.debug is True
@@ -247,7 +247,7 @@ class TestCli(unittest.TestCase):
         assert result["navy"] == 10.64
 
         # Invalid (failed Navy)
-        args = arg_parser.parse_args(args="-d calc bf -w 80 -n 40".split())
+        args = arg_parser.parse_args(args="--debug calc bf -w 80 -n 40".split())
         CLI_CONFIG.set_flags(args)
         code, result = args.func(args)
         assert code in {0, 1}  # Might be a failed code one day, but returns 0 for now
@@ -323,8 +323,8 @@ class TestCli(unittest.TestCase):
             nt_main(args=["-h"])
         assert system_exit.value.code == 0
 
-        # -d
-        code = nt_main(args=["-d"])
+        # --debug
+        code = nt_main(args=["--debug"])
         assert code == 0
 
         # __main__: if args_dict
@@ -342,7 +342,7 @@ class TestCli(unittest.TestCase):
         # TODO: replace with non-biometric test
         # from ntclient.services import biometrics
         #
-        # args = arg_parser.parse_args(args=["-d", "bio", "log", "add", "12,12"])
+        # args = arg_parser.parse_args(args=["--debug", "bio", "log", "add", "12,12"])
         # biometrics.input = (
         #     lambda x: "y"
         # )  # mocks input, could also pass `-y` flag or set yes=True
@@ -395,7 +395,7 @@ class TestCli(unittest.TestCase):
         )
 
         with pytest.raises(SqlInvalidVersionError) as sql_invalid_version_error:
-            nt_main(["-d", "nt"])
+            nt_main(["--debug", "nt"])
         assert sql_invalid_version_error is not None
 
     @unittest.skip(reason="Long-running test, want to replace with more 'unit' style")