Skip to content

Conversation

@pavoljuhas
Copy link
Collaborator

  • Add helper module cirq_rigetti.deprecation
  • Add deprecation warnings for public functions and classes
  • Let deprecation wrappers detect cirq_rigetti tests
  • Suppress Cirq-Rigetti deprecation warnings in cirq_rigetti tests
  • Add deprecation note to the Cirq-Rigetti README

Partially implements #7058

@pavoljuhas pavoljuhas requested review from a team and vtomole as code owners March 22, 2025 07:38
Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

LGTM with a trivial typo in the readme and a question in setup.py.

<div align="center">
| ⚠️ WARNING |
|:----------:|
| **Cirq-Rigetti is deprecated. For more details or to provide feedback see https://github.com/quantumlib/Cirq/issues/7058 |
Copy link
Contributor

Choose a reason for hiding this comment

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

The closing ** seems to be missing. Was it meant to go after the word "deprecated"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was not supposed to be there at all, thanks for catching that. The table was also not rendering correctly on GH. Should be fixed by 295cb65.

"unstable. For the latest stable release of `cirq-rigetti`,<br>"
"please visit** <https://pypi.org/project/cirq-rigetti>.|\n"
"\n</div>\n\n" + long_description
)
Copy link
Contributor

@mhucka mhucka Mar 23, 2025

Choose a reason for hiding this comment

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

Is this removed because we will not provide a cirq-rigetti package on PyPI with the Cirq 1.5 release?

(If there will still be a cirq-rigetti, maybe it would be best to include a notice about deprecation here instead?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This notice goes to dev releases of cirq-rigetti and gets inserted to the beginning of their README. It would be confusing for those releases to state "This is a development version" followed by "Cirq-Rigetti is deprecated". This just leaves it with the deprecation notice every time.

@mhucka
Copy link
Contributor

mhucka commented Mar 23, 2025

Also, thank you for doing this PR.

@mhucka
Copy link
Contributor

mhucka commented Mar 23, 2025

In trying to run check/doctest after creating a virtualenv using dev_tools/requirements/dev-np2.env.txt, I found I had to modify check/doctest to make it ignore the rigetti module:

diff --git a/dev_tools/docs/run_doctest.py b/dev_tools/docs/run_doctest.py
index 903f8f46..e4bac541 100755
--- a/dev_tools/docs/run_doctest.py
+++ b/dev_tools/docs/run_doctest.py
@@ -228,6 +228,7 @@ def main():
     file_names = glob.glob('cirq**/cirq**/**/*.py', recursive=True)
     assert file_names
     excluded = [
+        'cirq-rigetti/',
         'cirq-google/cirq_google/api/',
         'cirq-google/cirq_google/cloud/',
         'cirq-web/cirq_ts/node_modules/',

Is there a way to conditionalize this using the deprecation classes you created?

cirq_rigetti is deprecated and does not define doctests anyway.
Avoid having to install cirq-rigetti for doctests.
@pavoljuhas
Copy link
Collaborator Author

In trying to run check/doctest after creating a virtualenv using dev_tools/requirements/dev-np2.env.txt, I found I had to modify check/doctest to make it ignore the rigetti module:
...
Is there a way to conditionalize this using the deprecation classes you created?

cirq-rigetti does not define any doctest so we can hardcode it. Done in fac1c4b, thanks for the suggestion!

@codecov
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (71c3cf1) to head (b53ea3e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7176    +/-   ##
========================================
  Coverage   98.13%   98.13%            
========================================
  Files        1095     1096     +1     
  Lines       95649    95806   +157     
========================================
+ Hits        93867    94024   +157     
  Misses       1782     1782            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavoljuhas pavoljuhas added this pull request to the merge queue Mar 24, 2025
Merged via the queue into quantumlib:main with commit ea1679d Mar 24, 2025
1 check passed
@pavoljuhas pavoljuhas deleted the deprecate-cirq-rigetti branch March 24, 2025 23:18
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
* Add deprecation helper module for cirq_rigetti

Adapt similar module from quantumlib#6362

* Add deprecation warnings for public functions and classes

Skip deprecations for internal functions.

* Let deprecation wrappers detect cirq_rigetti tests

* Suppress Cirq-Rigetti deprecation warnings in cirq_rigetti tests

Deprecated cirq objects are not allowed in tests otherwise.

* Add deprecation note to Cirq-Rigetti README

Turn off README adjustments for development releases.

* Fix rendering of deprecation notice in Rigetti README

* Exclude cirq-rigetti when searching for doctests

cirq_rigetti is deprecated and does not define doctests anyway.
Avoid having to install cirq-rigetti for doctests.

* Address deprecation errors in JSON serialization tests

Mark up cirq_rigetti classes as deprecated.

* Avoid deprecation errors in hash_from_pickle_test.py

Exclude deprecated cirq_rigetti classes from testing.

* Fix pylint (consider-using-f-string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants