Skip to content
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

Undefined name anext Ruff(F821) #616

Closed
AsgeirNoM opened this issue Sep 11, 2024 · 6 comments
Closed

Undefined name anext Ruff(F821) #616

AsgeirNoM opened this issue Sep 11, 2024 · 6 comments

Comments

@AsgeirNoM
Copy link

  • A minimal code snippet that reproduces the bug.
anext
  • The current Ruff and VS Code settings (any relevant sections from your pyproject.toml and settings.json).
    tuff.toml
respect-gitignore = true

pyproject.toml

[tool.poetry.dependencies]
python = ">=3.11, <3.13"
  • The current Ruff and VS Code extension versions (ruff --version).
    ruff 0.1.15
    VS-Code plugin v2024.48.0

  • A description of your environment (e.g., operating system, Python version, etc.).
    python3.11.9 / devcontainer mcr.microsoft.com/devcontainers/python:1-3.11-bookworm

Screenshot_20240911_160343

Workaround

Turning off ruff as a linter, and only use it for formatting.

@dhruvmanila
Copy link
Member

Thanks for providing the details. Can you specify what the issue that you're facing here? I'm unable to infer that based on the information that you've provided.

@AsgeirNoM
Copy link
Author

Thanks for providing the details. Can you specify what the issue that you're facing here? I'm unable to infer that based on the information that you've provided.

anext is a python3 builtin (since 3.10) https://docs.python.org/3/library/functions.html#anext

@dhruvmanila
Copy link
Member

  • The current Ruff and VS Code extension versions (ruff --version).
    ruff 0.1.15

Can you try it with a recent Ruff version? It doesn't occur in it: https://play.ruff.rs/b6e9c140-0f81-40d3-bfd5-84e80422ff8b

@MichaReiser MichaReiser added the needs-mre Needs more information for reproduction label Sep 20, 2024
@arthuriantech
Copy link

Same issue with the latest version. It's really weird thing.
image

@MichaReiser
Copy link
Member

Same issue with the latest version. It's really weird thing.

image

Does your pyproject.toml specify a requires-python or target version?

@arthuriantech
Copy link

Does your pyproject.toml specify a requires-python or target version?

Well, specifying requires-python = ">= 3.12" solves the issue. Thanks for pointing this out.

@zanieb zanieb closed this as completed Oct 15, 2024
@dhruvmanila dhruvmanila removed the needs-mre Needs more information for reproduction label Oct 16, 2024
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

No branches or pull requests

5 participants