mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-05 11:41:19 +00:00
importlib helpers don't provide importlib.thing, but importlib_thing
Fix everywhere.
This commit is contained in:
parent
3534742ef9
commit
4d67812d51
@ -88,7 +88,7 @@ if on_rtd:
|
||||
]
|
||||
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
from importlib.metadata import version as package_version
|
||||
from importlib_metadata import version as package_version
|
||||
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = package_version('ocrmypdf').version
|
||||
|
||||
@ -49,8 +49,8 @@ install_requires =
|
||||
cffi>=1.9.1 # must be a setup and install requirement
|
||||
coloredlogs>=14.0 # strictly optional
|
||||
img2pdf>=0.3.0,<0.5 # pure Python
|
||||
importlib-metadata>=4;python_version<'3.8'
|
||||
importlib-resources>=5;python_version<'3.9'
|
||||
importlib-metadata>=4 # until Python 3.8
|
||||
importlib-resources>=5 # until Python 3.9
|
||||
pdfminer.six!=20200720,>=20191110,<=20201018
|
||||
pikepdf>=2.10.0
|
||||
pikepdf<3;implementation_name=="pypy" and python_version=='3.6'
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
from importlib.metadata import version as _package_version
|
||||
from importlib_metadata import version as _package_version
|
||||
|
||||
PROGRAM_NAME = 'ocrmypdf'
|
||||
|
||||
|
||||
@ -10,10 +10,10 @@ Utilities for PDF/A production and confirmation with Ghostspcript.
|
||||
"""
|
||||
|
||||
import base64
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
from typing import Dict, Iterator, Union
|
||||
|
||||
import importlib_resources
|
||||
import pikepdf
|
||||
import pkg_resources # deprecated
|
||||
|
||||
@ -104,7 +104,7 @@ def generate_pdfa_ps(target_filename: Path, icc: str = 'sRGB'):
|
||||
if icc != 'sRGB':
|
||||
raise NotImplementedError("Only supporting sRGB")
|
||||
|
||||
bytes_icc_profile = importlib.resources.read_binary(
|
||||
bytes_icc_profile = importlib_resources.read_binary(
|
||||
'ocrmypdf.data', SRGB_ICC_PROFILE_NAME
|
||||
)
|
||||
ps = '\n'.join(_make_postscript(icc, bytes_icc_profile, 3))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user