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

Update the deprecation decorator towards SemVer #11296

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

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Nov 22, 2023

The current deprecate decorators extend the docstring with the following:

current

I suggest the following to be aligned with Qiskit/documentation#366

suggestion

@1ucian0 1ucian0 requested review from woodsp-ibm and a team as code owners November 22, 2023 15:15
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@1ucian0 1ucian0 added this to the 1.0.0 milestone Nov 22, 2023
@1ucian0 1ucian0 added the type: qa Issues and PRs that relate to testing and code quality label Nov 22, 2023
@@ -27,7 +27,7 @@ def deprecate_func(
additional_msg: str | None = None,
pending: bool = False,
package_name: str = "qiskit",
removal_timeline: str = "no earlier than 3 months after the release date",
removal_timeline: str = "in the next major release",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine, but we should have sufficient info to compute the next major version from the since field. We could set this to None and then do something like:

if removal_timeline is None:
    removal_major = int(since.split(",")[0]) + 1
    removal_timeline = f"in the next major release {removal_major}"

Or if you're worried about deprecated features passing a major version boundary (e.g. we deprecate something in 1.0 and don't remove it until 3.0) we can replace since with the package's __version__.

Copy link
Member Author

@1ucian0 1ucian0 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good one! Done in cd47576

However, replacing since with __version__ might be tricky. If a features was deprecated in 1.1.0, we want to keep that since after the release of 1.2.0. Or am I missing something?

1ucian0 and others added 3 commits November 23, 2023 09:59
@coveralls
Copy link

coveralls commented Nov 23, 2023

Pull Request Test Coverage Report for Build 7716377393

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 841 unchanged lines in 74 files lost coverage.
  • Overall coverage increased (+0.1%) to 89.457%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/sabre_swap/mod.rs 1 97.42%
qiskit/circuit/classical/types/ordering.py 1 94.64%
qiskit/circuit/controlflow/control_flow.py 1 92.86%
qiskit/circuit/library/standard_gates/global_phase.py 1 95.83%
qiskit/circuit/library/standard_gates/rx.py 1 98.55%
qiskit/circuit/library/standard_gates/ry.py 1 98.51%
qiskit/circuit/library/standard_gates/ryy.py 1 97.3%
qiskit/circuit/library/standard_gates/rz.py 1 98.46%
qiskit/circuit/library/standard_gates/rzz.py 1 97.06%
qiskit/circuit/library/standard_gates/swap.py 1 98.08%
Totals Coverage Status
Change from base Build 7508541254: 0.1%
Covered Lines: 59550
Relevant Lines: 66568

💛 - Coveralls

@1ucian0 1ucian0 modified the milestones: 1.0.0, 1.0.0pre1, 0.46.0 Nov 27, 2023
@1ucian0 1ucian0 changed the base branch from main to stable/0.46 November 27, 2023 16:08
@1ucian0 1ucian0 changed the base branch from stable/0.46 to main November 27, 2023 16:08
@1ucian0
Copy link
Member Author

1ucian0 commented Jan 15, 2024

@Mergifyio backport stable/0.46

Copy link
Contributor

mergify bot commented Jan 15, 2024

backport stable/0.46

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As weird as this is to ask for on a deprecation decorator, I think this needs a release note as this is a public documented function and we're adding a new option and changing the default behavior. It will need a feature release note and an upgrade note as existing users who don't set removal_timeline will get different messages after upgrading qiskit.

@mtreinish
Copy link
Member

Given that rc1 is supposed to go out today, I'm going to defer this to 1.1. We'll have to rework this PR to not be a breaking api change for 1.1, but I think that's manageable.

@mtreinish mtreinish modified the milestones: 1.0.0, 1.1.0 Feb 1, 2024
@jakelishman jakelishman modified the milestones: 1.1.0, 1.2.0 Apr 18, 2024
@ElePT ElePT modified the milestones: 1.2.0, 1.3.0 Jul 23, 2024
@mtreinish mtreinish modified the milestones: 1.3.0, 2.0.0 Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants