"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "poetry/mixology/solutions/providers/python_requirement_solution_provider.py" between
poetry-1.1.15.tar.gz and poetry-1.2.0.tar.gz

About: Poetry is a tool for dependency management and packaging in Python.

python_requirement_solution_provider.py  (poetry-1.1.15):python_requirement_solution_provider.py  (poetry-1.2.0)
from __future__ import annotations
import re import re
from typing import List from typing import TYPE_CHECKING
from crashtest.contracts.has_solutions_for_exception import HasSolutionsForExcep tion from crashtest.contracts.has_solutions_for_exception import HasSolutionsForExcep tion
from crashtest.contracts.solution import Solution
class PythonRequirementSolutionProvider(HasSolutionsForException): if TYPE_CHECKING:
def can_solve(self, exception): # type: (Exception) -> bool from crashtest.contracts.solution import Solution
from poetry.puzzle.exceptions import SolverProblemError
class PythonRequirementSolutionProvider(HasSolutionsForException): # type: igno
re[misc]
def can_solve(self, exception: Exception) -> bool:
from poetry.puzzle.exceptions import SolverProblemError from poetry.puzzle.exceptions import SolverProblemError
if not isinstance(exception, SolverProblemError): if not isinstance(exception, SolverProblemError):
return False return False
m = re.match( m = re.match(
"^The current project's Python requirement (.+) is not compatible " "^The current project's Python requirement (.+) is not compatible "
"with some of the required packages Python requirement", "with some of the required packages Python requirement",
str(exception), str(exception),
) )
if not m: return bool(m)
return False
return True
def get_solutions(self, exception): # type: (Exception) -> List[Solution] def get_solutions(self, exception: SolverProblemError) -> list[Solution]:
from ..solutions.python_requirement_solution import PythonRequirementSol from poetry.mixology.solutions.solutions.python_requirement_solution imp
ution ort (
PythonRequirementSolution,
)
return [PythonRequirementSolution(exception)] return [PythonRequirementSolution(exception)]
 End of changes. 6 change blocks. 
11 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)