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

PyPDF2 2.0 Changes #859

Merged
merged 20 commits into from May 24, 2022
Merged

PyPDF2 2.0 Changes #859

merged 20 commits into from May 24, 2022

Commits on May 2, 2022

  1. DEP: Drop pre-Python 3.6 support (#842)

    Most importantly, the means Python 2.7 no longer needs to get supported
    MartinThoma committed May 2, 2022
    Configuration menu
    Copy the full SHA
    304d9ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4b069dd View commit details
    Browse the repository at this point in the history
  3. DEP: Remove Scripts, Resources, Tests, Sample_Code (#845)

    * All of them are removed from the package distributions
    * Scripts is additionally moved to the cpdf project
    * Sample_Code is moved to the docs
    MartinThoma committed May 2, 2022
    Configuration menu
    Copy the full SHA
    835b717 View commit details
    Browse the repository at this point in the history
  4. DEP: overwriteWarnings parameter of reader/merger (#846)

    PdfFileReader and PdfFileMerger no longer have the `overwriteWarnings`.
    The new behavior is `overwriteWarnings=False`.
    
    Additionally, PyPDF2.utils.formatWarning was removed
    MartinThoma committed May 2, 2022
    Configuration menu
    Copy the full SHA
    e083526 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    64f91ee View commit details
    Browse the repository at this point in the history
  6. Change default to strict=False in PdfFileReader/PdfFileMerger (#848)

    It's expected that this is a more sensible default for most users.
    MartinThoma committed May 2, 2022
    Configuration menu
    Copy the full SHA
    3c15f61 View commit details
    Browse the repository at this point in the history
  7. MAINT: Use Python 3.6 language features (#849)

    As support for Python 3.5 and lower was dropped, we can use more modern syntax
    MartinThoma committed May 2, 2022
    Configuration menu
    Copy the full SHA
    f06375e View commit details
    Browse the repository at this point in the history
  8. MAINT: Add initial type support with mypy (#853)

    This includes adding a type m
    MartinThoma committed May 2, 2022
    Configuration menu
    Copy the full SHA
    b580a45 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2022

  1. ROB: Cope with invalid length in streams (#861)

    In case of invalid extract stream data looking for endstream
    
    Closes #301
    pubpub-zz committed May 7, 2022
    Configuration menu
    Copy the full SHA
    e48bc6d View commit details
    Browse the repository at this point in the history

Commits on May 8, 2022

  1. MAINT: Type annotations for all functions/methods (#854)

    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
    MartinThoma committed May 8, 2022
    Configuration menu
    Copy the full SHA
    50e9079 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9a9cfee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    96711cc View commit details
    Browse the repository at this point in the history

Commits on May 11, 2022

  1. MAINT: Remove unnecessary generics imports (#873)

    Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
    MasterOdin committed May 11, 2022
    Configuration menu
    Copy the full SHA
    29b1006 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2478309 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2022

  1. MAINT: Remove IronPython Fallback for zlib (#872)

    See #863
    
    Co-authored-by: Martin Thoma <info@martin-thoma.de>
    MasterOdin and MartinThoma committed May 13, 2022
    Configuration menu
    Copy the full SHA
    98f72e4 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2022

  1. DEV: Use relative imports (#875)

    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>
    MartinThoma and pubpub-zz committed May 14, 2022
    Configuration menu
    Copy the full SHA
    4429066 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2022

  1. MAINT: Explicitly represent transformation matrix (#878)

    This allows us to have a simpler user interface for page transformations
    MartinThoma committed May 19, 2022
    Configuration menu
    Copy the full SHA
    5703b61 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2022

  1. Configuration menu
    Copy the full SHA
    adee9f0 View commit details
    Browse the repository at this point in the history
  2. MAINT: Use new PEP8 compliant names (#884)

    Add stacklevel=2 to deprecation warnings
    MartinThoma committed May 22, 2022
    Configuration menu
    Copy the full SHA
    e38b23d View commit details
    Browse the repository at this point in the history

Commits on May 24, 2022

  1. Merge main ours (#894)

    This is `git merge main -s ours`
    MartinThoma committed May 24, 2022
    Configuration menu
    Copy the full SHA
    3729af0 View commit details
    Browse the repository at this point in the history