From 1cb46e181d458b6087401d21eca2499b21cbc760 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Fri, 22 Oct 2021 20:16:16 +0100 Subject: [PATCH] move monkey module to steam.monkey; #364 --- CHANGES.md | 5 +++-- docs/api/{steam.client.monkey.rst => steam.monkey.rst} | 0 docs/api/steam.rst | 1 + docs/user_guide.rst | 2 +- steam/client/__init__.py | 2 +- steam/client/cdn.py | 6 +++--- steam/{client => }/monkey.py | 4 ++-- 7 files changed, 11 insertions(+), 9 deletions(-) rename docs/api/{steam.client.monkey.rst => steam.monkey.rst} (100%) rename steam/{client => }/monkey.py (89%) diff --git a/CHANGES.md b/CHANGES.md index 7ef6b40d..406263ff 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,9 +4,10 @@ This release brings breaking changes -### steam.cleint +### steam.client -- Removed monkey patching by default. See `steam.client.monkey` for details +- Add `steam.monkey` module for applying gevent monkey patches +- Removed monkey patching by default. See `steam.monkey` for details ## 1.0.0 diff --git a/docs/api/steam.client.monkey.rst b/docs/api/steam.monkey.rst similarity index 100% rename from docs/api/steam.client.monkey.rst rename to docs/api/steam.monkey.rst diff --git a/docs/api/steam.rst b/docs/api/steam.rst index 66d3c1ad..4e4a466c 100644 --- a/docs/api/steam.rst +++ b/docs/api/steam.rst @@ -11,6 +11,7 @@ API Reference steam.game_servers steam.globalid steam.guard + steam.monkey steam.steamid steam.webapi steam.webauth diff --git a/docs/user_guide.rst b/docs/user_guide.rst index d53a3a75..851a9f89 100644 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -155,7 +155,7 @@ The library comes with some Steam client features implemented, see :doc:`api/ste .. warning:: :class:`.SteamClient` no longer applies gevent monkey patches by default. - See :mod:`steam.client.monkey` for details how make stdlib gevent cooperative. + See :mod:`steam.monkey` for details how make stdlib gevent cooperative. CLI example ----------- diff --git a/steam/client/__init__.py b/steam/client/__init__.py index ec6a1941..e9aeb4cd 100644 --- a/steam/client/__init__.py +++ b/steam/client/__init__.py @@ -4,7 +4,7 @@ .. warning:: ``steam.client`` no longer patches stdlib to make it gevent cooperative. This provides flexibility if you want to use :class:`.SteamClient` with async or other modules. - If you want to monkey patch anyway use :meth:`steam.client.monkey.patch_minimal()` + If you want to monkey patch anyway use :meth:`steam.monkey.patch_minimal()` .. note:: Additional features are located in separate submodules. All functionality from :mod:`.builtins` is inherited by default. diff --git a/steam/client/cdn.py b/steam/client/cdn.py index b124086e..457bba43 100644 --- a/steam/client/cdn.py +++ b/steam/client/cdn.py @@ -5,12 +5,12 @@ .. warning:: This module uses :mod:`requests` library, which is not gevent cooperative by default. - It is high recommended that you use :meth:`steam.client.monkey.patch_minimal()`. + It is high recommended that you use :meth:`steam.monkey.patch_minimal()`. See example below .. code:: python - import steam.client.monkey - steam.client.monkey.patch_minimal() + import steam.monkey + steam.monkey.patch_minimal() from steam.client import SteamClient, EMsg from steam.client.cdn import CDNClient diff --git a/steam/client/monkey.py b/steam/monkey.py similarity index 89% rename from steam/client/monkey.py rename to steam/monkey.py index 60f3091c..1256ad17 100644 --- a/steam/client/monkey.py +++ b/steam/monkey.py @@ -7,8 +7,8 @@ .. code:: python - import steam.client.monkey - steam.client.monkey.patch_minimal() + import steam.monkey + steam.monkey.patch_minimal() import requests from steam.client import SteamClient, EMsg