Also bump apsw

apsw now uses a compiled etension module as its __init__
so support that.
This commit is contained in:
Kovid Goyal 2023-09-13 13:46:40 +05:30
parent 71662297a1
commit 741f195e13
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 15 additions and 14 deletions

View File

@ -13,13 +13,14 @@ import time
from functools import partial from functools import partial
from bypy.constants import ( from bypy.constants import (
OUTPUT_DIR, PREFIX, SRC as CALIBRE_DIR, python_major_minor_version OUTPUT_DIR, PREFIX, SRC as CALIBRE_DIR, python_major_minor_version,
) )
from bypy.freeze import ( from bypy.freeze import (
extract_extension_modules, fix_pycryptodome, freeze_python, path_to_freeze_dir extract_extension_modules, fix_pycryptodome, freeze_python, is_package_dir,
path_to_freeze_dir,
) )
from bypy.utils import ( from bypy.utils import (
create_job, get_dll_path, mkdtemp, parallel_build, py_compile, run, walk create_job, get_dll_path, mkdtemp, parallel_build, py_compile, run, walk,
) )
j = os.path.join j = os.path.join
@ -90,8 +91,7 @@ def ignore_in_lib(base, items, ignored_dirs=None):
for name in items: for name in items:
path = j(base, name) path = j(base, name)
if os.path.isdir(path): if os.path.isdir(path):
if name in ignored_dirs or not os.path.exists(j(path, '__init__.py')): if name != 'plugins' and (name in ignored_dirs or not is_package_dir(path)):
if name != 'plugins':
ans.append(name) ans.append(name)
else: else:
if name.rpartition('.')[-1] not in ('so', 'py'): if name.rpartition('.')[-1] not in ('so', 'py'):
@ -112,7 +112,7 @@ def import_site_packages(srcdir, dest):
src = os.path.abspath(j(srcdir, line)) src = os.path.abspath(j(srcdir, line))
if os.path.exists(src) and os.path.isdir(src): if os.path.exists(src) and os.path.isdir(src):
import_site_packages(src, dest) import_site_packages(src, dest)
elif os.path.exists(j(f, '__init__.py')): elif is_package_dir(f):
shutil.copytree(f, j(dest, x), ignore=ignore_in_lib) shutil.copytree(f, j(dest, x), ignore=ignore_in_lib)

View File

@ -20,13 +20,14 @@ from functools import partial, reduce
from itertools import repeat from itertools import repeat
from bypy.constants import ( from bypy.constants import (
OUTPUT_DIR, PREFIX, PYTHON, SRC as CALIBRE_DIR, python_major_minor_version OUTPUT_DIR, PREFIX, PYTHON, SRC as CALIBRE_DIR, python_major_minor_version,
) )
from bypy.freeze import ( from bypy.freeze import (
extract_extension_modules, fix_pycryptodome, freeze_python, path_to_freeze_dir extract_extension_modules, fix_pycryptodome, freeze_python, is_package_dir,
path_to_freeze_dir,
) )
from bypy.utils import ( from bypy.utils import (
current_dir, get_arches_in_binary, mkdtemp, py_compile, timeit, walk current_dir, get_arches_in_binary, mkdtemp, py_compile, timeit, walk,
) )
abspath, join, basename, dirname = os.path.abspath, os.path.join, os.path.basename, os.path.dirname abspath, join, basename, dirname = os.path.abspath, os.path.join, os.path.basename, os.path.dirname
@ -584,7 +585,7 @@ class Freeze:
def add_packages_from_dir(self, src): def add_packages_from_dir(self, src):
for x in os.listdir(src): for x in os.listdir(src):
x = join(src, x) x = join(src, x)
if os.path.isdir(x) and os.path.exists(join(x, '__init__.py')): if os.path.isdir(x) and is_package_dir(x):
if self.filter_package(basename(x)): if self.filter_package(basename(x)):
continue continue
self.add_package_dir(x) self.add_package_dir(x)

View File

@ -767,9 +767,9 @@
{ {
"name": "apsw", "name": "apsw",
"unix": { "unix": {
"filename": "apsw-3.36.0-r1.zip", "filename": "apsw-3.43.0.0.zip",
"hash": "sha256:17355c39a8cdb9b9cd75b76d883b624c0dd05f80a6677c693b67c343c2381871", "hash": "sha256:7440d5f976a369ab87477e064545a8a62a93e413ead7bfe0be4efc75b1f30bb0",
"urls": ["https://github.com/rogerbinns/apsw/releases/download/3.36.0-r1/{filename}"] "urls": ["https://github.com/rogerbinns/apsw/releases/download/3.43.0.0/{filename}"]
} }
}, },