From e2d3971f81db45dec57eb48d17c2992ce310ff49 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Sat, 24 Feb 2024 22:06:01 -0500 Subject: [PATCH] upgrade USDA/usda verion, and lint deps --- ntclient/__init__.py | 2 +- ntclient/ntsqlite | 2 +- ntclient/persistence/sql/__init__.py | 1 + ntclient/persistence/sql/nt/__init__.py | 1 + ntclient/persistence/sql/nt/funcs.py | 1 + ntclient/persistence/sql/usda/__init__.py | 8 +++----- ntclient/services/__init__.py | 1 + requirements-lint.txt | 8 ++++---- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ntclient/__init__.py b/ntclient/__init__.py index c70257b..ed052d1 100644 --- a/ntclient/__init__.py +++ b/ntclient/__init__.py @@ -25,7 +25,7 @@ __url__ = "https://github.com/nutratech/cli" # Sqlite target versions __db_target_nt__ = "0.0.6" -__db_target_usda__ = "0.0.8" +__db_target_usda__ = "0.0.9" USDA_XZ_SHA256 = "25dba8428ced42d646bec704981d3a95dc7943240254e884aad37d59eee9616a" # Global variables diff --git a/ntclient/ntsqlite b/ntclient/ntsqlite index c5c64d3..8590d59 160000 --- a/ntclient/ntsqlite +++ b/ntclient/ntsqlite @@ -1 +1 @@ -Subproject commit c5c64d3371a5f1e5c600989e79563c5827486224 +Subproject commit 8590d5958d8f1792709cfb7ac81cf9a1864c1890 diff --git a/ntclient/persistence/sql/__init__.py b/ntclient/persistence/sql/__init__.py index 944b0f8..20030d9 100644 --- a/ntclient/persistence/sql/__init__.py +++ b/ntclient/persistence/sql/__init__.py @@ -1,4 +1,5 @@ """Main SQL persistence module, shared between USDA and NT databases""" + import sqlite3 from collections.abc import Sequence diff --git a/ntclient/persistence/sql/nt/__init__.py b/ntclient/persistence/sql/nt/__init__.py index 58c9a05..9bb069d 100644 --- a/ntclient/persistence/sql/nt/__init__.py +++ b/ntclient/persistence/sql/nt/__init__.py @@ -1,4 +1,5 @@ """Nutratracker DB specific sqlite module""" + import os import sqlite3 from collections.abc import Sequence diff --git a/ntclient/persistence/sql/nt/funcs.py b/ntclient/persistence/sql/nt/funcs.py index af8a143..06d2dff 100644 --- a/ntclient/persistence/sql/nt/funcs.py +++ b/ntclient/persistence/sql/nt/funcs.py @@ -1,4 +1,5 @@ """nt.sqlite3 functions module""" + from ntclient.persistence.sql.nt import sql diff --git a/ntclient/persistence/sql/usda/__init__.py b/ntclient/persistence/sql/usda/__init__.py index f63fd2b..cff5c99 100644 --- a/ntclient/persistence/sql/usda/__init__.py +++ b/ntclient/persistence/sql/usda/__init__.py @@ -1,4 +1,5 @@ """USDA DB specific sqlite module""" + import os import sqlite3 import tarfile @@ -39,11 +40,8 @@ def usda_init(yes: bool = False) -> None: # TODO: handle resource moved on Bitbucket, # or version mismatch due to developer mistake / overwrite? # And seed mirrors; don't hard code one host here! - url = ( - "https://bitbucket.org/dasheenster/nutra-utils/downloads/{0}-{1}.tar.xz".format( - USDA_DB_NAME, __db_target_usda__ - ) - ) + url = "https://github.com/nutratech/usda-sqlite/releases" + "/download/{1}/{0}-{1}.tar.xz".format(USDA_DB_NAME, __db_target_usda__) if USDA_DB_NAME not in os.listdir(NUTRA_HOME): print("INFO: usda.sqlite3 doesn't exist, is this a fresh install?") diff --git a/ntclient/services/__init__.py b/ntclient/services/__init__.py index b540aaf..5d45d26 100644 --- a/ntclient/services/__init__.py +++ b/ntclient/services/__init__.py @@ -1,4 +1,5 @@ """Services module, currently only home to SQL/persistence init method""" + import os from ntclient import NUTRA_HOME diff --git a/requirements-lint.txt b/requirements-lint.txt index caab8eb..c6c466f 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -3,9 +3,9 @@ black==24.2.0 doc8==1.1.1 flake8==7.0.0 mypy==1.8.0 -pylint==3.0.3 +pylint==3.0.4 types-colorama==0.4.15.20240205 -types-psycopg2==2.9.21.20240201 -types-requests==2.31.0.20240125 -types-setuptools==69.0.0.20240125 +types-psycopg2==2.9.21.20240218 +types-requests==2.31.0.20240218 +types-setuptools==69.1.0.20240223 types-tabulate==0.9.0.20240106 -- 2.52.0