diff --git a/poetry/core/packages/dependency.py b/poetry/core/packages/dependency.py index 6a25ccdf9..c648a4b6a 100755 --- a/poetry/core/packages/dependency.py +++ b/poetry/core/packages/dependency.py @@ -44,13 +44,8 @@ def __init__( features=extras, ) - try: - if not isinstance(constraint, VersionConstraint): - self._constraint = parse_constraint(constraint) - else: - self._constraint = constraint - except ValueError: - self._constraint = parse_constraint("*") + self._constraint = None + self.set_constraint(constraint=constraint) self._pretty_constraint = str(constraint) self._optional = optional @@ -86,6 +81,15 @@ def name(self): def constraint(self): return self._constraint + def set_constraint(self, constraint): + try: + if not isinstance(constraint, VersionConstraint): + self._constraint = parse_constraint(constraint) + else: + self._constraint = constraint + except ValueError: + self._constraint = parse_constraint("*") + @property def pretty_constraint(self): return self._pretty_constraint diff --git a/pyproject.toml b/pyproject.toml index 4e77b7945..30bb53108 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,9 +53,6 @@ vendoring = {version = "^0.3", python = "~3.8"} pep517 = "^0.8.2" "backports.tempfile" = {version = "^1.0", python = "~2.7"} -[tool.intreehooks] -build-backend = "poetry.core.masonry.api" - [tool.black] line-length = 88 include = '\.pyi?$' @@ -119,5 +116,6 @@ appdirs = [] pyrsistent = "https://raw.githubusercontent.com/tobgu/pyrsistent/master/LICENCE.mit" [build-system] -requires = ["intreehooks"] -build-backend = "intreehooks:loader" +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" +backend-path = ["."]