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

UP036 (outdated-version-block) is off-by-one for the target version #7258

Closed
oprypin opened this issue Sep 10, 2023 · 1 comment · Fixed by #7284
Closed

UP036 (outdated-version-block) is off-by-one for the target version #7258

oprypin opened this issue Sep 10, 2023 · 1 comment · Fixed by #7284
Assignees
Labels
bug Something isn't working

Comments

@oprypin
Copy link

oprypin commented Sep 10, 2023

If my target-version is py37, I expect the code block guarded by sys.version_info < (3, 7) to be dropped but it isn't.
It gets dropped for py38, though.

A minimal code snippet that reproduces the bug.

import sys

if sys.version_info < (3, 7):
    print('oh no')

The command you invoked (e.g., ruff /path/to/file.py --fix), ideally including the --isolated flag.

ruff check test.py

The current Ruff settings (any relevant sections from your pyproject.toml).

[tool.ruff]
target-version = "py37"
select = ["UP036"]

The current Ruff version (ruff --version)

ruff 0.0.287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants