From f61a394fdc7329ba06a33c9982059bd2db025bc5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 30 Nov 2021 12:19:04 +0530 Subject: [PATCH] Some new dependencies for py7r --- bypy/sources.json | 42 ++++++++++++++++++++++++++++++++++++++++ src/calibre/constants.py | 4 ++++ 2 files changed, 46 insertions(+) diff --git a/bypy/sources.json b/bypy/sources.json index 846db2fed8..e84530a9b6 100644 --- a/bypy/sources.json +++ b/bypy/sources.json @@ -806,6 +806,48 @@ } }, + { + "name": "multivolumefile", + "comment": "Needed by py7zr", + "unix": { + "filename": "multivolumefile-0.2.3.tar.gz", + "hash": "sha256:a0648d0aafbc96e59198d5c17e9acad7eb531abea51035d08ce8060dcad709d6", + "urls": ["pypi"] + } + }, + + { + "name": "python-brotli", + "comment": "Needed by py7zr", + "unix": { + "filename": "brotli-1.0.9.zip", + "hash": "sha256:4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438", + "urls": ["pypi"] + } + }, + + { + "name": "pyzstd", + "comment": "Needed by py7zr", + "unix": { + "filename": "pyzstd-0.15.0.tar.gz", + "hash": "sha256:bf15a39cb3c9b662775e22ffa8c4da09fdde6a15ece5e0ed710b6d3b4329cf36", + "urls": ["pypi"] + } + }, + + + { + "name": "pyppmd", + "comment": "Needed by py7zr", + "unix": { + "filename": "pyppmd-0.17.3.tar.gz", + "hash": "sha256:05a4765833623d5cc1c9afc27d9b05fb64f0319711beffe0b44d9695eb1beb0a", + "urls": ["pypi"] + } + }, + + { "name": "py7zr", "unix": { diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 38a75eb119..0029cb9a33 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -206,6 +206,10 @@ class DeVendor: if fullname.startswith('PyQt5.'): # this is present for third party plugin compat return ModuleSpec(fullname, DeVendorLoader('qt.webengine' if 'QWebEngine' in fullname else 'qt.core')) + if fullname.startswith('Cryptodome'): + # this is needed for py7zr which uses pycryptodomex instead of + # pycryptodome for some reason + return ModuleSpec(fullname, DeVendorLoader(fullname.replace('dome', '', 1))) class ExtensionsPackageLoader: