grafana-toolbox / grafana-client

Python client library for accessing the Grafana HTTP API.
MIT License
100 stars 28 forks source link

Installing grafana-client 4.1 broke my Boto3 connections #179

Open alkuzad opened 1 month ago

alkuzad commented 1 month ago

Describe the bug

Niquests uses urllib3.future library that replaces urllib3 library even if you installed both, so installing two will conflict.

You either guarantee that grafana-client works or boto3 works but not in the same time.

To Reproduce Steps to reproduce the behavior:

  1. rm -rf test && python3 -mvenv test && . ./test/bin/activate && pip install boto3 1>/dev/null && cat test/lib/python3.12/site-packages/urllib3/_version.py && pip install grafana-client 1> /dev/null && cat test/lib/python3.12/site-packages/urllib3/_version.py

Expected behavior

I would see both times:

__version__ = "2.2.2"

Instead of it changing to this on second print:

__version__ = "2.8.902"

Versions

Additional context

Grafana-client is a library often used by DevOps who also use boto3 or other libraries together connecting different systems and platforms together. Adding a dependency for library that eradicates proper urllib3 and introduces new bugs that breaks environment is problematic. We can no longer add grafana-client into our common toolset and we have to extract it to another tool or use pre 4.0 version.

Async is nice but it was proven that it is not main contributor to the speed . Adding support for it easily is ok but not at cost of breaking other flows.

dg-nvm commented 1 month ago

I created this constraint file that helps with the issue - effectivelly automatically lowers the grafana-client version to one that uses requests - https://github.com/alkuzad/python-global-constraints