Skip to content

Commit

Permalink
fix typing for ProjectPackage.python_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Mar 17, 2022
1 parent 5c741e6 commit c7e2816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/poetry/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _add_package_group_dependencies(
)
for _constraint in _constraints:
if name.lower() == "python":
if group.name == "default":
if group.name == "default" and isinstance(_constraint, str):
package.python_versions = _constraint
continue

Expand Down
4 changes: 2 additions & 2 deletions src/poetry/core/packages/project_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def to_dependency(self) -> Union["DependencyTypes"]:
return dependency

@property
def python_versions(self) -> Union[str, "VersionConstraint"]:
def python_versions(self) -> str:
return self._python_versions

@python_versions.setter
def python_versions(self, value: Union[str, "VersionConstraint"]) -> None:
def python_versions(self, value: str) -> None:
from poetry.core.semver.version_range import VersionRange

self._python_versions = value
Expand Down

0 comments on commit c7e2816

Please sign in to comment.