Conversation
abn
left a comment
There was a problem hiding this comment.
Looking forward to seeing this in action. A few minor comments.
poetry/mixology/version_solver.py
Outdated
| self, | ||
| root, # type: ProjectPackage | ||
| provider, # type: Provider | ||
| provider, |
There was a problem hiding this comment.
Is there a reason why we are dropping the type hint here?
There was a problem hiding this comment.
I don't remember exactly. I thin I got a cyclic import error at some point due to this import. I can check again to see if we really need to remove it.
There was a problem hiding this comment.
So, I just checked and we need to remove it to avoid a cyclic import error
There was a problem hiding this comment.
mypy/typing actually has a solution for just this problem! https://mypy.readthedocs.io/en/stable/common_issues.html#import-cycles
tl;dr:
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from poetry.puzzle.provider import ProviderFixed!
| category = "main" | ||
| description = "Manage Python errors with ease" | ||
| marker = "python_version >= \"3.6\" and python_version < \"4.0\"" | ||
| name = "crashtest" |
There was a problem hiding this comment.
I can see crashtest on pypi but not on github, is this expected?
There was a problem hiding this comment.
It's not open source yet, I need to write a proper README for the project first. It should be ready tomorrow.
There was a problem hiding this comment.
| @@ -0,0 +1,3 @@ | |||
| from .python_requirement_incompatibility_solution_provider import ( | |||
There was a problem hiding this comment.
These modules are a mouth full :) Would be great to put them into a structure, eg poetry.solutions.providers.incompatibility.python_requreiment.
Would solutions be better placed in poetry.mixology consdiering we only really provide solutions for version solving issues or is the intent here to provide a generic mechanism?
There was a problem hiding this comment.
I wanted them to be as explicit as possible :-) But yeah I can see if we can reorganize a bit.
The idea is to extend the solutions beyond solver issues, for instance for configuration and validation errors.
There was a problem hiding this comment.
So, I reorganized a bit and now each module (in this case mixology) can provide its own solutions and providers.
This allows for a more flexible implementation.
d2f8cda to
2196064
Compare
2196064 to
0341e52
Compare
0341e52 to
3eda75a
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Resolves: #2386
Resolves: #2076
Resolves: #2054
Resolves: #1930
This PR adds a way to provide solutions for common errors that users may encounter while using Poetry.
For now, the only solution implemented is for the resolution process failures due to Python requirements incompatibilities, which is the most common source of confusion regarding the way the resolver works.
This will serve as the base implementation for future solutions that we might want to add to provide an overall better user experience.
Here is an example: