-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Environment details
- OS type and version: Home Assistant container (Docker on Synology NAS)
- Python version: 3.13
- google-api-python-client version: 2.71.0
- Installed via: pip (inside container)
Problem description
When running Home Assistant on Python 3.13, I encountered a deprecation warning related to the google
namespace package: /usr/local/lib/python3.13/site-packages/google/init.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html.. The pkg_resources package is slated for removal as early as 2025-11-30. import('pkg_resources').declare_namespace(name).
Suggested fix
Consider migrating to pkgutil
or importlib
for namespace declaration, as pkg_resources
is deprecated and scheduled for removal in future Python versions.
Steps to reproduce
- Run Home Assistant 2025.8 in a Docker container using Python 3.13.
- Observe logs at startup for py.warnings related to pkg_resources.
Code example
import homeassistant.components.cast
Stack trace
/usr/local/lib/python3.13/site-packages/google/init.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30.
import('pkg_resources').declare_namespace(name)