Open
Description
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 commentedon Jun 29, 2023
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 commentedon 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 commentedon Jun 29, 2023
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 commentedon Jun 29, 2023
Perhaps
in_stdlib
can detect the prefix and returnTrue
, even if it isnt included in the list?