Skip to content

Conversation

IvanIsCoding
Copy link
Collaborator

@IvanIsCoding IvanIsCoding commented Apr 6, 2025

I am removing retworkx, it has been more than one year since it was deprecated in #1004. This totals 2 years since the project changed names.

I am also profiting to embrace pyproject.toml more. This is motivated by #1416, in general the prospect for most projects is to consolidate most data in pyproject.toml.

edit: we set this release as the last one depending on rustworkx, I had to use a separate setup.py file for this. In short, the retworkx code now is nested in a folder. We have setup.py that reads from our own pyproject.toml in the root. The code is now in retworkx/retworkx given the new folder setup.

@IvanIsCoding
Copy link
Collaborator Author

IvanIsCoding commented Apr 6, 2025

I confirmed that the generated metadata in the wheel is correct: https://gist.github.com/IvanIsCoding/135b258198742f49111736ab537b2729

I just need to investigate why the coverage test failed and then this should be good to go.

Edit: setuptools need to be slightly newer than the default that ships with 3.10; still, our rustc is newer than that; after coveralls comes back from maintenance we should be able to merge

@IvanIsCoding
Copy link
Collaborator Author

Qiskit/qiskit#10958, Qiskit did this a while ago. Although for the Rust part we are moving it to pyproject.toml, which Qiskit hasn't done yet.

@coveralls
Copy link

coveralls commented Apr 7, 2025

Pull Request Test Coverage Report for Build 14787409875

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 95.246%

Totals Coverage Status
Change from base Build 14785745115: 0.01%
Covered Lines: 18732
Relevant Lines: 19667

💛 - Coveralls

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.

Overall I like the change here I had a couple of questions inline but nothing major.

My biggest concern is over the retworkx shim removal. I had originally planned (and think we might have documented at the time) that we'd drop the shim in rustworkx 1.0. Personally I'm actually fine if we wanted to take this as the indication that the next release is 1.0 even if it leads to longer baking time until we release. I think we've basically been treating things like we're already committed to api compatibility in that way already so it's more taking the opportunity to clean up any interfaces.

I am also thinking we might want to do one final retworkx release first though, that says it is retired. Right now we say:

retworkx is the deprecated package name for rustworkx. If you're using the retworkx package (either as a requirement or an import) this should be updated to use rustworkx instead. In the future only the rustworkx name will be supported.

We could make that a bit more definitive and say retworkx is the former name and it is not supported any longer, rustworkx should be used instead.

@IvanIsCoding
Copy link
Collaborator Author

I might hold on the retworkx removal and have something along these lines then:

if not retworkx_build:
    setup()
else:
    setup(name="retworkx", ...)

Thay way, we can give a final notice to retworkx users

@IvanIsCoding
Copy link
Collaborator Author

I have an idea on how to make this work. We'll need to move retworkx to its own folder but it will be trivial

@IvanIsCoding
Copy link
Collaborator Author

Minor update, but I read https://www.reddit.com/r/Python/comments/1jwbymm/psa_you_should_remove_wheel_from_your/ so I discovered:

  • we can require newer versions of setuptools and setuptools-rust that support what we document in the README via PEP 517. It turns out the requirements supports version specifiers
  • we no longer need wheel

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.

Thanks for the updates, overall this is looking quite good now. I left some inline suggestions to add the linting for retworkx back. Until we release 0.17.0 we should still be running those in the remote chance there is a change made to the code there. I think it's good to merge now.

The only open question I have is did you validate the wheel and release jobs still function correctly? I don't expect any hiccups but for a change like this it's good to validate we're still building the release artifacts without issues.

@@ -202,12 +202,10 @@ jobs:
- name: Install deps
run: pip install -U setuptools-rust wheel build
- name: Build sdist
Copy link
Member

Choose a reason for hiding this comment

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

We're actually not building an sdist here not that it matters. Apparently we're only uploading a wheel for retworkx.

@IvanIsCoding
Copy link
Collaborator Author

I will address the comments but regarding:

The only open question I have is did you validate the wheel and release jobs still function correctly? I don't expect any hiccups but for a change like this it's good to validate we're still building the release artifacts without issues.

I built the wheel locally. Overall, the tests and specially the coverage test validate the wheel is valid. My biggest fear was the METADATA, but the links I posted above for the gist seem to identicate that gets included as well.

For wheels build, after I address all comments I will try to kick cibuildwheel. From inspecting how cibuildwheel, apart from retworkx, nothing should change. For retworkx, I ran the command locally to test so there's that.

IvanIsCoding and others added 3 commits April 17, 2025 22:57
@IvanIsCoding IvanIsCoding requested a review from mtreinish April 19, 2025 22:09
@IvanIsCoding
Copy link
Collaborator Author

Test run: https://github.com/IvanIsCoding/rustworkx/actions/runs/14553292059

I excluded macOS, PowerPC64, and s390x as those are more expensive for me to test on my personal project. But if Linux builds I think it should be all good. Windows is a bonus.

@IvanIsCoding
Copy link
Collaborator Author

IvanIsCoding commented Apr 19, 2025

@mtreinish there's a spurious failure from x86_64 I am retrying (rustup failed to install, unrelated) but we got some wheels in the first attempt. They look correct to me.

I think this is good to go.

edit: I opened #1432 but it is completely unrelated

@mtreinish mtreinish added this pull request to the merge queue May 5, 2025
Merged via the queue into Qiskit:main with commit 5ca23e1 May 5, 2025
31 checks passed
SILIZ4 pushed a commit to SILIZ4/rustworkx that referenced this pull request Jul 4, 2025
…` in a separate `setup.py` (Qiskit#1419)

* Modernize setup.py

* Farewell to retworkx

* Add release note about retworkx removal

* Move even more data to pyproject.toml

* PEP 639 says this is deprecated

* Add dependency groups later

* Move even from setup.py to pyproject.toml

* Migrate all setup.py to pyproject.toml

* Move nox dependencies to pyproject.toml

* Document new way to do debug builds now that we no longer use setup.py

* Better way to phrase the documentation

* Remove duplicate section

* Try updating setuptools for coverage job

* Add docs dependency group as well

* Make description the same as the paper

* Revert retworkx code

* Say this will be the last retworkx release

* Trying to make retworkx work

* retworkx has its own setup.py

* Account for new directory when publishing

* Document setuptools-rust

* Edit message saying it is the final release

* sunset -> retired

* Endline

* Ensure setuptools-rust is up-to-date

* Use setuptools>=70.1.0 and remove wheel

* Apply suggestions from code review

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Black

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants