Skip to content

F821 not recognizing requires-python in pyproject.toml #14813

@CNSeniorious000

Description

@CNSeniorious000

I tried to use anext and aiter in a project configured with requires-python = "~=3.10", but Ruff still complaining

F821 Undefined name `anext`. Consider specifying `requires-python = ">= 3.10"` or `tool.ruff.target-version = "py310"` in your `pyproject.toml` file.
  |
8 | async def main():
9 |     print(anext(g()))
  |           ^^^^^ F821
  |

Here is a reproduction repository:

https://github.com/CNSeniorious000/ruff-F821-repro

See these workflow logs:

https://github.com/CNSeniorious000/ruff-F821-repro/actions/runs/12198261365/job/34029609880#step:5:13

Metadata

Metadata

Assignees

Labels

breakingBreaking API changeconfigurationRelated to settings and configuration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions