Skip to content

Commit 195d82e

Browse files
authored
DEP: Drop Python 3.6 support (py-pdf#2369)
This does not mean that pypdf doesn't run with Python 3.6 anymore. It means that we don't run CI with Python 3.6 and don't give any guarantees. See py-pdf#2005
1 parent 3d44536 commit 195d82e

15 files changed

+69
-77
lines changed

.github/workflows/github-ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
5959
use-crypto-lib: ["cryptography"]
6060
include:
61-
- python-version: "3.6"
61+
- python-version: "3.7"
6262
use-crypto-lib: "pycryptodome"
6363
- python-version: "3.7"
6464
use-crypto-lib: "none"
@@ -81,7 +81,7 @@ jobs:
8181
key: cache-downloaded-files
8282
- name: Setup Python
8383
uses: actions/setup-python@v5
84-
if: matrix.python-version == '3.6' || matrix.python-version == '3.7' || matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10'
84+
if: matrix.python-version == '3.7' || matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10'
8585
with:
8686
python-version: ${{ matrix.python-version }}
8787
cache: 'pip'
@@ -100,7 +100,7 @@ jobs:
100100
- name: Install requirements (Python 3)
101101
run: |
102102
pip install -r requirements/ci.txt
103-
if: matrix.python-version == '3.6' || matrix.python-version == '3.7' || matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10'
103+
if: matrix.python-version == '3.7' || matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10'
104104
- name: Install requirements (Python 3.11+)
105105
run: |
106106
pip install -r requirements/ci-3.11.txt

.pre-commit-config.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pre-commit run --all-files
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
4+
rev: v4.1.0
55
hooks:
66
- id: check-ast
77
- id: check-byte-order-marker
@@ -18,34 +18,34 @@ repos:
1818
- id: check-added-large-files
1919
args: ['--maxkb=1000']
2020
- repo: https://github.com/psf/black
21-
rev: 23.10.1
21+
rev: 23.3.0
2222
hooks:
2323
- id: black
24-
args: [--target-version, py36]
24+
args: [--target-version, py37]
2525
- repo: https://github.com/asottile/blacken-docs
26-
rev: 1.16.0
26+
rev: 1.14.0
2727
hooks:
2828
- id: blacken-docs
2929
additional_dependencies: [black==22.1.0]
3030
exclude: "docs/user/robustness.md"
3131
- repo: https://github.com/charliermarsh/ruff-pre-commit
32-
rev: v0.1.3
32+
rev: v0.1.9
3333
hooks:
3434
- id: ruff
3535
args: ['--fix']
3636
- repo: https://github.com/asottile/pyupgrade
37-
rev: v3.15.0
37+
rev: v3.3.2
3838
hooks:
3939
- id: pyupgrade
40-
args: [--py36-plus]
40+
args: [--py37-plus]
4141
- repo: https://github.com/pycqa/flake8
42-
rev: 6.1.0
42+
rev: 5.0.4
4343
hooks:
4444
- id: flake8
4545
args: ["--ignore", "E,W,F"]
4646

4747
- repo: https://github.com/pre-commit/mirrors-mypy
48-
rev: 'v1.6.1'
48+
rev: 'v1.4.0'
4949
hooks:
5050
- id: mypy
5151
additional_dependencies: [types-Pillow==10.0.0.2]

.pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ persistent=yes
5353

5454
# Minimum Python version to use for version dependent checks. Will default to
5555
# the version used to run pylint.
56-
py-version=3.6
56+
py-version=3.7
5757

5858
# Discover python modules and packages in the file system subtree.
5959
recursive=no

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
maint:
2-
pyenv local 3.6.15
2+
pyenv local 3.7.15
33
pre-commit autoupdate
44
pip-compile -U requirements/ci.in
5-
pyenv local 3.7.15
65
pip-compile -U requirements/dev.in
7-
pyenv local 3.7.9
86
pip-compile -U requirements/docs.in
97

108
release:

docs/dev/testing.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ so that you can install the different Python versions:
2828

2929
```
3030
pyenv install pypy3.8-7.3.7
31-
pyenv install 3.6.15
32-
pyenv install 3.7.12
31+
pyenv install 3.7.15
3332
pyenv install 3.8.12
3433
pyenv install 3.9.10
3534
pyenv install 3.10.2

docs/user/encryption-decryption.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ with different key length. `pypdf` supports all of them until `PDF-2.0`, which
66
is the latest PDF standard.
77

88
`pypdf` use an extra dependency to do encryption or decryption for `AES` algorithms.
9-
We recommend [`pyca/cryptography`](https://cryptography.io/en/latest/). For Python 3.6
10-
users, you can use [`pycryptodome`](https://pypi.org/project/pycryptodome/) as a fallback.
9+
We recommend [`pyca/cryptography`](https://cryptography.io/en/latest/). Alternatively,
10+
you can use [`pycryptodome`](https://pypi.org/project/pycryptodome/).
1111

1212
> Please see the note in the [installation guide](installation.md)
1313
> for installing the extra dependencies if interacting with PDFs that use AES.

docs/user/installation.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ There are several ways to install pypdf. The most common option is to use pip.
44

55
## pip
66

7-
pypdf requires Python 3.6+ to run.
7+
pypdf requires Python 3.7+ to run.
88

99
Typically Python comes with `pip`, a package installer. Using it you can
1010
install pypdf:
@@ -52,6 +52,7 @@ pip install pypdf[image]
5252

5353
| Python | 3.11 | 3.10 | 3.9 | 3.8 | 3.7 | 3.6 | 2.7 |
5454
| ---------------------- | ---- | ---- | --- | --- | --- | --- | --- |
55+
| pypdf>=4.0 | YES | YES | YES | YES | YES | | |
5556
| pypdf>=3.0 | YES | YES | YES | YES | YES | YES | |
5657
| PyPDF2>=2.0 | YES | YES | YES | YES | YES | YES | |
5758
| PyPDF2 1.20.0 - 1.28.4 | | YES | YES | YES | YES | YES | YES |

pypdf/_xobj_image_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
else:
2121
# PEP 586 introduced typing.Literal with Python 3.8
2222
# For older Python versions, the backport typing_extensions is necessary:
23-
from typing_extensions import Literal # type: ignore[assignment]
23+
from typing_extensions import Literal
2424

2525
if sys.version_info[:2] >= (3, 10):
2626
from typing import TypeAlias

pypdf/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Python 3.8+: https://peps.python.org/pep-0586
88
from typing import Literal
99
else:
10-
from typing_extensions import Literal # type: ignore[assignment]
10+
from typing_extensions import Literal
1111

1212
if sys.version_info[:2] >= (3, 10):
1313
# Python 3.10+: https://www.python.org/dev/peps/pep-0484/

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ classifiers = [
1717
"License :: OSI Approved :: BSD License",
1818
"Programming Language :: Python :: 3",
1919
"Programming Language :: Python :: 3 :: Only",
20-
"Programming Language :: Python :: 3.6",
2120
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",

requirements/ci.txt

+30-34
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,56 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.6
2+
# This file is autogenerated by pip-compile with python 3.7
33
# To update, run:
44
#
55
# pip-compile requirements/ci.in
66
#
7-
attrs==20.3.0
8-
# via
9-
# flake8-bugbear
10-
# flake8-implicit-str-concat
11-
# pytest
12-
coverage[toml]==6.2
7+
attrs==23.1.0
8+
# via flake8-bugbear
9+
coverage[toml]==7.2.7
1310
# via
1411
# -r requirements/ci.in
1512
# pytest-cov
16-
execnet==1.9.0
13+
exceptiongroup==1.2.0
14+
# via pytest
15+
execnet==2.0.2
1716
# via pytest-xdist
1817
flake8==5.0.4
1918
# via
2019
# -r requirements/ci.in
2120
# flake8-bugbear
2221
# flake8-print
23-
flake8-bugbear==22.9.23
22+
flake8-bugbear==23.3.12
2423
# via -r requirements/ci.in
25-
flake8-implicit-str-concat==0.2.0
24+
flake8-implicit-str-concat==0.4.0
2625
# via -r requirements/ci.in
27-
flake8-print==4.0.1
26+
flake8-print==5.0.0
2827
# via -r requirements/ci.in
2928
fpdf2==2.4.1
3029
# via -r requirements/ci.in
3130
importlib-metadata==4.2.0
3231
# via
32+
# attrs
3333
# flake8
3434
# pluggy
3535
# pytest
36-
iniconfig==1.1.1
36+
# typeguard
37+
iniconfig==2.0.0
3738
# via pytest
3839
mccabe==0.7.0
3940
# via flake8
40-
more-itertools==8.14.0
41+
more-itertools==9.1.0
4142
# via flake8-implicit-str-concat
42-
mypy==0.971
43+
mypy==1.4.1
4344
# via -r requirements/ci.in
4445
mypy-extensions==1.0.0
4546
# via mypy
46-
packaging==21.3
47+
packaging==23.2
4748
# via pytest
48-
pillow==8.4.0
49+
pillow==9.5.0
4950
# via
5051
# -r requirements/ci.in
5152
# fpdf2
52-
pluggy==1.0.0
53-
# via pytest
54-
py==1.11.0
53+
pluggy==1.2.0
5554
# via pytest
5655
py-cpuinfo==9.0.0
5756
# via pytest-benchmark
@@ -63,46 +62,43 @@ pycryptodome==3.19.0
6362
# via -r requirements/ci.in
6463
pyflakes==2.5.0
6564
# via flake8
66-
pyparsing==3.1.1
67-
# via packaging
68-
pytest==7.0.1
65+
pytest==7.4.3
6966
# via
7067
# -r requirements/ci.in
7168
# pytest-benchmark
7269
# pytest-cov
7370
# pytest-socket
7471
# pytest-timeout
7572
# pytest-xdist
76-
pytest-benchmark==3.4.1
73+
pytest-benchmark==4.0.0
7774
# via -r requirements/ci.in
78-
pytest-cov==4.0.0
75+
pytest-cov==4.1.0
7976
# via -r requirements/ci.in
80-
pytest-socket==0.4.1
77+
pytest-socket==0.6.0
8178
# via -r requirements/ci.in
82-
pytest-timeout==2.1.0
79+
pytest-timeout==2.2.0
8380
# via -r requirements/ci.in
84-
pytest-xdist==3.0.2
81+
pytest-xdist==3.5.0
8582
# via -r requirements/ci.in
8683
pyyaml==6.0.1
8784
# via -r requirements/ci.in
88-
six==1.16.0
89-
# via flake8-print
90-
tomli==1.2.3
85+
tomli==2.0.1
9186
# via
9287
# coverage
9388
# mypy
9489
# pytest
9590
typed-ast==1.5.5
9691
# via mypy
97-
typeguard==2.13.3
92+
typeguard==4.1.2
9893
# via -r requirements/ci.in
9994
types-dataclasses==0.6.6
10095
# via -r requirements/ci.in
101-
types-pillow==10.0.0.3
96+
types-pillow==10.1.0.2
10297
# via -r requirements/ci.in
103-
typing-extensions==4.1.1
98+
typing-extensions==4.7.1
10499
# via
105100
# importlib-metadata
106101
# mypy
107-
zipp==3.6.0
102+
# typeguard
103+
zipp==3.15.0
108104
# via importlib-metadata

requirements/dev.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ black==23.3.0
88
# via -r requirements/dev.in
99
build==1.0.3
1010
# via pip-tools
11-
certifi==2023.7.22
11+
certifi==2023.11.17
1212
# via requests
1313
cfgv==3.3.1
1414
# via pre-commit
15-
charset-normalizer==3.3.1
15+
charset-normalizer==3.3.2
1616
# via requests
1717
click==8.1.7
1818
# via
1919
# black
2020
# pip-tools
2121
coverage[toml]==7.2.7
2222
# via pytest-cov
23-
distlib==0.3.7
23+
distlib==0.3.8
2424
# via virtualenv
2525
docutils==0.20.1
2626
# via flit
27-
exceptiongroup==1.1.3
27+
exceptiongroup==1.2.0
2828
# via pytest
2929
filelock==3.12.2
3030
# via virtualenv
@@ -34,7 +34,7 @@ flit-core==3.9.0
3434
# via flit
3535
identify==2.5.24
3636
# via pre-commit
37-
idna==3.4
37+
idna==3.6
3838
# via requests
3939
importlib-metadata==6.7.0
4040
# via
@@ -60,7 +60,7 @@ pillow==9.5.0
6060
# via -r requirements/dev.in
6161
pip-tools==6.14.0
6262
# via -r requirements/dev.in
63-
platformdirs==3.11.0
63+
platformdirs==4.0.0
6464
# via
6565
# black
6666
# virtualenv
@@ -98,9 +98,9 @@ typing-extensions==4.7.1
9898
# platformdirs
9999
urllib3==2.0.7
100100
# via requests
101-
virtualenv==20.24.6
101+
virtualenv==20.25.0
102102
# via pre-commit
103-
wheel==0.41.2
103+
wheel==0.42.0
104104
# via
105105
# -r requirements/dev.in
106106
# pip-tools

requirements/docs.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
sphinx
2-
sphinx_rtd_theme
2+
sphinx_rtd_theme<2.0.0
33
myst_parser==0.16.1
44
attrs # required for myst, but not automatically installed by myst

0 commit comments

Comments
 (0)