From 75b9175d81750b3c9c5798375c4a351dd8acd33f Mon Sep 17 00:00:00 2001 From: Github-actions Date: Tue, 5 Dec 2023 14:03:05 +0000 Subject: [PATCH] Automatic linting --- wger/__init__.py | 1 + wger/nutrition/management/commands/import-off-products.py | 7 ++++--- wger/nutrition/models/ingredient.py | 1 + wger/nutrition/off.py | 7 ++++++- wger/nutrition/tests/test_off.py | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/wger/__init__.py b/wger/__init__.py index bd6b7bab1..54dfffc4a 100644 --- a/wger/__init__.py +++ b/wger/__init__.py @@ -7,6 +7,7 @@ # Local from .celery_configuration import app + MIN_APP_VERSION = (1, 6, 0, 'final', 1) VERSION = (2, 2, 0, 'alpha', 4) diff --git a/wger/nutrition/management/commands/import-off-products.py b/wger/nutrition/management/commands/import-off-products.py index e9475d37b..6d82b8a1c 100644 --- a/wger/nutrition/management/commands/import-off-products.py +++ b/wger/nutrition/management/commands/import-off-products.py @@ -25,6 +25,7 @@ from wger.nutrition.models import Ingredient from wger.nutrition.off import extract_info_from_off + logger = logging.getLogger(__name__) @@ -56,8 +57,8 @@ def add_arguments(self, parser): dest='mode', type=str, help='Script mode, "insert" or "update". Insert will insert the ingredients as new ' - 'entries in the database, while update will try to update them if they are ' - 'already present. Deault: insert' + 'entries in the database, while update will try to update them if they are ' + 'already present. Deault: insert' ) parser.add_argument( '--completeness', @@ -66,7 +67,7 @@ def add_arguments(self, parser): dest='completeness', type=float, help='Completeness threshold for importing the products. Products in OFF have ' - 'completeness score that ranges from 0 to 1.1. Default: 0.7' + 'completeness score that ranges from 0 to 1.1. Default: 0.7' ) def handle(self, **options): diff --git a/wger/nutrition/models/ingredient.py b/wger/nutrition/models/ingredient.py index c84523b14..55554a7ab 100644 --- a/wger/nutrition/models/ingredient.py +++ b/wger/nutrition/models/ingredient.py @@ -65,6 +65,7 @@ # Local from .ingredient_category import IngredientCategory + logger = logging.getLogger(__name__) diff --git a/wger/nutrition/off.py b/wger/nutrition/off.py index df713f974..2654432d0 100644 --- a/wger/nutrition/off.py +++ b/wger/nutrition/off.py @@ -13,7 +13,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from dataclasses import dataclass, asdict +# Standard Library +from dataclasses import ( + asdict, + dataclass, +) from typing import Optional # wger @@ -22,6 +26,7 @@ from wger.utils.constants import ODBL_LICENSE_ID from wger.utils.models import AbstractSubmissionModel + OFF_REQUIRED_TOP_LEVEL = [ 'product_name', 'code', diff --git a/wger/nutrition/tests/test_off.py b/wger/nutrition/tests/test_off.py index 314511724..fcb49e496 100644 --- a/wger/nutrition/tests/test_off.py +++ b/wger/nutrition/tests/test_off.py @@ -18,8 +18,8 @@ # wger from wger.nutrition.off import ( + IngredientData, extract_info_from_off, - IngredientData ) from wger.utils.constants import ODBL_LICENSE_ID from wger.utils.models import AbstractSubmissionModel