Skip to content
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

Conversation

maciejskorski
Copy link

Resolves: python-poetry#

  • Added tests for changed code.
  • Updated documentation for changed code.

@sonarcloud
Copy link

sonarcloud bot commented Jan 2, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell D 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -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:
Copy link
Contributor

@dimbleby dimbleby Jan 26, 2022

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?

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just python_versions = get_python_constraint_from_marker(marker)?

# possibility that python constraint appears in markers, not keywords
if not python_versions and markers:
python_versions_marker = get_python_constraint_from_marker(marker)
python_versions = python_versions_marker
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

@radoering
Copy link
Member

Should be fixed by #284 and/or #324. If there's still an issue feel free to reopen.

@radoering radoering closed this May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants