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

Doing a soft comparison with --required-version instead of a hard one. #2831

Closed
freud14 opened this issue Jan 30, 2022 · 5 comments
Closed
Labels
C: configuration CLI and configuration S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: enhancement New feature or request

Comments

@freud14
Copy link
Contributor

freud14 commented Jan 30, 2022

Is your feature request related to a problem? Please describe.

Since Black just made it as stable, it would be nice to be able to set the --required-version argument to something else other than a strict equality. For instance, something like 22 would encompass 22.1.0, 22.1.1, 22.2.0, etc.

Describe the solution you'd like

The solution would essentially be to modify this line to a more soft comparison:

if required_version and required_version != __version__:

@freud14 freud14 added the T: enhancement New feature or request label Jan 30, 2022
@felix-hilden felix-hilden added the C: configuration CLI and configuration label Jan 30, 2022
@felix-hilden
Copy link
Collaborator

felix-hilden commented Jan 30, 2022

Fair request! We could break the version down into its parts and only compare until the specification ends. So e.g. 22.1 would accept 22.1.1 as well, and 22 would accept everything this year.

@JelleZijlstra
Copy link
Collaborator

Yes, this is a good idea.

I think we only need to accept the year, since that lets you use the stable style. I don't think 22.1 makes much sense, as we provide no guarantee that releases that happen to fall within the same month are more compatible.

@felix-hilden
Copy link
Collaborator

Oh right, there's not really a point in going for more detail when the intention of the option was to require a certain style.

@JelleZijlstra JelleZijlstra added the S: accepted The changes in this design / enhancement issue have been accepted and can be implemented label Jan 30, 2022
@freud14
Copy link
Contributor Author

freud14 commented Jan 30, 2022

Juste made PR #2832. Let me know what you think.

@ichard26
Copy link
Collaborator

Oh, by the way, you can use special keywords in the PR description so GitHub will automatically close an issue upon merge. You can read more here: https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword. This makes sure any issue that should be closed are in fact closed (and I won't have to go proactively hunt for such issues!), keeping our very chaotic issue tracker ever so slightly less chaotic and scary :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: configuration CLI and configuration S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants