ValvePython / steam

☁️ Python package for interacting with Steam
http://steam.readthedocs.io
MIT License
1.1k stars 137 forks source link

Remove gevent monkeypatching. #287

Closed tomprince closed 3 years ago

tomprince commented 4 years ago

For somebody using this package as a library, it would be preferable to leave whether to monkeypatch gevent into the standard library up to the user, rather than forcing it on every consumer.

As far as I can tell, the only place that monkeypatching is used, is for interacting with requests. The only place this is directly used by the client is in steam.core.CMClient.boostrap_from_webapi, which is only called on the initial connection. Letting that call be synchronous, if the user doesn't want to use gevent directly seems reasonable.

rossengeorgiev commented 4 years ago

You are correct. I've been intending to remove monkey patch to make the code easier to use in conjunction with other libraries and features of python. That webapi call, and another webapi method, are the only places where library might need it. Of course the user could be using requests, but it would be more flexible to let them monkey patch if they need to.

rossengeorgiev commented 4 years ago

This will also affect CDNClient, which uses requests

tomwade commented 3 years ago

Is it possible to re-run checks on this and look to merge? Would greatly benefit codebase

rossengeorgiev commented 3 years ago

I very much want this to happen, but I need to:

  1. Have this documented, so that people know they can use monkey patching to make standard library, and other libraries cooperative
  2. Figure out if I can make the various HTTP requests (like bootstrap, CDNClient) used under steam.client namespace cooperative by default.
rossengeorgiev commented 3 years ago

Closing in favour of #364