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 18 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

Other consequences:

  • As part of this change, since= parameter should be a string. Sometimes, we accidentally use floats for it which is not correct in the generic case. So, it is good to raise in those cases.

@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?

@coveralls
Copy link

coveralls commented Nov 23, 2023

Pull Request Test Coverage Report for Build 13319018940

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 29 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 88.21%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 91.73%
crates/qasm2/src/parse.rs 24 95.76%
Totals Coverage Status
Change from base Build 13318724701: -0.03%
Covered Lines: 78581
Relevant Lines: 89084

💛 - 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
Copy link
Contributor

mergify bot commented Jan 15, 2024

backport stable/0.46

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

@mtreinish mtreinish self-assigned this Jan 29, 2024
@1ucian0 1ucian0 modified the milestones: 0.46.0, 1.0.0 Jan 29, 2024
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
@1ucian0 1ucian0 self-assigned this Feb 6, 2025
@1ucian0 1ucian0 added the API affects user-facing API change label Feb 13, 2025
@1ucian0
Copy link
Member Author

1ucian0 commented Feb 13, 2025

@Mergifyio dequeue

Copy link
Contributor

mergify bot commented Feb 13, 2025

dequeue

☑️ The pull request is not queued

@1ucian0
Copy link
Member Author

1ucian0 commented Feb 13, 2025

I think this needs a release note as this is a public documented function and we're [...] changing the default behavior.

Done in 97a2740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API affects user-facing API change 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