ibis-project / ibis

the portable Python dataframe library
https://ibis-project.org
Apache License 2.0
4.3k stars 537 forks source link

build(ruff): don't use keep-runtime-typing anymore #9101

Closed deepyaman closed 2 weeks ago

deepyaman commented 2 weeks ago

Description of changes

kszucs commented 2 weeks ago

We actually rely on runtime typing and if we not use the right annotation we immediately break 3.9 support which we actually test against.

deepyaman commented 2 weeks ago

We actually rely on runtime typing and if we not use the right annotation we immediately break 3.9 support which we actually test against.

Like what, for example? All this does is automatically perform PEP 585 (List[int] -> list[int]) and PEP 604 (Union[str, int] -> str | int) rewrites; see https://docs.astral.sh/ruff/settings/#lintpyupgrade.

cpcloud commented 2 weeks ago

Thanks!

kszucs commented 1 week ago

We actually rely on runtime typing and if we not use the right annotation we immediately break 3.9 support which we actually test against.

Never mind, I was thinking of the following error from 3.8:

Python 3.8.19 | packaged by conda-forge | (default, Mar 20 2024, 12:49:57)
[Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> list[int]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'type' object is not subscriptable