Use importlib.resources to load schema and licenses#670
Use importlib.resources to load schema and licenses#670radoering merged 4 commits intopython-poetry:mainfrom edgarrmondragon:2965-importlib.resources
importlib.resources to load schema and licenses#670Conversation
dimbleby
left a comment
There was a problem hiding this comment.
my overall feeling is that this is a lot of code to be vendoring for a rather niche use case - poetry in a zipapp - which, presumably, has been unsupported for all this time anyway.
Maybe wait until python 3.8 goes eol next year and then come back to this?
vendors/pyproject.toml
Outdated
| python = "^3.8" | ||
|
|
||
| fastjsonschema = "^2.18.0" | ||
| importlib-resources = { version = ">=1.3", python = "<3.9" } |
There was a problem hiding this comment.
<3.9 is not helpful here: importlib-resources has to be either vendored with poetry-core, or not.
This is a decision that is made at make vendor/update time: it is not desirable that maintainers and contributors using different python versions get different answers
There was a problem hiding this comment.
I've removed the vendored code per #670 (comment)
|
I'd like to avoid additional vendoring, too. An alternative to waiting for the EOL of Python 3.8 might be to keep the old way for Python 3.8 and only use |
That makes sense to me 👍 |
* Removed `importlib_resources` and `zipp` vendored code * Continue using `__file__` in Python 3.8 * Only use `importlib.resources` in Python >= 3.9
|
Kudos, SonarCloud Quality Gate passed!
|
|
@radoering @dimbleby this is ready for another review 🙂 |








Again, this is one step towards resolving python-poetry/poetry#2965.
Another attempt after #668 fell through.