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

Warn when patch isn't specified #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ianpaul10
Copy link
Owner

@ianpaul10 ianpaul10 commented Oct 4, 2024

When patch version isn't specified and a matching version is referenced, it will default patch to 0 which could be unclear/confusing. This PR warns the user of that default.

Summary

The first part of this issue astral-sh#7426. Will tackle the second part mentioned (~=) in a separate PR once I know this is the correct way to warn users.

Test Plan

cargo run --features tracing -- pip install black==24.8 --verbose should result in a warning message:

WARN Specified version `24.8` will be interpreted as `24.8.0`. Did you mean `24.8.*`?

I couldn't find a good example of test cases for warn function calls and didn't know the best way to add it, but more than happy to do so. If someone could point me in the right direction that would be much appreciated :)

@ianpaul10 ianpaul10 force-pushed the feat/warn-on-pin-py-ver branch 5 times, most recently from aefc391 to 653eb84 Compare October 11, 2024 08:37
@ianpaul10 ianpaul10 force-pushed the feat/warn-on-pin-py-ver branch 8 times, most recently from c574fdf to 6358b10 Compare October 12, 2024 08:43
@ianpaul10 ianpaul10 force-pushed the feat/warn-on-pin-py-ver branch 4 times, most recently from 0a2f0c7 to 711ab6e Compare October 14, 2024 12:44
Warn when requires-python is set to an exact value (==) and doesn't include a patch (so it'll get set to 0)
@ianpaul10 ianpaul10 force-pushed the feat/warn-on-pin-py-ver branch from 711ab6e to 708cd3d Compare October 16, 2024 02:34
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