diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a61e4926..4c7d9439 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -46,7 +46,7 @@ jobs: make html - name: Check code style run: | - flake8 *.py parsedmarc/*.py + ruff check *.py parsedmarc/*.py - name: Run unit tests run: | coverage run tests.py diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index bb99ce1b..6200ed12 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -587,11 +587,12 @@ def parse_aggregate_report_xml( def extract_report(content): """ - Extracts text from a zip or gzip file, as a base64-encoded string, file-like object, - or bytes. + Extracts text from a zip or gzip file, as a base64-encoded string, + file-like object, or bytes. Args: - content: report file as a base64-encoded string, file-like object or bytes. + content: report file as a base64-encoded string, file-like object or + bytes. Returns: str: The extracted text @@ -639,6 +640,7 @@ def extract_report(content): return report + def extract_report_from_file_path(file_path): """Extracts report from a file at the given file_path""" try: diff --git a/requirements.txt b/requirements.txt index c58170b2..7483b230 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ mailsuite>=1.6.1 pygelf nose>=1.3.7 wheel>=0.37.0 -flake8>=3.7.8 +ruff jinja2>=2.10.1 packaging>=19.1 imagesize>=1.1.0