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 special case of get_python_constraint_from_marker() and SingleMarker.only() #307

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

radoering
Copy link
Member

@radoering radoering commented Mar 12, 2022

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

This PR fixes the util function get_python_constraint_from_marker() by fixing SingleMarker.only().

Given a marker not containing python_version or python_full_version (e.g. 'sys_platform == "linux"'), any python version should be allowed. Thus, get_python_constraint_from_marker() should return "*". Analogously, only("python_version") on a SingleMarker 'sys_platform == "linux"' should return AnyMarker() instead of EmptyMarker() because if python_version is not mentioned, any version is fine.

If the last point seems counterintuitive, keep in mind that "" (empty string) does not represent EmptyMarker but AnyMarker.

Rationale: This fix enables further improvements to reduce the number of overrides in poetry's dependency resolution.

@sonarcloud
Copy link

sonarcloud bot commented Mar 12, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
1.8% 1.8% Duplication

@radoering radoering requested a review from a team March 12, 2022 18:41
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.

2 participants