-
Notifications
You must be signed in to change notification settings - Fork 254
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
Use importlib.resources to load json schemas & spdx version #668
Use importlib.resources to load json schemas & spdx version #668
Conversation
This is part of the fix for python-poetry/poetry#2965. Constructing a regression integration test that uses a zipapp like environment would be useful but is not part of this PR.
for more information, see https://pre-commit.ci
CI seems to be failing due to unrelated pre-existing static type analysis issues from mypy that exist on
|
…ormation prevents debugging.
the pipeline is failing because you have updated mypy - either fix the type annotations, or dont do that! ( having said which poetry-core vendors dependencies rather than requiring them to be downloaded when it is used as a build-backend - so probably that is what you actually should do |
for more information, see https://pre-commit.ci
Per advice given on the PR.
Technically accurate, but here's why: I'd expect any new contributor unfamiliar with poetry to his this problem. I found no instructions on how to build and test anything or update the lock file in this repo. So I resorted to manually running commands seen in .github/workflows/tests.yml. The If you write a contributors guide that describes things like this, it'd help anyone making future PRs. |
per my last, you don't actually want to add this dependency in that pyproject.toml at all, it wants to be vendored the version-dependent import wants hiding away in utils/_compat.py (the main poetry repository has a similar file and does the same for importlib-metadata, copying that should be defensible) |
Please retry analysis of this Pull-Request directly on SonarCloud. |
Okay, i've spend more time than this is worth attempting to make what I thought was a simple change. I'll leave this to someone familiar with the more complicated than anticipated internals of this project to take over and complete. |
This is part of the solution for python-poetry/poetry#2965.
Constructing a regression integration test that uses a zipapp like environment would be useful but is not part of this PR.
Currently unclear to me what additional testing is required to accept this. I'm making the PR because this change works for one use case for us within our custom bundled app environment and it passes this repo's tests/ and tests/integration suites. I'm curious to see what your Github CI runs turn up.
Does this need documentation beyond the changelog? It's an internal implementation detail change.
I have not audited the code looking for other resource loading code paths so some may exist, thus no claim that this actually completely fixes the related issue. It works for our own limited usage at work on 3.10+ and hasn't tickled and tripped over things yet. (in particular I see more in the main poetry repo, not just poetry-core such as poetry's
src/json/__init__.py
being similar to this repo'ssrc/poetry/core/json/__init__.py
- but that'd be another PR in the other repo).