adap / flower

Flower: A Friendly Federated AI Framework
https://flower.ai
Apache License 2.0
5.18k stars 887 forks source link

Importing flwr before wandb causes deprecation warnings #4086

Open scarere opened 3 months ago

scarere commented 3 months ago

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)
scarere commented 3 months ago

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