Declare ruff as a runtime dependency in pyproject.toml - #815
Open
albertvillanova wants to merge 1 commit into
Open
Declare ruff as a runtime dependency in pyproject.toml#815albertvillanova wants to merge 1 commit into
albertvillanova wants to merge 1 commit into
Conversation
Member
Author
|
See CI becomes red again in |
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR declares
ruffas a runtime dependency inpyproject.toml, so that it is actually installed with the package.Follow-up to:
Motivation
doc-builder styleinvokesruffunconditionally throughsubprocess.run(["ruff", ...])when formatting code examples, soruffmust be present in the environment.#785 added
rufftoinstall_requiresinsetup.py, but that file is no longer used to build the package metadata: since #636,pyproject.tomldeclares a complete[project]table, which setuptools treats as authoritative. As a result, #785 had no effect.This can be confirmed by inspecting the metadata of an install from the merge commit of #785:
ruffonly appears under thequality,allanddevextras, never as a core dependency. So a plain install still fails when styling a code example:Note that this error only surfaces for docstrings or mdx files that contain code examples, and it is easily masked locally when
ruffhappens to be onPATHfrom an active virtual environment.See the related downstream issue in
trl:Changes
ruffto[project].dependenciesinpyproject.tomlNote
setup.pyis now unused for packaging metadata and has drifted: itsinstall_requiresstill listsblackand itsextras["quality"]still pinsblack~=22.0,isortandflake8, all replaced byruffin #636, while itsextras["testing"]still listsrequests, replaced byhttpxin #754. Removing it would avoid similar confusion in the future. Left out of this PR to keep the change minimal.