Skip to content

Commit

Permalink
Merge branch 'main' into reserved-bits
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 authored Apr 6, 2024
2 parents ba34a56 + 956fd03 commit 3ba26da
Show file tree
Hide file tree
Showing 79 changed files with 3,991 additions and 1,923 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Request a Feature
about: What do you think is missing in pypdf?
title: ''
labels: Feature Request
assignees: MartinThoma
assignees: ''

---

Expand Down
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
8 changes: 5 additions & 3 deletions .github/workflows/github-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ name: CI

on:
push:
branches: [ main, 2.0.0-dev ]
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.rst'
pull_request:
branches: [ main, 2.0.0-dev ]
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.rst'
Expand Down Expand Up @@ -225,7 +227,7 @@ jobs:
python -m coverage combine
python -m coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
33 changes: 30 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,45 @@
name: Publish Python Package to PyPI
on:
push:
tags:
- '*.*.*'
branches:
- main
permissions:
contents: write

jobs:
build_and_publish:
name: Publish a new version of pypdf
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: Extract version from commit message
id: extract_version
run: |
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP '(?<=REL: )\d+\.\d+\.\d+')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Extract tag message from commit message
id: extract_message
run: |
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
- name: Create Git Tag
run: |
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
- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -49,7 +76,7 @@ jobs:
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@v1
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.latest_tag }}
name: Version ${{ env.latest_tag }}, ${{ env.date }}
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,32 @@ repos:
exclude: "docs/make.bat"
- id: check-added-large-files
args: ['--maxkb=1000']

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [--target-version, py37]

- repo: https://github.com/asottile/blacken-docs
rev: 1.14.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.1.0]
exclude: "docs/user/robustness.md"

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args: ['--fix']

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

Expand Down
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.1.0, 2024-03-03

Generating name objects (`NameObject`) without a leading slash
is considered deprecated now. Previously, just a plain warning
would be logged, leading to possibly invalid PDF files. According
to our deprecation policy, this will log a *DeprecationWarning*
for now.

### New Features (ENH)
- Add get_pages_from_field (#2494)
- Add reattach_fields function (#2480)
- Automatic access to pointed object for IndirectObject (#2464)

### Bug Fixes (BUG)
- Missing error on name without leading / (#2387)
- encode_pdfdocencoding() always returns bytes (#2440)
- BI in text content identified as image tag (#2459)

### Robustness (ROB)
- Missing basefont entry in type 3 font (#2469)

### Documentation (DOC)
- Improve lossless compression example (#2488)
- Amend robustness documentation (#2479)

### Developer Experience (DEV)
- Fix changelog for UTF-8 characters (#2462)

### Maintenance (MAINT)
- Add _get_page_number_from_indirect in writer (#2493)
- Remove user assignment for feature requests (#2483)
- Remove reference to old 2.0.0 branch (#2482)

### Testing (TST)
- Fix benchmark failures (#2481)
- Broken test due to expired test file URL (#2468)
- Resolve file naming conflict in test_iss1767 (#2445)

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

## Version 4.0.2, 2024-02-18

### Bug Fixes (BUG)
- Use NumberObject for /Border elements of annotations (#2451)

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

## Version 4.0.1, 2024-01-28

### Bug Fixes (BUG)
- layout mode text extraction ZeroDivisionError (#2417)

### Testing (TST)
- Skip tests using fpdf2 if it's not installed (#2419)

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

## Version 4.0.0, 2024-01-19

### Deprecations (DEP)
Expand Down Expand Up @@ -186,7 +243,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 @@ -354,7 +411,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 @@ -375,7 +432,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 @@ -608,7 +665,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 @@ -942,12 +999,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 @@ -1025,7 +1082,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 @@ -1189,7 +1246,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 @@ -1228,7 +1285,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 3ba26da

Please sign in to comment.