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

Introduce a helper function for deprecation #5542

Merged
merged 9 commits into from
Jul 19, 2018

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Jun 27, 2018

Built on top of #5523

Replaces the current deprecation setup with one which has a single function -- the new deprecated function also includes 3 optional parameters:

  • Issue number: that gets converted into a URL (to guide users to a dedicated issue if needed)
  • Replacement: Provide a way to suggest alternatives to the functionality deprecated.
  • Gone In: Specifies which version of pip the functionality would be removed in.

Providing these should make it easier for users to reach places with more context and also make it more explicit that users need to be provided advice about how to deal with the deprecation.

@pradyunsg pradyunsg added skip news Does not need a NEWS file entry (eg: trivial changes) type: maintenance Related to Development and Maintenance Processes labels Jun 27, 2018
@pradyunsg pradyunsg added this to the 18.0 milestone Jun 27, 2018
@pradyunsg pradyunsg self-assigned this Jun 27, 2018
@pradyunsg pradyunsg added the !release blocker Hold a release until this is resolved label Jun 27, 2018
@dstufft
Copy link
Member

dstufft commented Jun 28, 2018

One thing I don't like about this, is it removes the note about when a particular deprecation can be removed. I think that's important because otherwise we'll end up with stuff that has been marked deprecated for ages that we've just forgotten exists. Now that we have date based releases, it should be pretty easy to handle this though (easier than the old way), just set the version it's going to be removed in, and once we're at that version, raise exceptions instead of warnings so that our tests break and force us to remove them.

@pradyunsg
Copy link
Member Author

I wasn't sure how the logic should behave if we skipped a release for the year. Say something had to go away in 19.3 but we skipped 19.2 in the first release month for it so, it came 3 months later. How should the deprecation warnings/errors behave (19.3 could also be 20.1 or something instead)?

@dstufft
Copy link
Member

dstufft commented Jul 5, 2018

I wouldn't skip version numbers, if 19.2 is the next version, it should be the next version, unless we roll over to the next year. However, maybe the better thing to do is instead of making the deprecation policy release based, we make it time based as well. We can say that our policy is items will emit deprecation warnings for at least 6 months (so that's 2 releases worth of deprecation warnings).

You can then just do a >= check on the release, version. For instance:

Jan - 19.0 - Thing #1 gets Deprecated, mark as remove in >= 19.2
Apr - 19.1
Jul - 19.2 - This release gets skipped for reasons
Oct - 19.2 - This is >= 19.2, so we remove Thing #1, it was left for 9mo instead of 6mo, but that's OK.

Or another scenario:

Jan - 19.0 - Thing #1 gets Deprecated, mark as remove in >= 19.2
Apr - 19.1
Jul - 19.2 - This release gets skipped for reasons
Oct - 19.2 - This release also gets skipped for reasons.
Jan - 20.0 - 20.0 is >= 19.2, so Thing #1 gets removed.

@dstufft
Copy link
Member

dstufft commented Jul 5, 2018

#5572 has some recommended language to adjust the deprecation policy by.

@pradyunsg
Copy link
Member Author

I don't think there's much to gain from preserving the current logger.warning -> logger.error progression. Does anyone mind if I remove that? If so, please let me know what logic you'd want to apply for deciding between which method to use.

@dstufft
Copy link
Member

dstufft commented Jul 5, 2018

I'm fine with getting rid of it.

@pradyunsg
Copy link
Member Author

Cool. This should work.


PS: GitHub did a good job at suggesting people to request a review from. :)

screen shot 2018-07-06 at 2 24 45 pm

@dstufft
Copy link
Member

dstufft commented Jul 6, 2018

One thing I'd like to add to this, is a little bit of documentation in the deprecation policy area about how to use this function, and what values should be passed into this.

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Jul 10, 2018
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Jul 15, 2018
@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Jul 15, 2018
@pradyunsg
Copy link
Member Author

I noticed @BrownTruck -- was running tests locally after a rebase to make sure I did it correctly.

(why am I talking to a bot)

@pradyunsg pradyunsg force-pushed the dev-ops/deprecation-utilities branch from 2df090a to 74dd124 Compare July 15, 2018 11:43
@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Jul 15, 2018
Also:
- Remove conditional warning/error level logging
- Remove now-obsolete class
- Update call sites as per new signature
@pradyunsg pradyunsg force-pushed the dev-ops/deprecation-utilities branch from 74dd124 to b6dae7a Compare July 15, 2018 11:46
@pradyunsg
Copy link
Member Author

@dstufft Anything else?

@pradyunsg pradyunsg merged commit 169ca95 into pypa:master Jul 19, 2018
@pradyunsg pradyunsg removed the !release blocker Hold a release until this is resolved label Jul 22, 2018
@pradyunsg pradyunsg deleted the dev-ops/deprecation-utilities branch August 13, 2018 17:59
@lock
Copy link

lock bot commented Jun 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: maintenance Related to Development and Maintenance Processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants