-
Notifications
You must be signed in to change notification settings - Fork 2
Dev #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Dev #21
Changes from all commits
95fffc1
b0617b1
7d1e574
65256a8
54cdf41
857117c
409727a
609e4fb
8e95c7a
55edab7
c8c5325
1645028
718828b
63aa605
79f6c20
2291636
3b50045
3e474bf
5bde08a
e9980c3
0f83b94
f3b387d
c11dfe8
17ef561
0acffe5
598def4
e5e4af2
7be43ba
ee248a3
4e36797
458ffc7
1b9dca7
9569a7c
eedf676
cbf44f4
d96f506
f35f9e0
e2d3971
3238f1a
154eee2
0056084
59449cf
d2d2910
d6a1f51
c4c7c99
887fc96
82f38ff
a7b1f79
1bf5de3
addedc7
9d40a82
6e17fbc
95cf615
e2b9231
232a661
ca39f4f
a50f994
7907280
4012ca7
e2827eb
407579e
1e28606
c0c85b4
db4e73c
c441f41
9bd53c1
97b4fbd
194f66c
af5c117
fd8566c
221a0f8
c834646
91dda08
08a1589
829f429
f9c8d26
606fa57
8e25067
a979992
9f767f4
f0530ed
32c570e
f2986c6
e6f2c4f
5e18f70
b08bef4
c74f17b
0f8b8ad
b865898
f2c14ea
10ccfcb
8cd798d
3e8934d
8b0b7be
6cc5239
efe4dcf
3b75bcc
79587ab
bb13ac9
cf9f320
a46d0b9
784cb8a
3674b24
cacb3d2
608c202
6e06d4b
c5a2a43
b414773
dc58727
7829622
ec3736e
eeb1936
f015ba5
cf132e7
f6ce625
dec9c95
9434e75
f69e8d2
0bec4b6
a7ed90d
885ad74
2765dc0
39b511c
861ec5c
0d009c1
ef62648
7b57e98
9a8c11f
20e8cab
448ca88
8731251
98075c0
ddc2d1f
248f143
7799a21
5586f45
2a853b7
1cb6c76
f32249f
26560e1
cd7b0d2
2f880b0
7e499ac
c3c457b
f6c50cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .venv | ||
| .pytest_cache | ||
| __pycache__ | ||
| *.sql | ||
| *.db | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,18 +17,18 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P0: Python 3.4 is not supported by actions/setup-python@v5. Python 3.4 reached EOL in 2019, and setup-python's minimum supported version is Python 3.5+. This workflow will fail when attempting to set up Python 3.4. Consider either keeping actions/setup-python@v4 (though support is not guaranteed) or updating the Python version to 3.5 or later. Prompt for AI agents |
||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| # update-environment: false | ||
|
|
||
| - name: Reload Cache / pip | ||
| uses: actions/cache@v3 | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~\AppData\Local\pip\Cache | ||
| # NOTE: only cares about base requirements.txt | ||
|
|
@@ -43,8 +43,8 @@ jobs: | |
|
|
||
| - name: Basic Tests / CLI / Integration | ||
| run: | | ||
| n -v | ||
| nutra -d init -y | ||
| n --version | ||
| nutra --debug init -y | ||
| nutra --no-pager nt | ||
| nutra --no-pager sort -c 789 | ||
| nutra --no-pager search ultraviolet mushrooms | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [MASTER] | ||
|
|
||
| fail-under=9.93 | ||
| fail-under=9.95 | ||
|
|
||
|
|
||
| [MESSAGES CONTROL] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,38 +16,53 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| # Package info | ||||||||||||||||||
| __title__ = "nutra" | ||||||||||||||||||
| __version__ = "0.2.7" | ||||||||||||||||||
| __version__ = "0.2.8.dev2" | ||||||||||||||||||
| __author__ = "Shane Jaroch" | ||||||||||||||||||
| __email__ = "chown_tee@proton.me" | ||||||||||||||||||
| __license__ = "GPL v3" | ||||||||||||||||||
| __copyright__ = "Copyright 2018-2022 Shane Jaroch" | ||||||||||||||||||
| __url__ = "https://github.com/nutratech/cli" | ||||||||||||||||||
|
|
||||||||||||||||||
| # Sqlite target versions | ||||||||||||||||||
| __db_target_nt__ = "0.0.6" | ||||||||||||||||||
| __db_target_usda__ = "0.0.8" | ||||||||||||||||||
| # TODO: should this be via versions.csv file? Don't update in two places? | ||||||||||||||||||
| __db_target_nt__ = "0.0.7" | ||||||||||||||||||
| __db_target_usda__ = "0.0.10" | ||||||||||||||||||
| USDA_XZ_SHA256 = "25dba8428ced42d646bec704981d3a95dc7943240254e884aad37d59eee9616a" | ||||||||||||||||||
|
|
||||||||||||||||||
| # Global variables | ||||||||||||||||||
| PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) | ||||||||||||||||||
| NUTRA_HOME = os.getenv("NUTRA_HOME", os.path.join(os.path.expanduser("~"), ".nutra")) | ||||||||||||||||||
| USDA_DB_NAME = "usda.sqlite" | ||||||||||||||||||
| NUTRA_HOME = os.getenv( | ||||||||||||||||||
| "NUTRA_HOME", | ||||||||||||||||||
| os.getenv("NUTRA_DIR", os.path.join(os.path.expanduser("~"), ".nutra")), | ||||||||||||||||||
| ) | ||||||||||||||||||
| USDA_DB_NAME = "usda.sqlite3" | ||||||||||||||||||
| # NOTE: NT_DB_NAME = "nt.sqlite3" is defined in ntclient.ntsqlite.sql | ||||||||||||||||||
|
|
||||||||||||||||||
| NTSQLITE_BUILDPATH = os.path.join(PROJECT_ROOT, "ntsqlite", "sql", NT_DB_NAME) | ||||||||||||||||||
| NTSQLITE_DESTINATION = os.path.join(NUTRA_HOME, NT_DB_NAME) | ||||||||||||||||||
|
|
||||||||||||||||||
| # Check Python version | ||||||||||||||||||
|
|
||||||||||||||||||
| def version_check() -> None: | ||||||||||||||||||
| """Check Python version""" | ||||||||||||||||||
| # pylint: disable=global-statement | ||||||||||||||||||
| global PY_SYS_VER, PY_SYS_STR | ||||||||||||||||||
| PY_SYS_VER = sys.version_info[0:3] | ||||||||||||||||||
| PY_SYS_STR = ".".join(str(x) for x in PY_SYS_VER) | ||||||||||||||||||
|
|
||||||||||||||||||
| if PY_SYS_VER < PY_MIN_VER: | ||||||||||||||||||
| # TODO: make this testable with: `class CliConfig`? | ||||||||||||||||||
| raise RuntimeError( | ||||||||||||||||||
| "ERROR: %s requires Python %s or later to run" % (__title__, PY_MIN_STR), | ||||||||||||||||||
| "HINT: You're running Python %s" % PY_SYS_STR, | ||||||||||||||||||
| ) | ||||||||||||||||||
|
Comment on lines
+54
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: RuntimeError is raised with two separate arguments, which will be displayed as a tuple instead of properly formatted error messages. Combine them into a single string with a newline separator. Prompt for AI agents
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| PY_MIN_VER = (3, 4, 3) | ||||||||||||||||||
| PY_SYS_VER = sys.version_info[0:3] | ||||||||||||||||||
| PY_MIN_STR = ".".join(str(x) for x in PY_MIN_VER) | ||||||||||||||||||
| PY_SYS_STR = ".".join(str(x) for x in PY_SYS_VER) | ||||||||||||||||||
| if PY_SYS_VER < PY_MIN_VER: | ||||||||||||||||||
| # TODO: make this testable with: `class CliConfig`? | ||||||||||||||||||
| raise RuntimeError( # pragma: no cover | ||||||||||||||||||
| "ERROR: %s requires Python %s or later to run" % (__title__, PY_MIN_STR), | ||||||||||||||||||
| "HINT: You're running Python %s" % PY_SYS_STR, | ||||||||||||||||||
| ) | ||||||||||||||||||
| # Run the check | ||||||||||||||||||
| version_check() | ||||||||||||||||||
|
|
||||||||||||||||||
| # Console size, don't print more than it | ||||||||||||||||||
| BUFFER_WD = shutil.get_terminal_size()[0] | ||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Python 3.5 is incompatible with actions/setup-python@v5 and will cause workflow failures due to SSL certificate verification errors. Python 3.5 reached EOL in 2020. Consider using supported Python versions like 3.8, 3.9, 3.10, 3.11, or 3.12 instead.
Prompt for AI agents