graphql-python/gql

Cannot install requests transport because qgl requires out of date urllib3 1.x

divad opened this issue · 5 comments

gql has an optional requests transport. This works with the latest requests versions. gql however specifies an old version (1.x) of urllib3 in order to install the requests transport. Why? As far as I can tell gql doesn't directly use urllib3 itself, so it should not be concerned with restricting the version of it. Other packages require urllib3 >=2.0, such as https://pypi.org/project/types-requests/. As such, gql cannot be used in a project which uses these libraries, restricting usage of gql.

Can gql remove this restriction so we can install it in an environment with urllib3 2.x please?

That restriction was added in PR #413 as an emergency response when the tests began to fail when requests released version 2.30 which allowed urllib3 2.x to be used (note that it still allows urllib3 1.x)

If you upgrade urllib3 to 2.x in your python env and then try to run the tests following the CONTRIBUTING.md file you'll see there are a lot of tests failing.

There are two reasons:

I assume vcrpy is being used by gql itself for tests? Looks that way.
botocore is a different transport.

So... perhaps instead the urllib3 1.x restriction could be applied only to botocore and when using gql to run tests? That way when somebody installs gql[requests] they will be able to use urllib3 2.x ? If somebody tries to install gql[botocore] or gql[all] it could then restrict to urllib3 <2 ?

In fact, since as you say vcrpy supports urllib3 (https://github.com/kevin1024/vcrpy/releases/tag/v4.4.0) except for older pythons, maybe we could restrict gql's need for urllib3 1.x in the same way?

You're right, I'll see what I can do.

It should now work with pre-release 3.5.0b6