-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
thanks for the library! we love it. found another issue tho, consider the class:
class Foo(TypedDict):
bar: NotRequired[Union[bool, None]]
ruff lint throws on the property and will autofix to use a pipe operator when "UP" ruleset is selected:
bar: NotRequired[bool | None]
this syntax is enabled only in python 3.10+ and breaks applications on an earlier version. in my case, I have pyproject.toml with the following subsnippet:
[tool.ruff]
target-version = 'py37'
two interesting asides:
- I am running ruff cli inside a docker container that has python 3.10 installed. hopefully ruff is smart enough to use the pyproject.toml for reference and does try to detect via the current process version
- i couldn't easily see documentation on how to dump or log the ruff config from inside the process, so I simply have to trust that pyproject.toml is respected and I can't really troubleshoot. I'll file a feature request to enhance
ruff -Vor some other mechanism
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels