indygreg / indygreg/PyOxidizer

Is it possible to get fine-grained control over which stdlib extensions are included?

Open
#405 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

I was trying to figure out how to include specific stdlib extension modules (e.g. _ssl) but not others (e.g. _asyncio). I found:

  • PythonPackagingPolicy.extension_module_filter: this lets you set a few general policies like all or minimal, but doesn't give control on a per-resource level AFAICT
  • PythonPackagingPolicy.register_resource_callback: this gives you a ton of flexibility to configure most resources... but for stdlib extension modules, the PythonExtensionModule it receives seems to have add_include=False regardless of the setting of the extension_module_filter.

I think the most intuitive way would be for extension_module_filter to apply first and set the default values for add_include on all the stdlib modules, and then the resource callback would run second and have a chance to override that on a per-module basis. But apparently something else is going on?

Not sure if this is a documentation request or a feature request :-)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing PythonPackagingPolicy.extension_module_filter, register_resource_callback, and the PythonExtensionModule resource handling. Verify how extension_module_filter and callback decisions currently interact for stdlib modules such as _ssl and _asyncio. Done means a user can select individual stdlib extensions and override those selections per module through the documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.