From e239c97a85a67b20ad1b8960ec40eec644bf18fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 19:03:16 +0000 Subject: [PATCH 1/2] chore: Bump the development-dependencies group with 7 updates Bumps the development-dependencies group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [black](https://github.com/psf/black) | `24.4.2` | `24.8.0` | | [coverage](https://github.com/nedbat/coveragepy) | `7.5.4` | `7.6.1` | | [flake8](https://github.com/pycqa/flake8) | `7.1.0` | `7.1.1` | | [mypy](https://github.com/python/mypy) | `1.10.1` | `1.11.1` | | [tox](https://github.com/tox-dev/tox) | `4.16.0` | `4.18.0` | | [types-jsonschema](https://github.com/python/typeshed) | `4.22.0.20240610` | `4.23.0.20240813` | | [types-pyopenssl](https://github.com/python/typeshed) | `24.1.0.20240425` | `24.1.0.20240722` | Updates `black` from 24.4.2 to 24.8.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.4.2...24.8.0) Updates `coverage` from 7.5.4 to 7.6.1 - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/7.5.4...7.6.1) Updates `flake8` from 7.1.0 to 7.1.1 - [Commits](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1) Updates `mypy` from 1.10.1 to 1.11.1 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.10.1...v1.11.1) Updates `tox` from 4.16.0 to 4.18.0 - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.16.0...4.18.0) Updates `types-jsonschema` from 4.22.0.20240610 to 4.23.0.20240813 - [Commits](https://github.com/python/typeshed/commits) Updates `types-pyopenssl` from 24.1.0.20240425 to 24.1.0.20240722 - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: development-dependencies - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: types-jsonschema dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: types-pyopenssl dependency-type: direct:development update-type: version-update:semver-patch dependency-group: development-dependencies ... Signed-off-by: dependabot[bot] --- requirements-dev.in | 14 +++++++------- requirements-dev.txt | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) 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 From da84feb45852860f549bb982d8f5371e3f5dffa3 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Fri, 23 Aug 2024 15:07:06 -0400 Subject: [PATCH 2/2] chore: Reformat source code using 'Black' --- src/scripts/clean_dte_xml_file.py | 20 ++++++++------------ src/scripts/example.py | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) 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: