Importing flwr before wandb causes deprecation warnings
Describe the bug
Deprecation warnings due to importing flwr and then subsequently importing wandb. Deprecation warnings are not generated if wandb is imported first
Steps/Code to Reproduce
python -m venv test
source test/bin/activate
pip install --upgrade pip flwr wandb
python -c "import flwr;import wandb"
Expected Results
Actual Results
/home/shawn/venvs/test/lib/python3.10/site-packages/dockerpycreds/utils.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
import distutils.spawn
/home/shawn/venvs/test/lib/python3.10/site-packages/wandb/analytics/sentry.py:90: SentryHubDeprecationWarning: `sentry_sdk.Hub` is deprecated and will be removed in a future major release. Please consult our 1.x to 2.x migration guide for details on how to migrate `Hub` usage to the new API: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x
self.hub = sentry_sdk.Hub(client)
Note that although it is only a single warning here, it actually results in the same deprecation warning a bunch of times when dependencies that import wandb are used
Hi @scarere, thanks for raising this,
It looks like these DeprecationWarnings stem from upstream dependencies, primarily related to wandb and its transitive imports like dockerpycreds and sentry_sdk. Flower itself doesn’t directly import or interact with these libraries.
Since the underlying cause is external to Flower, we would recommend tracking this upstream with wandb and associated libraries. Hopefully, upcoming versions of wandb and its dependencies will fully resolve deprecation warnings for newer Python versions.
I will close this for now.