From d580a78787a1ef06233d9f1f0b4c63dd1ad411cc Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 17 Oct 2018 01:07:33 +0200 Subject: [PATCH] Update Installation page Hint about asyncio --- docs/source/start/Installation.rst | 48 +++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/docs/source/start/Installation.rst b/docs/source/start/Installation.rst index 41a7ccac..2a738b57 100644 --- a/docs/source/start/Installation.rst +++ b/docs/source/start/Installation.rst @@ -14,17 +14,17 @@ by following the instructions at https://pip.pypa.io/en/latest/installing/. Install Pyrogram ---------------- -- The easiest way to install and upgrade Pyrogram is by using **pip**: +- The easiest way to install and upgrade Pyrogram to its latest stable version is by using **pip**: - .. code-block:: bash + .. code-block:: text $ pip3 install --upgrade pyrogram -- or, with TgCrypto_ (recommended): +- or, with TgCrypto_ as extra requirement (recommended): - .. code-block:: bash + .. code-block:: text - $ pip3 install --upgrade pyrogram[tgcrypto] + $ pip3 install --upgrade pyrogram[fast] Bleeding Edge ------------- @@ -32,21 +32,53 @@ Bleeding Edge If you want the latest development version of Pyrogram, you can install it straight from the develop_ branch using this command (you might need to install **git** first): -.. code-block:: bash +.. code-block:: text $ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git +Asynchronous +------------ + +Pyrogram heavily depends on IO-bound network code (it's a cloud-based messaging client library after all), and here's +where asyncio shines the most by providing extra performance while running on a single OS-level thread only. + +**A fully asynchronous variant of Pyrogram is therefore available** (Python 3.5+ required). +Use this command to install: + +.. code-block:: text + + $ pip3 install --upgrade git+https://github.com/pyrogram/pyrogram.git@asyncio + + +Pyrogram API remains the same and features are kept up to date from the non-async, default develop branch. + + +.. note:: + + The idea to turn Pyrogram fully asynchronous is still under consideration, but is wise to expect that in future this + would be the one and only way to work with Pyrogram. + +.. raw:: html + + + +.. centered:: Subscribe to `@Pyrogram `_ for news and announcements + Verifying --------- To verify that Pyrogram is correctly installed, open a Python shell and import it. If no error shows up you are good to go. -.. code-block:: bash +.. code-block:: python >>> import pyrogram >>> pyrogram.__version__ '0.8.0' .. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto -.. _develop: http://github.com/pyrogram/pyrogram \ No newline at end of file +.. _develop: http://github.com/pyrogram/pyrogram