FIX: account for removals in py313 in importlib#11998
FIX: account for removals in py313 in importlib#11998tacaswell wants to merge 3 commits intomesonbuild:masterfrom
Conversation
|
Oh dear, this is disappointing. Why is this removed. Why does importlib.resources go around deleting APIs practically the instant that a replacement appears? Will we ever achieve stability? It is now impossible to write portable code that targets all supported versions of python without ifdef hackery. I hate the necessity of this and would dearly like for it to be resolved by CPython reverting this. |
|
I have no answers to these questions, I just have a set of scripts (https://github.com/tacaswell/build_the_world) that tries to build the software stack I care about from the default branches of everything with the intention of catching things like this as early as possible. I have no strong views on if it is better for meson to take this patch or CPython to defer the removal longer (so long as numpy will build 😄). |
|
Sure, I get that. :) Please note there's another hidden use of this in mesonbuild/mesondata.py as it turns out, so that should be fixed at the same time. In that case, it's importlib.resources.read_text but that function is in the same boat. |
|
Possibly surprising that does not get hit in any of the Python projects that have moved over already. |
|
That could be because it's only used in the cmake handling code. On that note, I found another couple instances:
|
|
Wondering if we should add compat layer in e.g. |
|
I don't think that really helps considering that we need 3 different APIs across 4 locations. There's extremely little duplication here. Simply hiding if/else in another file doesn't help much IMO. |
|
@eli-schwartz I now think I have gotten them all. |
|
@eli-schwartz Is there anything else to do here? |
|
I opened a proposal for importlib-resources, with the goal of streamlining the API -- maybe even for 3.13! I really need to get back to that. I'll put it in my priority list. |
|
The functional API is on track to be added back into 3.13 alpha and un-deprecated, which would mean that no released version of python will have lacked it. Once it is merged into CPython I propose to close this PR. |
243fdcb40ebeb177ce723911c1f7fad8a1fdf6cb / python/cpython#106532 removes functions deprecated in py311.
268c90d to
7ed699f
Compare
|
The CPython PR was merged and the API is restored to the 3.13 alpha. |
|
I can confirm that the default branch works again with the 3.13 CPYthon branch. |
243fdcb40ebeb177ce723911c1f7fad8a1fdf6cb /
python/cpython#106532 removes functions deprecated in py311.