Drop Python 3.9 support

This commit is contained in:
James R. Barlow
2023-11-21 00:46:00 -08:00
parent d217856166
commit 3f7b540f76
5 changed files with 10 additions and 33 deletions
+4 -6
View File
@@ -22,20 +22,18 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-22.04
python: "3.9"
- os: ubuntu-22.04
python: "3.10"
- os: ubuntu-22.04
python: "3.11"
- os: ubuntu-22.04
python: "3.9"
python: "3.10"
tesseract5: true
- os: ubuntu-latest
python: "3.12"
tesseract5: true
#- os: ubuntu-latest
# python: "pypy3.9"
- os: ubuntu-latest
python: "pypy3.10"
env:
OS: ${{ matrix.os }}
@@ -219,7 +217,7 @@ jobs:
- uses: actions/setup-python@v4
name: Setup Python
with:
python-version: "3.9"
python-version: "3.10"
cache: "pip"
- name: Make wheels and sdist
+1 -1
View File
@@ -19,7 +19,7 @@ formats:
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"
python:
install:
+3 -3
View File
@@ -452,7 +452,7 @@ Cygwin64
First install the the following prerequisite Cygwin packages using ``setup-x86_64.exe``::
python39 (or later)
python310 (or later)
python3?-devel
python3?-pip
python3?-lxml
@@ -550,7 +550,7 @@ manager. ``pip`` cannot provide them.
The following versions are required:
- Python 3.9 or newer
- Python 3.10 or newer
- Ghostscript 9.55 or newer
- Tesseract 4.1.1 or newer
- jbig2enc 0.29 or newer
@@ -586,7 +586,7 @@ unfortunately, the ``pip install`` command cannot satisfy all of them.
Installing HEAD revision from sources
=====================================
If you have ``git`` and Python 3.9 or newer installed, you can install
If you have ``git`` and Python 3.10 or newer installed, you can install
from source. When the ``pip`` installer runs, it will alert you if
dependencies are missing.
+1 -2
View File
@@ -10,7 +10,7 @@ dynamic = ["version"]
description = "OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched"
readme = "README.md"
license = { text = "MPL-2.0" }
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"Pillow>=10.0.1",
"deprecation>=2.1.0",
@@ -20,7 +20,6 @@ dependencies = [
"pikepdf>=8.7.1",
"pluggy>=0.13.0",
"rich>=13",
"typing-extensions>=4;python_version<'3.10'",
]
authors = [{ name = "James R. Barlow", email = "james@purplerock.ca" }]
classifiers = [
+1 -21
View File
@@ -14,6 +14,7 @@ from contextlib import contextmanager
from decimal import Decimal
from pathlib import Path
from subprocess import PIPE, STDOUT
from tempfile import TemporaryDirectory
from typing import Union
from packaging.version import Version
@@ -26,27 +27,6 @@ from ocrmypdf.subprocess import get_version, run
# https://github.com/Flameeyes/unpaper/blob/main/doc/basic-concepts.md
if sys.version_info >= (3, 10):
from tempfile import TemporaryDirectory
else:
from tempfile import TemporaryDirectory as _TemporaryDirectory
class TemporaryDirectory(_TemporaryDirectory):
"""Shim to consume ignore_cleanup_errors kwarg on Python 3.9 and older.
The argument is consumed without action. If users are getting errors related
to temporary file cleanup, they should upgrade to Python 3.10 which properly
cleans up temporary directories on Windows.
See: https://github.com/python/cpython/pull/24793
"""
def __init__(self, ignore_cleanup_errors=False, **kwargs):
super().__init__(**kwargs)
del _TemporaryDirectory
UNPAPER_IMAGE_PIXEL_LIMIT = 256 * 1024 * 1024
DecFloat = Union[Decimal, float]