explodinglabs / jsonrpcclient

Generate JSON-RPC requests and parse responses in Python

Home Page:https://www.jsonrpcclient.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsonrpcclient 3.3.5 has requirement click<7

djv57 opened this issue · comments

commented

Hi! During installation through PIP/Virtualenv such red message appears:
ERROR: jsonrpcclient 3.3.5 has requirement click<7, but you'll have click 7.0 which is incompatible.
I use jsonrpcclient with HTTP-requests only and it works as expected.
Is it issue?
Python v3.5.2

commented

It works ok for me, are you using a fresh virtualenv?

$ python3.5 --version
Python 3.5.2
~
$ mkvirtualenv -p $(which python3.5) test
created virtual environment in 591ms CPython3Posix(dest=/Users/beau/.virtualenvs/test, clear=False, global=False) with seeder FromAppData pip=latest setuptools=latest wheel=latest app_data_dir=/Users/beau/Library/Application Support/virtualenv/seed-v1 via=copy
(test) ~
$ pip install --no-cache-dir "jsonrpcclient[requests]"
Collecting jsonrpcclient[requests]
  Downloading jsonrpcclient-3.3.5.tar.gz (15 kB)
Collecting apply_defaults<1
  Downloading apply_defaults-0.1.4.tar.gz (3.1 kB)
Collecting click<7
  Downloading click-6.7-py2.py3-none-any.whl (71 kB)
     |████████████████████████████████| 71 kB 4.8 MB/s
Collecting jsonschema<4
  Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
     |████████████████████████████████| 56 kB 3.2 MB/s
Collecting requests
  Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 1.1 MB/s
Collecting pyrsistent>=0.14.0
  Downloading pyrsistent-0.15.7.tar.gz (107 kB)
     |████████████████████████████████| 107 kB 2.3 MB/s
Requirement already satisfied: setuptools in ./.virtualenvs/test/lib/python3.5/site-packages (from jsonschema<4->jsonrpcclient[requests]) (45.2.0)
Collecting six>=1.11.0
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting importlib-metadata; python_version < "3.8"
  Downloading importlib_metadata-1.5.0-py2.py3-none-any.whl (30 kB)
Collecting attrs>=17.4.0
  Downloading attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading urllib3-1.25.8-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 2.4 MB/s
Collecting idna<3,>=2.5
  Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 9.5 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2019.11.28-py2.py3-none-any.whl (156 kB)
     |████████████████████████████████| 156 kB 2.3 MB/s
Collecting chardet<4,>=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 7.1 MB/s
Collecting zipp>=0.5
  Downloading zipp-1.2.0-py2.py3-none-any.whl (4.8 kB)
Building wheels for collected packages: jsonrpcclient, apply-defaults, pyrsistent
  Building wheel for jsonrpcclient (setup.py) ... done
  Created wheel for jsonrpcclient: filename=jsonrpcclient-3.3.5-py3-none-any.whl size=21487 sha256=5a8e9c53a06d037841fc006c7f7b0ae668be7d9eb77c272ad2becb738e11d323
  Stored in directory: /private/var/folders/jm/6hytpy2x3fx4f51f9m9xgcvm0000gn/T/pip-ephem-wheel-cache-o5wwdlgi/wheels/d3/fa/c4/38fd85f12d512926cb180f4d46fa7f4c7192d97fa7430a8005
  Building wheel for apply-defaults (setup.py) ... done
  Created wheel for apply-defaults: filename=apply_defaults-0.1.4-py3-none-any.whl size=3516 sha256=b52d95ced4f8af9af9e34bb37a7d75f402a821b462757f9f37c58857b7f63a13
  Stored in directory: /private/var/folders/jm/6hytpy2x3fx4f51f9m9xgcvm0000gn/T/pip-ephem-wheel-cache-o5wwdlgi/wheels/6f/4a/ef/d1d65d3348df165dfc8d99ea083976c54ce3669e0391a748b1
  Building wheel for pyrsistent (setup.py) ... done
  Created wheel for pyrsistent: filename=pyrsistent-0.15.7-cp35-cp35m-macosx_10_6_intel.whl size=69680 sha256=2558a05c9e4f8efa047e79a2868e596b67c9a1fcef53e64e5ce227472ea88a1b
  Stored in directory: /private/var/folders/jm/6hytpy2x3fx4f51f9m9xgcvm0000gn/T/pip-ephem-wheel-cache-o5wwdlgi/wheels/a0/40/4f/75ab8ad41b089dcba783446ed2c34a403b91261d9df451a3e2
Successfully built jsonrpcclient apply-defaults pyrsistent
Installing collected packages: apply-defaults, click, six, pyrsistent, zipp, importlib-metadata, attrs, jsonschema, urllib3, idna, certifi, chardet, requests, jsonrpcclient
Successfully installed apply-defaults-0.1.4 attrs-19.3.0 certifi-2019.11.28 chardet-3.0.4 click-6.7 idna-2.9 importlib-metadata-1.5.0 jsonrpcclient-3.3.5 jsonschema-3.2.0 pyrsistent-0.15.7 requests-2.23.0 six-1.14.0 urllib3-1.25.8 zipp-1.2.0
commented

I've installed latest version of virtualenv but same error message is appeared.
Probably some issue on my side. Here is my workflow:

  1. Install jsonrpcclient through PyCharm interpreter menu (not manually) on my dev machine.
  2. Freeze requirements, string "jsonrpcclient==3.3.5" appears in requirements.txt
  3. When I try to apply this requirements.txt on other machine, error message appears.

Hello, I have a situation where I must use jsonrpcclient and another library (uvicorn) that requires click>=7. The two are therefore incompatible...
The error message that I get it's the same of @djv57
This the same problem encountered by @djv57 , I think...

Is there a reason for having click<7 in jsonrpcclient (besides not being tested maybe)?

Thank you for your good job

commented

@lanquil click was used in a poor attempt at making jsonrpcclient into a command line utility, which was abandoned. I'd like to remove the dependency but it would be a breaking change.

Possible suggestions could be to install jsonrpcclient, uninstall click, then install Uvicorn. Or fork jsonrpcclient and remove the dependency yourself. jsonrpcclient should still work without click.

@bcb thank you for your prompt answer

install jsonrpcclient, uninstall click, then install Uvicorn.

Actually, it works even without uninstalling click. When uvicorn is installed click is upgraded from 6.7 to 7.x. (and the error message is issued). And it works even the other way, installing first uvicorn and then jsonrpcclient, but then click is downgraded from 7.x to 6.7

Or fork jsonrpcclient and remove the dependency yourself. jsonrpcclient should still work without click.

Thank you, I will

I've seen that using click 7.1 with jsonrpcclient breaks a test, if I found time I will try to check the reason (maybe it's possible to implement forward compatibility to click 7?)

I've found the reason. In click version 6.7, in click/testing.py(295)invoke() the return value for an uncaught exception was -1

            except Exception as e:
                if not catch_exceptions:
                    raise
                exception = e
                exit_code = -1
                exc_info = sys.exc_info()

In version 7 it has changed to 1

            except Exception as e:
                if not catch_exceptions:
                    raise
                exception = e
                exit_code = 1
                exc_info = sys.exc_info()

I'm preparing a pull request in case you want to release a 3.3.6 version with the click requirement relaxed to click<8

Or do you think the change of that exit code should be considered a breaking change?