Graphene: `graphql-relay` update causes error when `graphene` is pip installed

Created on 15 Jul 2019  路  6Comments  路  Source: graphql-python/graphene

When attempting to do a pip install of graphene there is a compatibility issue with the requirements between graphene and graphql-relay.

The output from running pip install --no-cache-dir graphene is:

Collecting graphene
  Downloading https://files.pythonhosted.org/packages/d2/96/6afc1a61f9d7c1159a59b44bcdc37b68dceaa424e5a8ed9afc051082413d/graphene-2.1.6-py2.py3-none-any.whl (107kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 112kB 2.1MB/s 
Collecting aniso8601<=6,>=3 (from graphene)
  Downloading https://files.pythonhosted.org/packages/85/58/1e804d6d53435b1b2241036056360575640b69a332e7ead086a04bd5ad95/aniso8601-6.0.0-py2.py3-none-any.whl (41kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 51kB 48.7MB/s 
Collecting graphql-core<3,>=2.1 (from graphene)
  Downloading https://files.pythonhosted.org/packages/f1/88/a4a7bf8ab66c35b146e44d77a1f9fd2c36e0ec9fb1a51581608c16deb6e3/graphql_core-2.2-py2.py3-none-any.whl (250kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 256kB 6.1MB/s 
Collecting six<2,>=1.10.0 (from graphene)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting graphql-relay<1,>=0.4.5 (from graphene)
  Downloading https://files.pythonhosted.org/packages/86/12/8de5918c2dfcb53958a3767d4e2df9918b603d9a468810c44156fe79faeb/graphql_relay-0.4.5-py3-none-any.whl
Collecting promise>=2.1 (from graphql-core<3,>=2.1->graphene)
  Downloading https://files.pythonhosted.org/packages/5a/81/221d09d90176fd90aed4b530e31b8fedf207385767c06d1d46c550c5e418/promise-2.2.1.tar.gz
Collecting rx>=1.6.0 (from graphql-core<3,>=2.1->graphene)
  Downloading https://files.pythonhosted.org/packages/33/0f/5ef4ac78e2a538cc1b054eb86285fe0bf7a5dbaeaac2c584757c300515e2/Rx-1.6.1-py2.py3-none-any.whl (179kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 184kB 25.7MB/s 
Building wheels for collected packages: promise
  Building wheel for promise (setup.py) ... done
  Stored in directory: /tmp/pip-ephem-wheel-cache-kjtzfg_h/wheels/92/84/9f/75e2235effae0e1c5a5c0626a503e532bbffcb7e79e672b606
Successfully built promise
ERROR: graphql-relay 0.4.5 has requirement graphql-core<2,>=0.5.0, but you'll have graphql-core 2.2 which is incompatible.
Installing collected packages: aniso8601, six, promise, rx, graphql-core, graphql-relay, graphene
Successfully installed aniso8601-6.0.0 graphene-2.1.6 graphql-core-2.2 graphql-relay-0.4.5 promise-2.2.1 rx-1.6.1 six-1.12.0

graphene requires graphql-core>=2.1,<3 (from the setup.py file) and now graphql-relay requires graphql-core>=0.5.0,<2 for versions under under 2 which appears to be retroactively added.

Version 2.0.0 of graphql-relay appears to be compatible

Most helpful comment

v2.1.7 has been released which should fix this issue.

All 6 comments

Encountered same issue when pip install graphene-django (python 3.7.3).

I guess it's due to the incompatible dependency declarations here:
https://github.com/graphql-python/graphene/blob/431e93cd68b9f720be1cb1165f0a202a6388ed74/setup.py#L88-L89

I tried to do pip install graphql-relay==2.0.0, but got dependency error due to above dependency declaration.

Collecting graphql-relay==2.0.0
  Downloading https://files.pythonhosted.org/packages/85/52/0242f2d01a3b925bc200928a2a88925b915b88efcb31c67e966991aa4dee/graphql_relay-2.0.0-py3-none-any.whl
Requirement already satisfied: graphql-core<3,>=2.2 in /usr/local/lib/python3.7/site-packages (from graphql-relay==2.0.0) (2.2)
Requirement already satisfied: promise<3,>=2.2 in /usr/local/lib/python3.7/site-packages (from graphql-relay==2.0.0) (2.2.1)
Requirement already satisfied: six>=1.12 in /usr/local/lib/python3.7/site-packages (from graphql-relay==2.0.0) (1.12.0)
Requirement already satisfied: rx>=1.6.0 in /usr/local/lib/python3.7/site-packages (from graphql-core<3,>=2.2->graphql-relay==2.0.0) (1.6.1)
ERROR: graphene 2.1.6 has requirement graphql-relay<1,>=0.4.5, but you'll have graphql-relay 2.0.0 which is incompatible.
Installing collected packages: graphql-relay
Successfully installed graphql-relay-2.0.0

This looks to have been caused by graphql-relay republishing 0.4.5 with stricter dependencies: https://github.com/graphql-python/graphql-relay-py/issues/23

The source version of the package is ok, it's the newly uploaded wheel that is the problem

Would also help if pip would ignore the wheel and look at the source version if the hash(es) only matches the source.

We're using Poetry, and currently getting around the problem using:

graphql-relay = { git = "https://github.com/graphql-python/graphql-relay-py.git", rev = "48856fb3cf9e6c122535076a82d862bac3c21779" }
graphene = "^2.1"

Inside pyproject.toml.

Apologies everyone, we're going to push a new version of graphene that fixes the dependency on graphql-relay (https://github.com/graphql-python/graphene/pull/1032). Should be going out soon.

v2.1.7 has been released which should fix this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mandx picture mandx  路  4Comments

lincolnq picture lincolnq  路  3Comments

mingzhou picture mingzhou  路  3Comments

mraak picture mraak  路  3Comments

fishy picture fishy  路  4Comments