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

Generated module _sysconfigdata_... #29

Open
jayvdb opened this issue Dec 22, 2019 · 4 comments
Open

Generated module _sysconfigdata_... #29

jayvdb opened this issue Dec 22, 2019 · 4 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Dec 22, 2019

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.

@woodruffw
Copy link
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
Copy link
Contributor Author

jayvdb commented Jun 29, 2023

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
Copy link
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
Copy link
Contributor Author

jayvdb commented Jun 29, 2023

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants