Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip! dev: Don't compile bytecode for aiohappyeyeballs._staggered in PyOxidizer build #399

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pyoxidizer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,18 @@ def exe_resource_policy_decision(policy, resource):
# and data resources of these packages on the filesystem as well.
pkgs_requiring_file = ["botocore", "boto3", "docutils.parsers.rst", "docutils.writers"]

# Some modules should be excluded from bytecode compilation, e.g. because
# they contain syntax unsupported on our Python version (3.10) and aren't
# used at runtime anyway.
modules_no_bytecode = ["aiohappyeyeballs._staggered"]

if type(resource) == "PythonModuleSource":
if resource.name in pkgs_requiring_file or any([resource.name.startswith(p + ".") for p in pkgs_requiring_file]):
resource.add_location = "filesystem-relative:lib"

if resource.name in modules_no_bytecode:
resource.add_bytecode_optimization_level_zero = False

if type(resource) in ("PythonPackageResource", "PythonPackageDistributionResource"):
if resource.package in pkgs_requiring_file or any([resource.package.startswith(p + ".") for p in pkgs_requiring_file]):
resource.add_location = "filesystem-relative:lib"
Expand Down
Loading