From dbd3579e8b1a9aa2ed7f2e9f636b48ff317b4ee9 Mon Sep 17 00:00:00 2001 From: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> Date: Sun, 15 Sep 2024 11:07:09 +0200 Subject: [PATCH 1/8] REL: 5.0.0 Release version 5.0.0 --- CHANGELOG.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 4 ++-- pypdf/_version.py | 2 +- pyproject.toml | 15 ++++++------ 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c07dca099..ff994046b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,64 @@ # CHANGELOG +## Version 5.0.0, 2024-09-15 + +### Security (SEC) +- Fix GitHub workflow vulnerable to script injection (#2787) + +### New Features (ENH) +- Add capability to remove /Info from PDF (#2820) +- Robustify parsing for Object streams in XRef rebuilding (#2818) +- Add incremental capability to PdfWriter (#2811) +- add capability to remove /Info from pypdf +- Add UniGB-UTF16 encodings (#2819) +- Robustify on missing font for Tf operator in text_extract() (#2816) +- add incremental capability to PdfWriter +- Accept utf strings for metadata (#2802) +- Report PdfReadError instead of RecursionError (#2800) +- Compress PDF files merging identical objects (#2795) + +### Bug Fixes (BUG) +- Warn when visitor* arguments are ignored (#2845) +- Fix sheared image (#2801) +- Handle Sequence as an IndirectObject when extracting text with layout mode (#2788) + +### Robustness (ROB) +- Robustify .set_data() (#2821) +- Raise PdfReadError when missing /Root in trailer (#2808) +- Fix extract_text() issues on damaged PDFs (#2760) +- Handle images with empty data when processing an image from bytes (#2786) + +### Documentation (DOC) +- Small changes to PaperSize notes (#2834) + +### Developer Experience (DEV) +- Fix coverage uploads (#2832) +- Test against Python 3.13 (#2776) + +### Maintenance (MAINT) +- Deprecate PdfMerger, AnnotationBuilder and other deprecations cleanup (#2813) +- simplify test with None and NullObject +- Improve wording of set_data error message (#2810) +- Remove unused code (#2805) +- Fix mypy type output (#2799) +- Improve test coverage (#2796) +- Remove b_ and str_ (#2792) +- Drop Python 3.7 support (#2793) +- Remove unused AnnotationFlag +- Remove unused paeth_predictor (#2773) + +### Code Style (STY) +- Use f-string = functionality (#2835) +- Refactor b_ (#2772) +- Remove boolean value comparison (#2779) +- Increase readability (#2775) +- Reorder exported symbols (#2774) +- Amend B_CACHE key types (#2766) + +### Other + +[Full Changelog](https://github.com/py-pdf/pypdf/compare/4.3.1...5.0.0) + ## Version 4.3.1, 2024-07-21 ### Bug Fixes (BUG) diff --git a/Makefile b/Makefile index 2807d2cda..1c0117ba8 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ maint: - pyenv local 3.7.15 + pyenv local 3.10.5 pre-commit autoupdate pip-compile -U requirements/ci.in - pip-compile -U requirements/dev.in pip-compile -U requirements/docs.in + pip-compile -U requirements/dev.in release: python make_release.py diff --git a/pypdf/_version.py b/pypdf/_version.py index ed48cdab0..ba7be38e4 100644 --- a/pypdf/_version.py +++ b/pypdf/_version.py @@ -1 +1 @@ -__version__ = "4.3.1" +__version__ = "5.0.0" diff --git a/pyproject.toml b/pyproject.toml index eb9e8a0a8..c14e14f84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,12 +17,12 @@ classifiers = [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", @@ -30,7 +30,7 @@ classifiers = [ dependencies = [ "typing_extensions >= 4.0; python_version < '3.11'", - "dataclasses; python_version < '3.7'", + "dataclasses", ] [project.urls] @@ -41,15 +41,14 @@ Changelog = "https://pypdf.readthedocs.io/en/latest/meta/CHANGELOG.html" [project.optional-dependencies] full = [ - "cryptography; python_version >= '3.7'", - "PyCryptodome; python_version == '3.6'", - "Pillow>=8.0.0", + "cryptography; python_version >= '3.8'", + "Pillow>=10.3.0", ] crypto = [ - "cryptography; python_version >= '3.7'", - "PyCryptodome; python_version == '3.6'", + "cryptography; python_version >= '3.8'", + "PyCryptodome; python_version >= '3.6'", ] -image = ["Pillow>=8.0.0"] +image = ["Pillow>=10.3.0"] dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "pytest-socket", "pytest-timeout", "flit", "wheel", "pytest-xdist"] docs = ["sphinx", "sphinx_rtd_theme", "myst_parser"] From 0ec4ee8e6a7051bc0f63cb4f48539d6e76b4de4d Mon Sep 17 00:00:00 2001 From: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:18:14 +0200 Subject: [PATCH 2/8] Update CHANGELOG.md --- CHANGELOG.md | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff994046b..caa204a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,25 +2,20 @@ ## Version 5.0.0, 2024-09-15 -### Security (SEC) -- Fix GitHub workflow vulnerable to script injection (#2787) +### Maintenance (MAINT) +- Deprecate PdfMerger, AnnotationBuilder and other deprecations cleanup (#2813) +- Drop Python 3.7 support (#2793) ### New Features (ENH) - Add capability to remove /Info from PDF (#2820) -- Robustify parsing for Object streams in XRef rebuilding (#2818) - Add incremental capability to PdfWriter (#2811) -- add capability to remove /Info from pypdf - Add UniGB-UTF16 encodings (#2819) -- Robustify on missing font for Tf operator in text_extract() (#2816) -- add incremental capability to PdfWriter - Accept utf strings for metadata (#2802) - Report PdfReadError instead of RecursionError (#2800) - Compress PDF files merging identical objects (#2795) ### Bug Fixes (BUG) -- Warn when visitor* arguments are ignored (#2845) - Fix sheared image (#2801) -- Handle Sequence as an IndirectObject when extracting text with layout mode (#2788) ### Robustness (ROB) - Robustify .set_data() (#2821) @@ -28,34 +23,10 @@ - Fix extract_text() issues on damaged PDFs (#2760) - Handle images with empty data when processing an image from bytes (#2786) -### Documentation (DOC) -- Small changes to PaperSize notes (#2834) - ### Developer Experience (DEV) - Fix coverage uploads (#2832) - Test against Python 3.13 (#2776) -### Maintenance (MAINT) -- Deprecate PdfMerger, AnnotationBuilder and other deprecations cleanup (#2813) -- simplify test with None and NullObject -- Improve wording of set_data error message (#2810) -- Remove unused code (#2805) -- Fix mypy type output (#2799) -- Improve test coverage (#2796) -- Remove b_ and str_ (#2792) -- Drop Python 3.7 support (#2793) -- Remove unused AnnotationFlag -- Remove unused paeth_predictor (#2773) - -### Code Style (STY) -- Use f-string = functionality (#2835) -- Refactor b_ (#2772) -- Remove boolean value comparison (#2779) -- Increase readability (#2775) -- Reorder exported symbols (#2774) -- Amend B_CACHE key types (#2766) - -### Other [Full Changelog](https://github.com/py-pdf/pypdf/compare/4.3.1...5.0.0) From 6db3a15417a1ca593fb4e251aeeec88d5b0530c6 Mon Sep 17 00:00:00 2001 From: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:24:36 +0200 Subject: [PATCH 3/8] Update CHANGELOG.md Co-authored-by: Martin Thoma --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caa204a2e..c1c302ac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Version 5.0.0, 2024-09-15 -### Maintenance (MAINT) +### Deprecations (DEP) - Deprecate PdfMerger, AnnotationBuilder and other deprecations cleanup (#2813) - Drop Python 3.7 support (#2793) From 92478032909b8067fea68ae90e88943481a1be5f Mon Sep 17 00:00:00 2001 From: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:50:13 +0200 Subject: [PATCH 4/8] iaw comments --- CHANGELOG.md | 3 +++ pyproject.toml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1c302ac8..89bc2805b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Version 5.0.0, 2024-09-15 +** Notice : this version drops support to Python 3.7 (not maintained since June 23), PdfMerger(use PdfWriter instead) and AnnotationBuilder(use annotations instead) ** + + ### Deprecations (DEP) - Deprecate PdfMerger, AnnotationBuilder and other deprecations cleanup (#2813) - Drop Python 3.7 support (#2793) diff --git a/pyproject.toml b/pyproject.toml index c14e14f84..9d168ddf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,8 +45,8 @@ full = [ "Pillow>=10.3.0", ] crypto = [ - "cryptography; python_version >= '3.8'", - "PyCryptodome; python_version >= '3.6'", + "cryptography; python_version >= '3.7'", + "PyCryptodome; python_version == '3.6'", ] image = ["Pillow>=10.3.0"] dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "pytest-socket", "pytest-timeout", "flit", "wheel", "pytest-xdist"] From 4a918e6bf7b581874b6b8bdf795a977dbf1b9094 Mon Sep 17 00:00:00 2001 From: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:07:10 +0200 Subject: [PATCH 5/8] iaw comments --- CHANGELOG.md | 2 +- pyproject.toml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89bc2805b..b405bc401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ### Deprecations (DEP) -- Deprecate PdfMerger, AnnotationBuilder and other deprecations cleanup (#2813) +- Remove the deprecated PfdMerger and AnnotationBuilder classes and other deprecations cleanup (#2813) - Drop Python 3.7 support (#2793) ### New Features (ENH) diff --git a/pyproject.toml b/pyproject.toml index 9d168ddf5..addc04528 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,12 +41,13 @@ Changelog = "https://pypdf.readthedocs.io/en/latest/meta/CHANGELOG.html" [project.optional-dependencies] full = [ - "cryptography; python_version >= '3.8'", - "Pillow>=10.3.0", -] -crypto = [ "cryptography; python_version >= '3.7'", "PyCryptodome; python_version == '3.6'", + "Pillow>=8.0.0", +] +crypto = [ + "cryptography; python_version >= '3.8'", + "PyCryptodome; python_version >= '3.6'", ] image = ["Pillow>=10.3.0"] dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "pytest-socket", "pytest-timeout", "flit", "wheel", "pytest-xdist"] From 2338f8eb7f9201944bc1f5567cf7f357282b300f Mon Sep 17 00:00:00 2001 From: Stefan <96178532+stefan6419846@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:46:19 +0200 Subject: [PATCH 6/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b405bc401..496b9954b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Version 5.0.0, 2024-09-15 -** Notice : this version drops support to Python 3.7 (not maintained since June 23), PdfMerger(use PdfWriter instead) and AnnotationBuilder(use annotations instead) ** +This version drops support for Python 3.7 (not maintained since July 2023), PdfMerger (use PdfWriter instead) and AnnotationBuilder (use annotations instead). ### Deprecations (DEP) From 10e125e08388e75b96bc172b2d4ba78b6a335ae3 Mon Sep 17 00:00:00 2001 From: Stefan <96178532+stefan6419846@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:47:58 +0200 Subject: [PATCH 7/8] revert unrelated changes --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1c0117ba8..2807d2cda 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ maint: - pyenv local 3.10.5 + pyenv local 3.7.15 pre-commit autoupdate pip-compile -U requirements/ci.in - pip-compile -U requirements/docs.in pip-compile -U requirements/dev.in + pip-compile -U requirements/docs.in release: python make_release.py From 159fd2584ac16b7cbdc54564340525707956e3e8 Mon Sep 17 00:00:00 2001 From: Stefan <96178532+stefan6419846@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:50:03 +0200 Subject: [PATCH 8/8] revert unrelated changes --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index addc04528..3da378ce9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ dependencies = [ "typing_extensions >= 4.0; python_version < '3.11'", - "dataclasses", + "dataclasses; python_version < '3.7'", ] [project.urls] @@ -46,10 +46,10 @@ full = [ "Pillow>=8.0.0", ] crypto = [ - "cryptography; python_version >= '3.8'", - "PyCryptodome; python_version >= '3.6'", + "cryptography; python_version >= '3.7'", + "PyCryptodome; python_version == '3.6'", ] -image = ["Pillow>=10.3.0"] +image = ["Pillow>=8.0.0"] dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "pytest-socket", "pytest-timeout", "flit", "wheel", "pytest-xdist"] docs = ["sphinx", "sphinx_rtd_theme", "myst_parser"]