typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Add 3.14 Deprecations

Open max-muoto opened this issue 8 months ago • 4 comments

Add the following deprecations for 3.14:

  • pathlib.PurePath.as_uri deprecation.
  • pdb.curframe_locals deprecation.
  • asyncio.iscoroutinefunction deprecation.
  • codecs.open deprecation.
  • os.popen and os.spawn* function deprecations.

max-muoto avatar Jun 16 '25 19:06 max-muoto

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Jun 16 '25 19:06 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Jun 16 '25 19:06 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Jun 17 '25 01:06 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Jun 17 '25 01:06 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:248: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path"  [arg-type]

core (https://github.com/home-assistant/core)
+ homeassistant/util/__init__.py:128: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/core.py:388: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/http.py:48: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/frame.py:385: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/trigger.py:302: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/service.py:1163: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/condition.py:247: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info  [deprecated]

github-actions[bot] avatar Jun 18 '25 21:06 github-actions[bot]

It seems that curframe_locals actually does not exist in 3.13, at least according to stubtest. I'm not totally sure what's going on here.

srittau avatar Jul 07 '25 12:07 srittau

Diff from mypy_primer, showing the effect of this PR on open source code:

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:258: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path"  [arg-type]

core (https://github.com/home-assistant/core)
+ homeassistant/util/__init__.py:128: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/core.py:387: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/http.py:48: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/frame.py:400: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/service.py:1167: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/trigger.py:410: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/condition.py:367: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info  [deprecated]

github-actions[bot] avatar Jul 07 '25 12:07 github-actions[bot]

@JelleZijlstra CI fails, at the moment, so we shouldn't merge.

srittau avatar Jul 07 '25 13:07 srittau

Diff from mypy_primer, showing the effect of this PR on open source code:

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info  [deprecated]

core (https://github.com/home-assistant/core)
+ homeassistant/util/__init__.py:128: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/core.py:387: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/http.py:48: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/frame.py:400: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/service.py:1000: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/trigger.py:410: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/condition.py:362: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:258: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path"  [arg-type]

github-actions[bot] avatar Jul 12 '25 19:07 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info  [deprecated]

core (https://github.com/home-assistant/core)
+ homeassistant/util/__init__.py:128: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/core.py:387: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/http.py:48: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/frame.py:400: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/service.py:1000: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/trigger.py:410: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/condition.py:362: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:258: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path"  [arg-type]

github-actions[bot] avatar Jul 12 '25 20:07 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info  [deprecated]

core (https://github.com/home-assistant/core)
+ homeassistant/util/__init__.py:128: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/core.py:387: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/http.py:48: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/frame.py:400: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/service.py:1000: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/trigger.py:410: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ homeassistant/helpers/condition.py:362: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:258: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path"  [arg-type]

github-actions[bot] avatar Jul 13 '25 19:07 github-actions[bot]

@JelleZijlstra @srittau I had to an ignore for curframe_locals as it doesn't always exist at runtime, but CI is passing now.

max-muoto avatar Jul 13 '25 19:07 max-muoto

@srittau @Avasam Comments addressed.

max-muoto avatar Aug 04 '25 03:08 max-muoto

Diff from mypy_primer, showing the effect of this PR on open source code:

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead  [deprecated]
+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info  [deprecated]

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:258: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path"  [arg-type]

github-actions[bot] avatar Aug 04 '25 03:08 github-actions[bot]