diff --git a/requirements-dev.in b/requirements-dev.in index 6adecb3f..3f3bb4db 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -4,16 +4,16 @@ -c requirements.txt -black==24.4.2 +black==24.8.0 bumpversion==0.5.3 -coverage==7.5.4 -flake8==7.1.0 +coverage==7.6.1 +flake8==7.1.1 isort==5.13.2 -mypy==1.10.1 +mypy==1.11.1 pip-tools==7.4.1 -tox==4.16.0 +tox==4.18.0 twine==5.1.1 -types-jsonschema==4.22.0.20240610 -types-pyOpenSSL==24.1.0.20240425 +types-jsonschema==4.23.0.20240813 +types-pyOpenSSL==24.1.0.20240722 types-pytz==2024.1.0.20240417 wheel==0.44.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 9f14d988..7971f92a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ attrs==23.2.0 # via # -c requirements.txt # referencing -black==24.4.2 +black==24.8.0 # via -r requirements-dev.in bleach==5.0.1 # via readme-renderer @@ -16,7 +16,7 @@ build==1.0.3 # via pip-tools bumpversion==0.5.3 # via -r requirements-dev.in -cachetools==5.3.3 +cachetools==5.5.0 # via tox certifi==2024.7.4 # via @@ -36,7 +36,7 @@ click==8.0.3 # pip-tools colorama==0.4.6 # via tox -coverage==7.5.4 +coverage==7.6.1 # via -r requirements-dev.in cryptography==42.0.8 # via @@ -51,7 +51,7 @@ filelock==3.15.4 # via # tox # virtualenv -flake8==7.1.0 +flake8==7.1.1 # via -r requirements-dev.in idna==3.7 # via requests @@ -74,7 +74,7 @@ mccabe==0.7.0 # via flake8 mdurl==0.1.2 # via markdown-it-py -mypy==1.10.1 +mypy==1.11.1 # via -r requirements-dev.in mypy-extensions==1.0.0 # via @@ -151,15 +151,15 @@ tomli==2.0.1 # pyproject-api # pyproject-hooks # tox -tox==4.16.0 +tox==4.18.0 # via -r requirements-dev.in twine==5.1.1 # via -r requirements-dev.in types-cffi==1.16.0.20240331 # via types-pyopenssl -types-jsonschema==4.22.0.20240610 +types-jsonschema==4.23.0.20240813 # via -r requirements-dev.in -types-pyopenssl==24.1.0.20240425 +types-pyopenssl==24.1.0.20240722 # via -r requirements-dev.in types-pytz==2024.1.0.20240417 # via -r requirements-dev.in diff --git a/src/scripts/clean_dte_xml_file.py b/src/scripts/clean_dte_xml_file.py index 3f846902..cb1f3ca9 100755 --- a/src/scripts/clean_dte_xml_file.py +++ b/src/scripts/clean_dte_xml_file.py @@ -62,17 +62,16 @@ def clean_dte_xml_file(input_file_path: str, output_file_path: str) -> Iterable[ # note: another way to compute the difference in a similar format is # `diff -Naur $input_file_path $output_file_path` file_bytes_diff_gen = difflib.diff_bytes( - dfunc=difflib.unified_diff, - a=file_bytes.splitlines(), - b=file_bytes_rewritten.splitlines()) + dfunc=difflib.unified_diff, a=file_bytes.splitlines(), b=file_bytes_rewritten.splitlines() + ) return file_bytes_diff_gen def main_single_file(input_file_path: str, output_file_path: str) -> None: file_bytes_diff_gen = clean_dte_xml_file( - input_file_path=input_file_path, - output_file_path=output_file_path) + input_file_path=input_file_path, output_file_path=output_file_path + ) for diff_line in file_bytes_diff_gen: print(diff_line) @@ -89,8 +88,8 @@ def main_dir_files(input_files_dir_path: str) -> None: print(f"\n\nWill clean file '{input_file_path}' and save it to '{output_file_path}'.") file_bytes_diff_gen = clean_dte_xml_file( - input_file_path=input_file_path, - output_file_path=output_file_path) + input_file_path=input_file_path, output_file_path=output_file_path + ) print("Difference between input and output files:") diff_line = None @@ -102,11 +101,8 @@ def main_dir_files(input_files_dir_path: str) -> None: if __name__ == '__main__': if sys.argv[1] == 'file': - main_single_file( - input_file_path=sys.argv[2], - output_file_path=sys.argv[3]) + main_single_file(input_file_path=sys.argv[2], output_file_path=sys.argv[3]) elif sys.argv[1] == 'dir': - main_dir_files( - input_files_dir_path=sys.argv[2]) + main_dir_files(input_files_dir_path=sys.argv[2]) else: raise ValueError(f"Invalid option: '{sys.argv[1]}'") diff --git a/src/scripts/example.py b/src/scripts/example.py index 8c4259af..5c88cf19 100755 --- a/src/scripts/example.py +++ b/src/scripts/example.py @@ -49,6 +49,7 @@ # script ############################################################################### + def main(args: Sequence[str]) -> None: start_ts = datetime.now() @@ -57,8 +58,7 @@ def main(args: Sequence[str]) -> None: try: print("Action: do something") except FileNotFoundError: - logger.exception( - "Process aborted: a file could not be opened.", exc_info=True) + logger.exception("Process aborted: a file could not be opened.", exc_info=True) except KeyboardInterrupt: logger.error("Process interrupted by user.") except Exception: