-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Deprecate pip-compile --resolver=legacy
#1724
Deprecate pip-compile --resolver=legacy
#1724
Conversation
for more information, see https://pre-commit.ci
pip-compile --resolver=legacy
Now, tests that check the exact output in stderr are failing due to the deprecation warning. I'll address that in a separate PR. |
Maybe try using |
@webknjaz if so, what's the motivation? |
@@ -378,6 +378,13 @@ def cli( | |||
if isinstance(output_file, LazyFile): # pragma: no cover | |||
ctx.call_on_close(safecall(output_file.close_intelligently)) | |||
|
|||
if resolver_name == "legacy": | |||
log.warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using Deprecation warnings from warning module? Somehow I find it better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.python.org/3/library/exceptions.html#DeprecationWarning
DeprecationWarning
Base class for warnings about deprecated features when those warnings are intended for other Python developers.
DeprecaetionWarning
is intended for developers, but pip-tools prints warning for end users. Also, it is "Ignored by the default warning filters", so it should be FutureWarning or something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I don't mind using the warning module if you feel that's better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I +1 because it was only an observation. I am ok with both approaches. The real benefit of warnings is that they are very easy to silence from outside the application.
@atugushev the motivation is that it's easier to test. Plus if you actually put the warning in the resolution code, it'd be easier to trace what to remove later. |
Resolves #1659
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.