Merged
Conversation
Most importantly, the means Python 2.7 no longer needs to get supported
* All of them are removed from the package distributions * Scripts is additionally moved to the cpdf project * Sample_Code is moved to the docs
PdfFileReader and PdfFileMerger no longer have the `overwriteWarnings`. The new behavior is `overwriteWarnings=False`. Additionally, PyPDF2.utils.formatWarning was removed
It's expected that this is a more sensible default for most users.
As support for Python 3.5 and lower was dropped, we can use more modern syntax
This includes adding a type m
Codecov Report
@@ Coverage Diff @@
## main #859 +/- ##
==========================================
- Coverage 82.47% 79.96% -2.52%
==========================================
Files 16 16
Lines 3777 4187 +410
Branches 802 813 +11
==========================================
+ Hits 3115 3348 +233
- Misses 495 664 +169
- Partials 167 175 +8
Continue to review full report at Codecov.
|
In case of invalid extract stream data looking for endstream Closes #301
This PR uses 4 ways to disable checks by mypy: * 74x `typing.cast`: Has no effect on the running code, just on mypy * 161x `typing.Any`: If we tell mypy that a parameter / variable can have any possible type, mypy cannot check anything. * 82x `# type: ignore` * 36x `assert foo is not None`: This can have an effect in running code and should only be used if mypy fails to understand that foo is guaranteed not to be None Those are especially necessary for `.getObject()` calls. If possible, they should be removed. `cast` is preferrable over `# type: ignore` as it gives more information. `assert` should only be used in rare cases. Uncertainties: * `ByteStringObject` vs `TextStringObject`, e.g. for `_authenticateUserPassword` and the functions in `_security` * `ContentStream`: I have no clue what type the stream argument should have Details: * utils.ConvertFunctionsToVirtualList -> _VirtualList * Typeguard was used to verify that the annotated types are correct. There are still some cases where Typeguard fails, but the reason might be that Typeguard does not consider inheritance. * BUG: Potential None attribute access in _reader.getDestinationPageNumber * BUG: _security._alg33_1 : Adding str and bytes argument * STY: Fix typo 'test_get_destination_age_number' * BUG: Field.additionalActions was missing a return statement
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
See #863 Co-authored-by: Martin Thoma <info@martin-thoma.de>
This is important for some PyPDF2 developers development workflows. It allows them to compare changes more easily. Additionally, some imports were moved from function-level to module-level. See #865 (comment) Co-authored-by: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com>
This allows us to have a simpler user interface for page transformations
Add stacklevel=2 to deprecation warnings
This is `git merge main -s ours`
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR should probably be merged with a merge-commit, not a squashing commit.
The PR shows the current progress towards the 2.0.0 release. There are individual PRs going into the
dev-2.0.0branch, e.g. #854