tinkerpop icon indicating copy to clipboard operation
tinkerpop copied to clipboard

gremlin-python: enable opt-out for some pkg reqs

Open skieffer opened this issue 3 years ago • 2 comments

For gremlin-python users who plan to use a custom transport, there may be no need to install the aiohttp or nest_asyncio packages. These packages bring quite a few recursive requirements with them as well.

These packages should not be moved to extras_require in setup.py, since this would break existing deployments.

Instead, there is a pattern for opting out of requirements at installation time, using environment variables. It is discussed for example here.

EDIT: Associated JIRA ticket: https://issues.apache.org/jira/browse/TINKERPOP-2752

skieffer avatar Jun 22 '22 22:06 skieffer

Is your main concern the size of the WHL file or are there conflicts created by the current dependency tree with the implementation that you are preferring to use for your web socket transport? I'm not opposed to this change but I think we will also need to add some tests as part of this PR for the flag, and potentially an alternate implementation as part of that testing.

krlawrence avatar Jun 27 '22 17:06 krlawrence

Hi @krlawrence, thanks for taking a look at this.

There are no dependency conflicts. For me the concern is partly about wasted MBs in a docker image (only about 12MB, but it counts), and partly about wanting to keep misleading clutter out of automatically generated licensing info. I don't want to say, "This software uses packages X, Y, and Z" if it doesn't actually use them.

In any case, I realize the problem is really not with gremlinpython per se, but is fundamentally about needing better control over pip and dependency resolution. Therefore I'm trying to tackle the more general problem over at pip-tools: https://github.com/jazzband/pip-tools/pull/1645

I think the latter would actually be my preferred solution, so, in the meantime, I guess I won't push too hard for this PR.

skieffer avatar Jun 28 '22 22:06 skieffer