Skip to content

Commit

Permalink
Merge branch 'main' into documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
j-t-1 committed May 14, 2024
2 parents a350019 + 32f826b commit 2b17e02
Show file tree
Hide file tree
Showing 54 changed files with 1,484 additions and 587 deletions.
1 change: 1 addition & 0 deletions .github/scripts/check_pr_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"DEV: ",
"STY: ",
"MAINT: ",
"REL: ", # For internal use only.
)
PR_TITLE = os.getenv("PR_TITLE", "")

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/create-github-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create a GitHub release page

on:
push:
tags:
- '*.*.*'
workflow_dispatch:

permissions:
contents: write

jobs:
build_and_publish:
name: Create a GitHub release page
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Prepare variables
id: prepare_variables
run: |
git fetch --tags --force
latest_tag=$(git describe --tags --abbrev=0)
echo "latest_tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "tag_body<<$EOF" >> "$GITHUB_ENV"
git --no-pager tag -l "${latest_tag}" --format='%(contents:body)' >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- name: Create GitHub Release 🚀
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.latest_tag }}
name: Version ${{ env.latest_tag }}, ${{ env.date }}
draft: false
prerelease: false
body: ${{ env.tag_body }}
32 changes: 32 additions & 0 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Python Package to PyPI

on:
push:
tags:
- '*.*.*'
workflow_dispatch:

jobs:
build_and_publish:
name: Publish a new version
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install Flit
run: |
python -m pip install --upgrade pip
pip install flit
- name: Checkout Repository
uses: actions/checkout@v4

- name: Publish Package to PyPI🚀
env:
FLIT_USERNAME: '__token__'
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
run: |
flit publish
65 changes: 27 additions & 38 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,45 @@
# and it's decided what should be in the release.
# This action only ensures the release is done with the proper contents
# and that it's announced with a Github release.
name: Publish Python Package to PyPI
name: Create git tag
on:
push:
tags:
- '*.*.*'
branches:
- main

permissions:
contents: write

jobs:
build_and_publish:
name: Publish a new version of pypdf
name: Publish a new version
runs-on: ubuntu-latest

if: "${{ startsWith(github.event.head_commit.message, 'REL: ') }}"
steps:
# Ensure it's on PyPI
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install Flit
- name: Extract version from commit message
id: extract_version
run: |
python -m pip install --upgrade pip
pip install flit
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP '(?<=REL: )\d+\.\d+\.\d+')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Publish Package to PyPI🚀
env:
FLIT_USERNAME: '__token__'
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
- name: Extract tag message from commit message
id: extract_message
run: |
flit publish
VERSION="${{ steps.extract_version.outputs.version }}"
delimiter="$(openssl rand -hex 8)"
MESSAGE=$(echo "${{ github.event.head_commit.message }}" | sed "0,/REL: $VERSION/s///" )
echo "message<<${delimiter}" >> $GITHUB_OUTPUT
echo "$MESSAGE" >> $GITHUB_OUTPUT
echo "${delimiter}" >> $GITHUB_OUTPUT
# Create the Github Page
- name: Prepare variables
id: prepare_variables
- name: Create Git Tag
run: |
git fetch --tags --force
latest_tag=$(git describe --tags --abbrev=0)
echo "latest_tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "tag_body<<$EOF" >> "$GITHUB_ENV"
git --no-pager tag -l "${latest_tag}" --format='%(contents:body)' >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- name: Create GitHub Release 🚀
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.latest_tag }}
name: Version ${{ env.latest_tag }}, ${{ env.date }}
draft: false
prerelease: false
body: ${{ env.tag_body }}
VERSION="${{ steps.extract_version.outputs.version }}"
MESSAGE="${{ steps.extract_message.outputs.message }}"
git config user.name github-actions
git config user.email github-actions@github.com
git tag "$VERSION" -m "$MESSAGE"
git push origin $VERSION
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ extracted-images/

RELEASE_COMMIT_MSG.md
RELEASE_TAG_MSG.md
.envrc
75 changes: 66 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
# CHANGELOG

## Version 4.2.0, 2024-04-07

### New Features (ENH)
- Allow multiple charsets for NameObject.read_from_stream (#2585)
- Add support for /Kids in page labels (#2562)
- Allow to update fields on many pages (#2571)
- Tolerate PDF with invalid xref pointed objects (#2335)
- Add Enforce from PDF2.0 in viewer_preferences (#2511)
- Add += and -= operators to ArrayObject (#2510)

### Bug Fixes (BUG)
- Fix merge_page sometimes generating unknown operator 'QQ' (#2588)
- Fix fields update where annotations are kids of field (#2570)
- Process CMYK images without a filter correctly (#2557)
- Extract text in layout mode without finding resources (#2555)
- Prevent recursive loop in some PDF files (#2505)

### Robustness (ROB)
- Tolerate "truncated" xref (#2580)
- Replace error by warning for EOD in RunLengthDecode/ASCIIHexDecode (#2334)
- Rebuild xref table if one entry is invalid (#2528)
- Robustify stream extraction (#2526)

### Documentation (DOC)
- Update release process for latest changes (#2564)
- Encryption/decryption: Clone document instead of copying all pages (#2546)
- Minor improvements (#2542)
- Update annotation list (#2534)
- Update references and formatting (#2529)
- Correct threads reference, plus minor changes (#2521)
- Minor readability increases (#2515)
- Simplify PaperSize examples (#2504)
- Minor improvements (#2501)

### Developer Experience (DEV)
- Remove unused dependencies (#2572)
- Remove page labels PR link from message (#2561)
- Fix changelog generator regarding whitespace and handling of "Other" group (#2492)
- Add REL to known PR prefixes (#2554)
- Release using the REL commit instead of git tag (#2500)
- Unify code between PdfReader and PdfWriter (#2497)
- Bump softprops/action-gh-release from 1 to 2 (#2514)

### Maintenance (MAINT)
- Ressources → Resources (and internal name childs) (#2550)
- Fix typos found by codespell (#2549)
- Update Read the Docs configuration (#2538)
- Add root_object, _info and _ID to PdfReader (#2495)

### Testing (TST)
- Allow loading truncated images if required (#2586)
- Fix download issues from #2562 (#2578)
- Improve test_get_contents_from_nullobject to show real use-case (#2524)
- Add missing test annotations (#2507)

[Full Changelog](https://github.com/py-pdf/pypdf/compare/4.1.0...4.2.0)

## Version 4.1.0, 2024-03-03

Generating name objects (`NameObject`) without a leading slash
Expand Down Expand Up @@ -243,7 +300,7 @@ nobody will be affected though. Hence only the patch update.
- Avoid endless recursion of reading damaged PDF file (#2093)

### Performance Improvements (PI)
- Re-use content stream (#2101)
- Reuse content stream (#2101)

### Maintenance (MAINT)
- Make ParseError inherit from PyPdfError (#2097)
Expand Down Expand Up @@ -411,7 +468,7 @@ nobody will be affected though. Hence only the patch update.

### New Features (ENH)
- Simplify metadata input (Document Information Dictionary) (#1851)
- Extend cmap compatibilty to GBK_EUC_H/V (#1812)
- Extend cmap compatibility to GBK_EUC_H/V (#1812)

### Bug Fixes (BUG)
- Prevent infinite loop when no character follows after a comment (#1828)
Expand All @@ -432,7 +489,7 @@ nobody will be affected though. Hence only the patch update.
- Refactor internal Encryption class (#1821)
- Add R parameter to generate_values (#1820)
- Make encryption_key parameter of write_to_stream optional (#1819)
- Prepare for adding AES enryption support (#1818)
- Prepare for adding AES encryption support (#1818)

[Full Changelog](https://github.com/py-pdf/pypdf/compare/3.8.1...3.9.0)

Expand Down Expand Up @@ -665,7 +722,7 @@ NOTICE: pypdf changed the way it represents numbers parsed from PDF files.
## Version 3.2.0, 2022-12-31

### Performance Improvement (PI)
- Help the specializing adpative interpreter (#1522)
- Help the specializing adaptive interpreter (#1522)

### New Features (ENH)
- Add support for page labels (#1519)
Expand Down Expand Up @@ -999,12 +1056,12 @@ BUG: Add PyPDF2.generic to PyPI distribution

### Documentation (DOC)
- Update changelog url in package metadata (#1180)
- Mantion camelot for table extraction (#1179)
- Mention camelot for table extraction (#1179)
- Mention pyHanko for signing PDF documents (#1178)
- Weow have CMAP support since a while (#1177)

### Maintenance (MAINT)
- Consistant usage of warnings / log messages (#1164)
- Consistent usage of warnings / log messages (#1164)
- Consistent terminology for outline items (#1156)


Expand Down Expand Up @@ -1082,7 +1139,7 @@ BUG: Add PyPDF2.generic to PyPI distribution

### Code Style (STY)
- Fixing typos (#1137)
- Re-use code via get_outlines_property in tests (#1130)
- Reuse code via get_outlines_property in tests (#1130)

[Full Changelog](https://github.com/py-pdf/PyPDF2/compare/2.6.0...2.7.0)

Expand Down Expand Up @@ -1246,7 +1303,7 @@ BUG: Add PyPDF2.generic to PyPI distribution

## Version 2.3.1, 2022-06-19

BUG: Forgot to add the interal `_codecs` subpackage.
BUG: Forgot to add the internal `_codecs` subpackage.

[Full Changelog](https://github.com/py-pdf/PyPDF2/compare/2.3.0...2.3.1)

Expand Down Expand Up @@ -1285,7 +1342,7 @@ The highlight of this release is improved support for file encryption
- Fix corrupted (wrongly) linear PDF (#1008)

### Maintenance (MAINT)
- Move PDF_Samples folder into ressources
- Move PDF_Samples folder into resources
- Fix typos (#1007)

### Testing (TST)
Expand Down
Loading

0 comments on commit 2b17e02

Please sign in to comment.