Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace of PyPDF2 package with pypdf #263

Merged
merged 6 commits into from
May 19, 2024
Merged

Replace of PyPDF2 package with pypdf #263

merged 6 commits into from
May 19, 2024

Conversation

douglatornell
Copy link
Member

@douglatornell douglatornell commented May 17, 2024

Resolve Jun-2023 security alert re: CVE-2023-36464 infinite loop vulnerability and deprecation of PyPDF2.

Also update test suite re:

Removed not informative "Set up and run the worker." line at the beginning.

re: issue #121
This commit introduces the use of `textwrap.dedent` to maintain the
configuration file's content in the tests for the surface current tiles worker
module. Using `textwrap.dedent` makes the inline configuration text more
manageable and readable by removing the initial indentations.
Test suite maintenance.

re: issue #81
@douglatornell douglatornell added Workers dependencies Pull requests that update a dependency file maintenance Codebase maintenance labels May 17, 2024
@douglatornell douglatornell added this to the v24.1 milestone May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 93.61702% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 77.76%. Comparing base (506a986) to head (58bb239).

Files Patch % Lines
nowcast/workers/make_surface_current_tiles.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
- Coverage   77.77%   77.76%   -0.01%     
==========================================
  Files         133      133              
  Lines       18822    18816       -6     
  Branches     1914     1910       -4     
==========================================
- Hits        14639    14633       -6     
  Misses       4116     4116              
  Partials       67       67              
Flag Coverage Δ
unittests 77.76% <93.61%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Replace unittest.mock.patch decorator with pytest caplog fixture for tests of
logging.

Test suite maintenance re: issue #82.
Updated the project dependencies and scripts to use the `pypdf` package instead
of `PyPDF2`. Also, adapted the code in `make_surface_current_tiles.py` to use
`pypdf`'s `PdfWriter` instead of `PyPDF2`'s `PdfFileMerger`.

This resolves the Jun-2023 security alert re: CVE-2023-36464 infinite loop
vulnerability and deprecation of PyPDF2.
@douglatornell
Copy link
Member Author

Tested successfully in production to manually reproduce 17may24 forecast tiles, and did 18may24 forecast2 tiles via automation.

@douglatornell douglatornell merged commit 4166cfa into main May 19, 2024
7 checks passed
@douglatornell douglatornell deleted the PyPDF2-to-pypdf branch May 19, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file maintenance Codebase maintenance Workers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant