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

merging python_version and python_full_version markers #294

Conversation

dimbleby
Copy link
Contributor

Resolves: python-poetry#

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

recognise that python_version and python_full_version markers say much the same thing and often can be merged

As an example of the difference this makes, the poetry export testcase that I have added in python-poetry/poetry#5156 sees the following diff when using this fix:

- click-didyoumean==0.3.0 ; python_full_version >= "3.6.2" and python_full_version < "4.0.0" and python_version >= "3.7" and python_version < "4.0"
+ click-didyoumean==0.3.0 ; python_version >= "3.7" and python_full_version < "4.0.0"
- click==7.1.2 ; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.7" or python_version >= "3.6" and python_version < "3.7" and python_full_version >= "3.5.0"
+ click==7.1.2 ; python_version >= "3.6" and python_version < "3.7"
- click==8.0.3 ; python_version >= "3.7" and python_version < "4.0" or python_full_version >= "3.6.2" and python_full_version < "4.0.0" and python_version >= "3.7" and python_version < "4.0"
+ click==8.0.3 ; python_version >= "3.7" and python_version < "4.0" or python_version >= "3.7" and python_full_version < "4.0.0"

The last click marker is not quite perfect, in ideal world we'd recognise that python_version < "4.0" was the same as python_full_version < "4.0.0" and then merge things - but it's a substantial improvement.

@dimbleby dimbleby force-pushed the python-version-and-python-full-version branch from 09be92a to bd5044c Compare February 26, 2022 12:19
@sonarcloud
Copy link

sonarcloud bot commented Feb 26, 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 2 Code Smells

No Coverage information No Coverage information
0.4% 0.4% Duplication

@dimbleby
Copy link
Contributor Author

rebased following merge of #282 and #293, including simplification per suggestion of #294 (comment)

@neersighted neersighted merged commit dd7b2fe into python-poetry:master Feb 28, 2022
@finswimmer finswimmer mentioned this pull request Feb 28, 2022
@dimbleby dimbleby deleted the python-version-and-python-full-version branch February 28, 2022 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants