Skip to content

Commit

Permalink
Update documentation and rename the extra to "gssauth"
Browse files Browse the repository at this point in the history
  • Loading branch information
eltoder committed Mar 9, 2024
1 parent 69375b1 commit 3ced615
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
11 changes: 9 additions & 2 deletions README.rst
Expand Up @@ -58,11 +58,18 @@ This enables asyncpg to have easy-to-use support for:
Installation
------------

asyncpg is available on PyPI and has no dependencies.
Use pip to install::
asyncpg is available on PyPI. When not using GSSAPI/SSPI authentication it
has no dependencies. Use pip to install::

$ pip install asyncpg

If you need GSSAPI/SSPI authentication, use::

$ pip install 'asyncpg[gssauth]'

For more details, please `see the documentation
<https://magicstack.github.io/asyncpg/current/installation.html>`_.


Basic Usage
-----------
Expand Down
4 changes: 2 additions & 2 deletions asyncpg/protocol/coreproto.pyx
Expand Up @@ -724,7 +724,7 @@ cdef class CoreProtocol:
import gssapi
except ModuleNotFoundError:
raise apg_exc.InterfaceError(
'gssapi module not found; please install asyncpg[gssapi] to '
'gssapi module not found; please install asyncpg[gssauth] to '
'use asyncpg with Kerberos/GSSAPI/SSPI authentication'
) from None

Expand All @@ -736,7 +736,7 @@ cdef class CoreProtocol:
import sspilib
except ModuleNotFoundError:
raise apg_exc.InterfaceError(
'sspilib module not found; please install asyncpg[gssapi] to '
'sspilib module not found; please install asyncpg[gssauth] to '
'use asyncpg with Kerberos/GSSAPI/SSPI authentication'
) from None

Expand Down
29 changes: 22 additions & 7 deletions docs/installation.rst
Expand Up @@ -4,20 +4,35 @@
Installation
============

**asyncpg** has no external dependencies and the recommended way to
install it is to use **pip**:
**asyncpg** has no external dependencies when not using GSSAPI/SSPI
authentication. The recommended way to install it is to use **pip**:

.. code-block:: bash
$ pip install asyncpg
If you need GSSAPI/SSPI authentication, the recommended way is to use

.. note::
.. code-block:: bash
$ pip install 'asyncpg[gssauth]'
This installs SSPI support on Windows and GSSAPI support on non-Windows
platforms. SSPI and GSSAPI interoperate as clients and servers: an SSPI
client can authenticate to a GSSAPI server and vice versa.

On Linux installing GSSAPI requires a working C compiler and Kerberos 5
development files. The latter can be obtained by installing **libkrb5-dev**
package on Debian/Ubuntu or **krb5-devel** on RHEL/Fedora. (This is needed
because PyPI does not have Linux wheels for **gssapi**. See `here for the
details <https://github.com/pythongssapi/python-gssapi/issues/200#issuecomment-1032934269>`_.)

It is also possible to use GSSAPI on Windows:

It is recommended to use **pip** version **8.1** or later to take
advantage of the precompiled wheel packages. Older versions of pip
will ignore the wheel packages and install asyncpg from the source
package. In that case a working C compiler is required.
* `pip install gssapi`
* Install `Kerberos for Windows <https://web.mit.edu/kerberos/dist/>`_.
* Set the ``gsslib`` parameter or the ``PGGSSLIB`` environment variable to
`gssapi` when connecting.


Building from source
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -35,7 +35,7 @@ dependencies = [
github = "https://github.com/MagicStack/asyncpg"

[project.optional-dependencies]
gssapi = [
gssauth = [
'gssapi; platform_system != "Windows"',
'sspilib; platform_system == "Windows"',
]
Expand Down

0 comments on commit 3ced615

Please sign in to comment.