-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
246 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .python_requirement_incompatibility_solution_provider import ( | ||
PythonRequirementIncompatibilitySolutionProvider, | ||
) |
32 changes: 32 additions & 0 deletions
32
poetry/solution_providers/python_requirement_incompatibility_solution_provider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import re | ||
|
||
from typing import List | ||
|
||
from crashtest.contracts.has_solutions_for_exception import HasSolutionsForException | ||
from crashtest.contracts.solution import Solution | ||
|
||
|
||
class PythonRequirementIncompatibilitySolutionProvider(HasSolutionsForException): | ||
def can_solve(self, exception): # type: (Exception) -> bool | ||
from poetry.puzzle.exceptions import SolverProblemError | ||
|
||
if not isinstance(exception, SolverProblemError): | ||
return False | ||
|
||
m = re.match( | ||
"^The current project's Python requirement (.+) is not compatible " | ||
"with some of the required packages Python requirement", | ||
str(exception), | ||
) | ||
|
||
if not m: | ||
return False | ||
|
||
return True | ||
|
||
def get_solutions(self, exception): # type: (Exception) -> List[Solution] | ||
from poetry.solutions.python_requirement_compatibility_solution import ( | ||
PythonRequirementCompatibilitySolution, | ||
) | ||
|
||
return [PythonRequirementCompatibilitySolution(exception)] |
Empty file.
Oops, something went wrong.