Skip to content

Generated module _sysconfigdata_... #29

Open
@jayvdb

Description

@jayvdb
Contributor

Stdlib module sysconfig generates a cache called _sysconfigdata_... with an arch & build flags specific suffix.

This should be recognised as a stdlib package, but the flat file lists currently used dont lend themselves to this dynamic module name very well. Listing all possible suffixes seems like a bad approach.

Activity

woodruffw

woodruffw commented on Jun 29, 2023

@woodruffw
Member

Sorry for the delayed response here: could you say some more about how this module is imported? import _sysconfigdata_ doesn't work on my host (Linux, Python 3.11.2).

(Pragmatically speaking, it's hard to get a "perfect" stdlib list, because there is no such thing: any list we collect will likely contain things that some users of the same Python version won't be able to import, and will likely miss other things that others would be able to import. The best we can do is automate the 99.9% case; if there's a way to do that for _sysconfigdata_, then we absolutely should!)

jayvdb

jayvdb commented on Jun 29, 2023

@jayvdb
ContributorAuthor

See https://github.com/python/cpython/blob/main/Lib/sysconfig.py#L461 for how you get the name of the module for your host.

woodruffw

woodruffw commented on Jun 29, 2023

@woodruffw
Member

Thanks. It looks like the importable name here is going to be fundamentally host-specific, so any amount of AOT generation is likely to miss some host configurations.

We could instead do it on-the-fly for the host that we're installed on, but that changes the architecture of this package a bit (and moves it away from a pure data package). Given that, for the time being, I'm inclined to say that this is out-of-scope for this package.

There also appears to be some history of Python and upstream OS distributions messing with this module path, introducing further uncertainty: pypa/setuptools#2946

jayvdb

jayvdb commented on Jun 29, 2023

@jayvdb
ContributorAuthor

Perhaps in_stdlib can detect the prefix and return True, even if it isnt included in the list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jayvdb@woodruffw

        Issue actions

          Generated module _sysconfigdata_... · Issue #29 · pypi/stdlib-list