8000 Leverage `uv` for documentation in `nox` session by IvanIsCoding · Pull Request #1420 · Qiskit/rustworkx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Leverage uv for documentation in nox session #1420

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

Merged
merged 78 commits into from
May 29, 2025

Conversation

IvanIsCoding
Copy link
Collaborator
@IvanIsCoding IvanIsCoding commented Apr 6, 2025

Closes #1416

This PR introduces uv into our documentation workflow.

Overall, I think this accomplishes the goal of having a more reliable docs workflow. Currently, we pin some dependencies but it is still a workflow that has some quirks. Also, sphinx and sphinx-jupyter pull a lot of packages so I think using a lock file is a good idea.

I am not sold on using uv for other workflows, as currently they are fairly straightforward. We are also not a Python-only library, having to deal with uv trying to cache might be annoying. But with reuse_venv=False, I am somewhat confident we will not run into that issue for the docs.

edit: after #1419 and #1440 merged this is ready for review

@IvanIsCoding IvanIsCoding requested a review from mtreinish April 6, 2025 15:30
@IvanIsCoding IvanIsCoding changed the title New uv branch Leverage uv for documentation in nox session Apr 6, 2025
@IvanIsCoding
Copy link
Collaborator Author
IvanIsCoding commented Apr 6, 2025

Also, I am changing the documentation build to use SETUPTOOLS_RUST_CARGO_PROFILE so the binary is in debug mode. Because we discard the virtual environment, I think building faster is a plus.

edit: I also thought about making the documentation build in parallel by using -j auto. For GitHub actions that makes no difference, so I just documented the option in the contributing guide

@coveralls
Copy link
coveralls commented Apr 7, 2025

Pull Request Test Coverage Report for Build 15229638757

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.236%

Totals Coverage Status
Change from base Build 15080375970: 0.0%
Covered Lines: 18733
Relevant Lines: 19670

💛 - Coveralls

@IvanIsCoding
Copy link
Collaborator Author

I will put this on hold until we merge #1440

@IvanIsCoding
Copy link
Collaborator Author

@mtreinish this is now ready to review

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.

I like the idea of using a lockfile for docs it should hopefully make things more reliable longer term. I just had one inline question.

I also didn't hand check the uv lock file, I assume it's all correct since you just machine generated it.

"matplotlib>=3.4",
"sphinx-reredirects",
"sphinxemoji",
"ipykernel",
"lxml_html_clean",
Copy link
Member

Choose a reason for hiding this comment

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

What is this used for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently if you run nox -edocs with Python 3.13 it fails. I had to add this dependency to make it work.

It has to do with Python 3.13 resolving a newer lxml or something of sorts.

@IvanIsCoding
Copy link
Collaborator Author

I like the idea of using a lockfile for docs it should hopefully make things more reliable longer term. I just had one inline question.

I also didn't hand check the uv lock file, I assume it's all correct since you just machine generated it.

I can confirm I have regenerated the uv.lock file very recently.

Also, uv.lock can be exported to the new lock format defined in PEP 751. But that format is brand new and very few tools support it yet.

@IvanIsCoding IvanIsCoding requested a review from mtreinish May 10, 2025 19:07
@mtreinish mtreinish added this pull request to the merge queue May 29, 2025
Merged via the queue into Qiskit:main with commit 03799b3 May 29, 2025
31 checks passed
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.

Explore using uv for documentation and tests
3 participants
0