You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up to release 0.10.0. The requires-python inference changes were unintentionally omitted from 0.10.0, and have been included here. This release also includes stabilization of the preview behavior for PGH004.
Breaking changes
Changes to how the Python version is inferred when a target-version is not specified (#16319)
In previous versions of Ruff, you could specify your Python version with:
The target-version option in a ruff.toml file or the [tool.ruff] section of a pyproject.toml file.
The project.requires-python field in a pyproject.toml file with a [tool.ruff] section.
These options worked well in most cases, and are still recommended for fine control of the Python version. However, because of the way Ruff discovers config files, pyproject.toml files without a [tool.ruff] section would be ignored, including the requires-python setting. Ruff would then use the default Python version (3.9 as of this writing) instead, which is surprising when you've attempted to request another version.
In v0.10, config discovery has been updated to address this issue:
If Ruff finds a ruff.toml file without a target-version, it will check
for a pyproject.toml file in the same directory and respect its
requires-python version, even if it does not contain a [tool.ruff]
section.
If Ruff finds a user-level configuration, the requires-python field of the closest pyproject.toml in a parent directory will take precedence.
If there is no config file (ruff.tomlor pyproject.toml with a
[tool.ruff] section) in the directory of the file being checked, Ruff will
search for the closest pyproject.toml in the parent directories and use its
requires-python setting.
Stabilization
The following behaviors have been stabilized:
blanket-noqa (PGH004): Also detect blanked file-level noqa comments (and not just line level comments).
Preview features
[syntax-errors] Tuple unpacking in for statement iterator clause before Python 3.9 (#16558)
Install ruff 0.11.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.0/ruff-installer.sh | sh
This is a follow-up to release 0.10.0. Because of a mistake in the release process, the requires-python inference changes were not included in that release. Ruff 0.11.0 now includes this change as well as the stabilization of the preview behavior for PGH004.
Breaking changes
Changes to how the Python version is inferred when a target-version is not specified (#16319)
In previous versions of Ruff, you could specify your Python version with:
The target-version option in a ruff.toml file or the [tool.ruff] section of a pyproject.toml file.
The project.requires-python field in a pyproject.toml file with a [tool.ruff] section.
These options worked well in most cases, and are still recommended for fine control of the Python version. However, because of the way Ruff discovers config files, pyproject.toml files without a [tool.ruff] section would be ignored, including the requires-python setting. Ruff would then use the default Python version (3.9 as of this writing) instead, which is surprising when you've attempted to request another version.
In v0.10, config discovery has been updated to address this issue:
If Ruff finds a ruff.toml file without a target-version, it will check
for a pyproject.toml file in the same directory and respect its
requires-python version, even if it does not contain a [tool.ruff]
section.
If Ruff finds a user-level configuration, the requires-python field of the closest pyproject.toml in a parent directory will take precedence.
If there is no config file (ruff.tomlor pyproject.toml with a
[tool.ruff] section) in the directory of the file being checked, Ruff will
search for the closest pyproject.toml in the parent directories and use its
requires-python setting.
Stabilization
The following behaviors have been stabilized:
blanket-noqa (PGH004): Also detect blanked file-level noqa comments (and not just line level comments).
Preview features
[syntax-errors] Tuple unpacking in for statement iterator clause before Python 3.9 (#16558)
0.10.0
Check out the blog post for a migration guide and overview of the changes!
Breaking changes
See also, the "Remapped rules" section which may result in disabled rules.
Changes to how the Python version is inferred when a target-version is not specified (#16319)
Because of a mistake in the release process, the requires-python inference changes are not included in this release and instead shipped as part of 0.11.0.
You can find a description of this change in the 0.11.0 section.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%
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
dependenciesPull requests that update a dependency filepythonPull requests that update Python code
0 participants
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.
Updates the requirements on ruff to permit the latest version.
Release notes
Sourced from ruff's releases.
... (truncated)
Changelog
Sourced from ruff's changelog.
... (truncated)
Commits
2cd25efRuff 0.11.0 (#16723)a22d206[red-knot] Preliminary tests for typing.Final (#15917)270318c[red-knot] fix: improve type inference for binary ops on tuples (#16725)d03b12e[red-knot] Assignments to attributes (#16705)14c5ed5[pygrep-hooks]: Detect file-level suppressions comments without rul… (#16720)5955650Fallback to requires-python in certain cases when target-version is not found...2382fe1[syntax-errors] Tuple unpacking inforstatement iterator clause before Pyt...27e9d1fRuff v0.10 Release (#16708)acf35c5Add newnoqaspecification to the docs (#16703)b9b2562describe requires-python fallback in docs (#16704)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)