Skip to content

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

@njsmith

Description

@njsmith

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 :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions