-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix populate python constraints from markers #261
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,6 +243,7 @@ def create_dependency( | |
from poetry.core.packages.file_dependency import FileDependency | ||
from poetry.core.packages.url_dependency import URLDependency | ||
from poetry.core.packages.utils.utils import create_nested_marker | ||
from poetry.core.packages.utils.utils import get_python_constraint_from_marker | ||
from poetry.core.packages.vcs_dependency import VCSDependency | ||
from poetry.core.semver.helpers import parse_constraint | ||
from poetry.core.version.markers import AnyMarker | ||
|
@@ -366,6 +367,10 @@ def create_dependency( | |
) | ||
else: | ||
marker = parse_marker(markers) | ||
# possibility that python constraint appears in markers, not keywords | ||
if not python_versions and markers: | ||
python_versions_marker = get_python_constraint_from_marker(marker) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just |
||
python_versions = python_versions_marker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The result of this parse is never used, is it? The test that you have added passes without the fix, which is consistent with this not doing anything. Can you add a test that fails before the fix, and passes after it? |
||
|
||
if not marker.is_any(): | ||
dependency.marker = marker | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
markers
is known truth-y here, isn't it, making this check redundant?