Skip to content

Commit

Permalink
Also bump apsw
Browse files Browse the repository at this point in the history
apsw now uses a compiled etension module as its __init__
so support that.
  • Loading branch information
kovidgoyal committed Sep 13, 2023
1 parent 7166229 commit 741f195
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions bypy/linux/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
from functools import partial

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 (
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 (
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
Expand Down Expand Up @@ -90,9 +91,8 @@ def ignore_in_lib(base, items, ignored_dirs=None):
for name in items:
path = j(base, name)
if os.path.isdir(path):
if name in ignored_dirs or not os.path.exists(j(path, '__init__.py')):
if name != 'plugins':
ans.append(name)
if name != 'plugins' and (name in ignored_dirs or not is_package_dir(path)):
ans.append(name)
else:
if name.rpartition('.')[-1] not in ('so', 'py'):
ans.append(name)
Expand All @@ -112,7 +112,7 @@ def import_site_packages(srcdir, dest):
src = os.path.abspath(j(srcdir, line))
if os.path.exists(src) and os.path.isdir(src):
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)


Expand Down
9 changes: 5 additions & 4 deletions bypy/macos/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
from itertools import repeat

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 (
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 (
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
Expand Down Expand Up @@ -584,7 +585,7 @@ def add_modules_from_dir(self, src):
def add_packages_from_dir(self, src):
for x in os.listdir(src):
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)):
continue
self.add_package_dir(x)
Expand Down
6 changes: 3 additions & 3 deletions bypy/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@
{
"name": "apsw",
"unix": {
"filename": "apsw-3.36.0-r1.zip",
"hash": "sha256:17355c39a8cdb9b9cd75b76d883b624c0dd05f80a6677c693b67c343c2381871",
"urls": ["https://github.com/rogerbinns/apsw/releases/download/3.36.0-r1/{filename}"]
"filename": "apsw-3.43.0.0.zip",
"hash": "sha256:7440d5f976a369ab87477e064545a8a62a93e413ead7bfe0be4efc75b1f30bb0",
"urls": ["https://github.com/rogerbinns/apsw/releases/download/3.43.0.0/{filename}"]
}
},

Expand Down

0 comments on commit 741f195

Please sign in to comment.