diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index 33e662fe4..96389177b 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -17,11 +17,11 @@ jobs: python-version: ["3.10"] steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install requirements (Python 3) diff --git a/.github/workflows/github-ci.yaml b/.github/workflows/github-ci.yaml index cfdb35fb1..3f9420a73 100644 --- a/.github/workflows/github-ci.yaml +++ b/.github/workflows/github-ci.yaml @@ -39,7 +39,7 @@ jobs: run: sudo apt-get install ghostscript - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Cache Downloaded Files @@ -109,7 +109,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Cache Downloaded Files @@ -143,8 +143,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: ${{env.PYTHON_LATEST}} @@ -166,8 +166,8 @@ jobs: needs: tests steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: # Use latest Python, so it understands all syntax. python-version: ${{env.PYTHON_LATEST}} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f3ff2a851..9fb135d8a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: steps: # Ensure it's on PyPI - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4dadd9885..f6478c8c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: # hooks: # - id: mypy - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black args: [--target-version, py36] @@ -33,12 +33,12 @@ repos: additional_dependencies: [black==22.1.0] exclude: "docs/user/robustness.md" - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.285 + rev: v0.0.290 hooks: - id: ruff args: ['--fix'] - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.11.0 hooks: - id: pyupgrade args: [--py36-plus] diff --git a/pypdf/_page.py b/pypdf/_page.py index 4f960e268..55054c47b 100644 --- a/pypdf/_page.py +++ b/pypdf/_page.py @@ -1095,7 +1095,7 @@ def _merge_page( annots = page[PG.ANNOTS] if isinstance(annots, ArrayObject): for ref in annots: - new_annots.append(ref) # noqa: PERF402 + new_annots.append(ref) for res in ( RES.EXT_G_STATE, diff --git a/pypdf/_writer.py b/pypdf/_writer.py index e3fe5bb07..11a0b77e6 100644 --- a/pypdf/_writer.py +++ b/pypdf/_writer.py @@ -2955,7 +2955,7 @@ def merge( excluded_fields = () # Find the range of pages to merge. if pages is None: - pages = list(range(0, len(reader.pages))) + pages = list(range(len(reader.pages))) elif isinstance(pages, PageRange): pages = list(range(*pages.indices(len(reader.pages)))) elif isinstance(pages, list): diff --git a/requirements/ci-3.11.txt b/requirements/ci-3.11.txt index 973294f32..05b729c5e 100644 --- a/requirements/ci-3.11.txt +++ b/requirements/ci-3.11.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --output-file=requirements/ci-3.11.txt requirements/ci.in +# pip-compile --config=pyproject.toml --output-file=requirements/ci-3.11.txt requirements/ci.in # attrs==23.1.0 # via flake8-bugbear @@ -59,7 +59,7 @@ pytest-socket==0.6.0 # via -r requirements/ci.in pytest-timeout==2.1.0 # via -r requirements/ci.in -ruff==0.0.285 +ruff==0.0.290 # via -r requirements/ci.in typeguard==4.1.2 # via -r requirements/ci.in diff --git a/requirements/ci.txt b/requirements/ci.txt index 2596f2ae1..ab29f9d92 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -55,11 +55,11 @@ pycodestyle==2.9.1 # via # flake8 # flake8-print -pycryptodome==3.18.0 +pycryptodome==3.19.0 # via -r requirements/ci.in pyflakes==2.5.0 # via flake8 -pyparsing==3.1.0 +pyparsing==3.1.1 # via packaging pytest==7.0.1 # via @@ -85,7 +85,7 @@ typeguard==2.13.3 # via -r requirements/ci.in types-dataclasses==0.6.6 # via -r requirements/ci.in -types-pillow==10.0.0.2 +types-pillow==10.0.0.3 # via -r requirements/ci.in typing-extensions==4.1.1 # via diff --git a/requirements/dev.txt b/requirements/dev.txt index e64ee7010..0e9aed1b2 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,12 +1,12 @@ # -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: +# This file is autogenerated by pip-compile +# To update, run: # # pip-compile requirements/dev.in # black==23.3.0 # via -r requirements/dev.in -build==0.10.0 +build==1.0.3 # via pip-tools certifi==2023.7.22 # via requests @@ -14,7 +14,7 @@ cfgv==3.3.1 # via pre-commit charset-normalizer==3.2.0 # via requests -click==8.1.6 +click==8.1.7 # via # black # pip-tools @@ -24,18 +24,20 @@ distlib==0.3.7 # via virtualenv docutils==0.20.1 # via flit -exceptiongroup==1.1.2 +exceptiongroup==1.1.3 # via pytest filelock==3.12.2 # via virtualenv -flit==3.9.0 - # via -r requirements/dev.in flit-core==3.9.0 # via flit +flit==3.9.0 + # via -r requirements/dev.in identify==2.5.24 # via pre-commit idna==3.4 # via requests +importlib-metadata==6.7.0 + # via build iniconfig==2.0.0 # via pytest mypy-extensions==1.0.0 @@ -47,13 +49,13 @@ packaging==23.1 # black # build # pytest -pathspec==0.11.1 +pathspec==0.11.2 # via black pillow==9.5.0 # via -r requirements/dev.in pip-tools==6.14.0 # via -r requirements/dev.in -platformdirs==3.9.1 +platformdirs==3.10.0 # via # black # virtualenv @@ -63,35 +65,38 @@ pre-commit==2.17.0 # via -r requirements/dev.in pyproject-hooks==1.0.0 # via build -pytest==7.4.0 - # via pytest-cov pytest-cov==4.1.0 # via -r requirements/dev.in +pytest==7.4.2 + # via pytest-cov pyyaml==6.0.1 # via pre-commit requests==2.31.0 # via flit toml==0.10.2 # via pre-commit +tomli-w==1.0.0 + # via flit tomli==2.0.1 # via # black # build # coverage # pip-tools + # pyproject-hooks # pytest -tomli-w==1.0.0 - # via flit typing-extensions==4.7.1 # via black urllib3==2.0.4 # via requests -virtualenv==20.24.1 +virtualenv==20.24.5 # via pre-commit -wheel==0.41.0 +wheel==0.41.2 # via # -r requirements/dev.in # pip-tools +zipp==3.15.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/docs.txt b/requirements/docs.txt index 18eea3d30..19c47cb44 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -45,9 +45,9 @@ myst-parser==0.16.1 # via -r requirements/docs.in packaging==23.1 # via sphinx -pygments==2.15.1 +pygments==2.16.1 # via sphinx -pytz==2023.3 +pytz==2023.3.post1 # via babel pyyaml==6.0.1 # via myst-parser @@ -61,7 +61,7 @@ sphinx==4.5.0 # myst-parser # sphinx-rtd-theme # sphinxcontrib-jquery -sphinx-rtd-theme==1.2.2 +sphinx-rtd-theme==1.3.0 # via -r requirements/docs.in sphinxcontrib-applehelp==1.0.2 # via sphinx