Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional dependencies for transports #147

Closed
leszekhanusz opened this issue Oct 10, 2020 · 3 comments
Closed

Optional dependencies for transports #147

leszekhanusz opened this issue Oct 10, 2020 · 3 comments
Labels
type: question or discussion Issue discussing or asking a question about gql

Comments

@leszekhanusz
Copy link
Collaborator

Currently, the latest version installs all the dependencies necessary for all the underlying transports:

  • requests
  • websockets
  • aiohttp

It should be possible to install gql without all the dependencies if we only use one transport!

My first idea was to try that by default, all the dependencies are added, but that it could be possible to remove dependencies if you only need one transport.

Apparently this is not possible

Please comment if you have an idea.

@leszekhanusz leszekhanusz added the type: question or discussion Issue discussing or asking a question about gql label Oct 10, 2020
@nihaals
Copy link

nihaals commented Oct 24, 2020

Why not make it required to include an extra when installing the package? I don't think this is necessarily a bad thing and you would know you are missing a dependency when you attempted to import a transport (each transport should probably be separated into their own file to make sure the transport-only dependencies are only required for their class). In many cases users could even use transports like requests without including the extra as it's such a common dependency (although it should be documented that using the extra is still recommended in case another dependency is added for a specific transport)

@leszekhanusz
Copy link
Collaborator Author

OK, that's what we are going to do. I made this issue to see if someone had a better idea for this.

@leszekhanusz
Copy link
Collaborator Author

Implemented in release v3.0.0a4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about gql
Projects
None yet
Development

No branches or pull requests

2 participants