From d36fb6c3633b333346a411fe0540618555aa4307 Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Thu, 28 Dec 2023 11:19:32 +0100 Subject: [PATCH] Make flake8 happy --- .flake8 | 2 +- CHANGELOG.md | 5 +++-- Makefile | 2 +- config/common/__init__.py | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.flake8 b/.flake8 index 0f6f5a8..359f948 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -exclude = __pycache__,built,build,venv +exclude = __pycache__,built,build,venv,venv312,dist ignore = E203, E266, W503 max-line-length = 88 max-complexity = 18 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d11b42..41cf064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [2.0.4] - 2023-12-28 :snowman_with_snow: -- Improve the library to deep-merge dictionaries of values instead of replacing +- Improves the library to deep-merge dictionaries of values instead of replacing objects entirely (fix [#10](https://github.com/Neoteroi/essentials-configuration/issues/10)), by @StummeJ. -- Add Python 3.12 to the build matrix. +- Adds Python 3.12 to the build matrix, upgrades dev dependencies and fix tests + to support Python 3.12. ## [2.0.3] - 2023-04-15 :crown: - Adopts `Rich`, through `rich-click` for the project CLI. diff --git a/Makefile b/Makefile index 74be263..f3510fe 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ check-flake8: check-isort: @echo "$(BOLD)Checking isort$(RESET)" - @isort --check-only . 2>&1 + @isort --check-only config 2>&1 check-black: diff --git a/config/common/__init__.py b/config/common/__init__.py index a71fca5..7ce3bb3 100644 --- a/config/common/__init__.py +++ b/config/common/__init__.py @@ -49,7 +49,7 @@ def apply_key_value(obj: Mapping[str, Any], key: str, value: Any) -> Mapping[str sub_property, abc.MutableSequence ): raise ConfigurationOverrideError( - f"The key `{key}` cannot be used " + f"The key '{key}' cannot be used " f"because it overrides another " f"variable with shorter key! ({part}, {sub_property})" ) @@ -67,7 +67,7 @@ def apply_key_value(obj: Mapping[str, Any], key: str, value: Any) -> Mapping[str sub_property[index] = merger.merge(sub_property[index], value) except IndexError: raise ConfigurationOverrideError( - f"Invalid override for mutable sequence {key}; " + f"Invalid override for mutable sequence {key}, " f"assignment index out of range" ) else: @@ -81,7 +81,7 @@ def apply_key_value(obj: Mapping[str, Any], key: str, value: Any) -> Mapping[str sub_property[last_part] = value except TypeError as type_error: raise ConfigurationOverrideError( - f"Invalid assignment {key} -> {value}; {str(type_error)}" + f"Invalid assignment {key} -> {value}, {str(type_error)}" ) return obj