Skip to content

Commit 345ac4d

Browse files
Add :canonical: directives for intersphinx cross-referencing (#12098)
1 parent e458a83 commit 345ac4d

8 files changed

Lines changed: 184 additions & 0 deletions

CHANGES/10468.doc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Added ``:canonical:`` directives to documentation reference pages, enabling
2+
``Intersphinx`` cross-referencing via fully-qualified module paths (e.g.
3+
``aiohttp.client.ClientSession``) -- by :user:`danielalanbates`.

docs/client_reference.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ The client session supports the context manager protocol for self closing.
6060
max_headers=128, \
6161
fallback_charset_resolver=lambda r, b: "utf-8", \
6262
ssl_shutdown_timeout=0)
63+
:canonical: aiohttp.client.ClientSession
6364

6465
The class for creating client sessions and making requests.
6566

@@ -912,6 +913,7 @@ certification chaining.
912913
max_headers=None, \
913914
version=aiohttp.HttpVersion11, \
914915
connector=None)
916+
:canonical: aiohttp.client.request
915917
:async:
916918

917919
Asynchronous context manager for performing an asynchronous HTTP
@@ -1093,6 +1095,7 @@ is controlled by *force_close* constructor's parameter).
10931095
.. class:: BaseConnector(*, keepalive_timeout=15, \
10941096
force_close=False, limit=100, limit_per_host=0, \
10951097
enable_cleanup_closed=False, loop=None)
1098+
:canonical: aiohttp.connector.BaseConnector
10961099

10971100
Base class for all connectors.
10981101

@@ -1215,6 +1218,7 @@ is controlled by *force_close* constructor's parameter).
12151218
enable_cleanup_closed=False, timeout_ceil_threshold=5, \
12161219
happy_eyeballs_delay=0.25, interleave=None, loop=None, \
12171220
socket_factory=None, ssl_shutdown_timeout=0)
1221+
:canonical: aiohttp.connector.TCPConnector
12181222

12191223
Connector for working with *HTTP* and *HTTPS* via *TCP* sockets.
12201224

@@ -1394,6 +1398,7 @@ is controlled by *force_close* constructor's parameter).
13941398
.. class:: UnixConnector(path, *, conn_timeout=None, \
13951399
keepalive_timeout=30, limit=100, \
13961400
force_close=False, loop=None)
1401+
:canonical: aiohttp.connector.UnixConnector
13971402

13981403
Unix socket connector.
13991404

@@ -1424,6 +1429,7 @@ is controlled by *force_close* constructor's parameter).
14241429

14251430

14261431
.. class:: Connection
1432+
:canonical: aiohttp.connector.Connection
14271433

14281434
Encapsulates single connection in connector object.
14291435

@@ -1462,6 +1468,7 @@ Response object
14621468
---------------
14631469

14641470
.. class:: ClientResponse
1471+
:canonical: aiohttp.client_reqrep.ClientResponse
14651472

14661473
Client response returned by :meth:`aiohttp.ClientSession.request` and family.
14671474

@@ -1713,6 +1720,7 @@ not create an instance of class :class:`ClientWebSocketResponse`
17131720
manually.
17141721

17151722
.. class:: ClientWebSocketResponse()
1723+
:canonical: aiohttp.client_ws.ClientWebSocketResponse
17161724

17171725
Class for handling client-side websockets.
17181726

@@ -1931,6 +1939,7 @@ ClientRequest
19311939
-------------
19321940

19331941
.. class:: ClientRequest
1942+
:canonical: aiohttp.client_reqrep.ClientRequest
19341943

19351944
Represents an HTTP request to be sent by the client.
19361945

@@ -2149,6 +2158,7 @@ Utilities
21492158

21502159
.. class:: ClientTimeout(*, total=None, connect=None, \
21512160
sock_connect=None, sock_read=None)
2161+
:canonical: aiohttp.client.ClientTimeout
21522162

21532163
A data class for client timeout settings.
21542164

@@ -2187,6 +2197,7 @@ Utilities
21872197

21882198

21892199
.. class:: ClientWSTimeout(*, ws_receive=None, ws_close=None)
2200+
:canonical: aiohttp.client_ws.ClientWSTimeout
21902201

21912202
A data class for websocket client timeout settings.
21922203

@@ -2228,6 +2239,7 @@ Utilities
22282239

22292240

22302241
.. class:: ETag(name, is_weak=False)
2242+
:canonical: aiohttp.helpers.ETag
22312243

22322244
Represents `ETag` identifier.
22332245

@@ -2243,6 +2255,7 @@ Utilities
22432255

22442256

22452257
.. class:: ContentDisposition
2258+
:canonical: aiohttp.client_reqrep.ContentDisposition
22462259

22472260
A data class to represent the Content-Disposition header,
22482261
available as :attr:`ClientResponse.content_disposition` attribute.
@@ -2263,6 +2276,7 @@ Utilities
22632276

22642277

22652278
.. class:: RequestInfo()
2279+
:canonical: aiohttp.client_reqrep.RequestInfo
22662280

22672281
A :class:`typing.NamedTuple` with request URL and headers from :class:`~aiohttp.ClientRequest`
22682282
object, available as :attr:`ClientResponse.request_info` attribute.
@@ -2288,6 +2302,7 @@ Utilities
22882302

22892303

22902304
.. class:: BasicAuth(login, password='', encoding='latin1')
2305+
:canonical: aiohttp.helpers.BasicAuth
22912306

22922307
HTTP basic authentication helper.
22932308

@@ -2328,6 +2343,7 @@ Utilities
23282343

23292344

23302345
.. class:: DigestAuthMiddleware(login, password, *, preemptive=True)
2346+
:canonical: aiohttp.client_middleware_digest_auth.DigestAuthMiddleware
23312347

23322348
HTTP digest authentication client middleware.
23332349

@@ -2387,6 +2403,7 @@ Utilities
23872403

23882404

23892405
.. class:: CookieJar(*, unsafe=False, quote_cookie=True, treat_as_secure_origin = [])
2406+
:canonical: aiohttp.cookiejar.CookieJar
23902407

23912408
The cookie jar instance is available as :attr:`ClientSession.cookie_jar`.
23922409

@@ -2488,6 +2505,7 @@ Utilities
24882505

24892506

24902507
.. class:: DummyCookieJar(*, loop=None)
2508+
:canonical: aiohttp.cookiejar.DummyCookieJar
24912509

24922510
Dummy cookie jar which does not store cookies but ignores them.
24932511

@@ -2501,6 +2519,7 @@ Utilities
25012519

25022520

25032521
.. class:: Fingerprint(digest)
2522+
:canonical: aiohttp.client_reqrep.Fingerprint
25042523

25052524
Fingerprint helper for checking SSL certificates by *SHA256* digest.
25062525

@@ -2521,6 +2540,7 @@ Utilities
25212540
.. versionadded:: 3.0
25222541

25232542
.. function:: set_zlib_backend(lib)
2543+
:canonical: aiohttp.compression_utils.set_zlib_backend
25242544

25252545
Sets the compression backend for zlib-based operations.
25262546

@@ -2559,6 +2579,7 @@ Otherwise, ``application/x-www-form-urlencoded`` is used.
25592579
on being called.
25602580

25612581
.. class:: FormData(fields, quote_fields=True, charset=None)
2582+
:canonical: aiohttp.formdata.FormData
25622583

25632584
Helper class for multipart/form-data and application/x-www-form-urlencoded body generation.
25642585

@@ -2634,13 +2655,15 @@ chunks or not enough data that satisfy the content-length header.
26342655
All exceptions are available as members of *aiohttp* module.
26352656

26362657
.. exception:: ClientError
2658+
:canonical: aiohttp.client_exceptions.ClientError
26372659

26382660
Base class for all client specific exceptions.
26392661

26402662
Derived from :exc:`Exception`
26412663

26422664

26432665
.. class:: ClientPayloadError
2666+
:canonical: aiohttp.client_exceptions.ClientPayloadError
26442667

26452668
This exception can only be raised while reading the response
26462669
payload if one of these errors occurs:
@@ -2652,6 +2675,7 @@ All exceptions are available as members of *aiohttp* module.
26522675
Derived from :exc:`ClientError`
26532676

26542677
.. exception:: InvalidURL
2678+
:canonical: aiohttp.client_exceptions.InvalidURL
26552679

26562680
URL used for fetching is malformed, e.g. it does not contain host
26572681
part.
@@ -2667,30 +2691,35 @@ All exceptions are available as members of *aiohttp* module.
26672691
Invalid URL description, :class:`str` instance or :data:`None`.
26682692

26692693
.. exception:: InvalidUrlClientError
2694+
:canonical: aiohttp.client_exceptions.InvalidUrlClientError
26702695

26712696
Base class for all errors related to client url.
26722697

26732698
Derived from :exc:`InvalidURL`
26742699

26752700
.. exception:: RedirectClientError
2701+
:canonical: aiohttp.client_exceptions.RedirectClientError
26762702

26772703
Base class for all errors related to client redirects.
26782704

26792705
Derived from :exc:`ClientError`
26802706

26812707
.. exception:: NonHttpUrlClientError
2708+
:canonical: aiohttp.client_exceptions.NonHttpUrlClientError
26822709

26832710
Base class for all errors related to non http client urls.
26842711

26852712
Derived from :exc:`ClientError`
26862713

26872714
.. exception:: InvalidUrlRedirectClientError
2715+
:canonical: aiohttp.client_exceptions.InvalidUrlRedirectClientError
26882716

26892717
Redirect URL is malformed, e.g. it does not contain host part.
26902718

26912719
Derived from :exc:`InvalidUrlClientError` and :exc:`RedirectClientError`
26922720

26932721
.. exception:: NonHttpUrlRedirectClientError
2722+
:canonical: aiohttp.client_exceptions.NonHttpUrlRedirectClientError
26942723

26952724
Redirect URL does not contain http schema.
26962725

@@ -2700,6 +2729,7 @@ Response errors
27002729
^^^^^^^^^^^^^^^
27012730

27022731
.. exception:: ClientResponseError
2732+
:canonical: aiohttp.client_exceptions.ClientResponseError
27032733

27042734
These exceptions could happen after we get response from server.
27052735

@@ -2737,6 +2767,7 @@ Response errors
27372767

27382768

27392769
.. class:: ContentTypeError
2770+
:canonical: aiohttp.client_exceptions.ContentTypeError
27402771

27412772
Invalid content type.
27422773

@@ -2746,6 +2777,7 @@ Response errors
27462777

27472778

27482779
.. class:: TooManyRedirects
2780+
:canonical: aiohttp.client_exceptions.TooManyRedirects
27492781

27502782
Client was redirected too many times.
27512783

@@ -2758,12 +2790,14 @@ Response errors
27582790

27592791

27602792
.. class:: WSServerHandshakeError
2793+
:canonical: aiohttp.client_exceptions.WSServerHandshakeError
27612794

27622795
Web socket server response error.
27632796

27642797
Derived from :exc:`ClientResponseError`
27652798

27662799
.. exception:: WSMessageTypeError
2800+
:canonical: aiohttp.client_exceptions.WSMessageTypeError
27672801

27682802
Received WebSocket message of unexpected type
27692803

@@ -2773,63 +2807,75 @@ Connection errors
27732807
^^^^^^^^^^^^^^^^^
27742808

27752809
.. class:: ClientConnectionError
2810+
:canonical: aiohttp.client_exceptions.ClientConnectionError
27762811

27772812
These exceptions related to low-level connection problems.
27782813

27792814
Derived from :exc:`ClientError`
27802815

27812816
.. class:: ClientConnectionResetError
2817+
:canonical: aiohttp.client_exceptions.ClientConnectionResetError
27822818

27832819
Derived from :exc:`ClientConnectionError` and :exc:`ConnectionResetError`
27842820

27852821
.. class:: ClientOSError
2822+
:canonical: aiohttp.client_exceptions.ClientOSError
27862823

27872824
Subset of connection errors that are initiated by an :exc:`OSError`
27882825
exception.
27892826

27902827
Derived from :exc:`ClientConnectionError` and :exc:`OSError`
27912828

27922829
.. class:: ClientConnectorError
2830+
:canonical: aiohttp.client_exceptions.ClientConnectorError
27932831

27942832
Connector related exceptions.
27952833

27962834
Derived from :exc:`ClientOSError`
27972835

27982836
.. class:: ClientConnectorDNSError
2837+
:canonical: aiohttp.client_exceptions.ClientConnectorDNSError
27992838

28002839
DNS resolution error.
28012840

28022841
Derived from :exc:`ClientConnectorError`
28032842

28042843
.. class:: ClientProxyConnectionError
2844+
:canonical: aiohttp.client_exceptions.ClientProxyConnectionError
28052845

28062846
Derived from :exc:`ClientConnectorError`
28072847

28082848
.. class:: ClientSSLError
2849+
:canonical: aiohttp.client_exceptions.ClientSSLError
28092850

28102851
Derived from :exc:`ClientConnectorError`
28112852

28122853
.. class:: ClientConnectorSSLError
2854+
:canonical: aiohttp.client_exceptions.ClientConnectorSSLError
28132855

28142856
Response ssl error.
28152857

28162858
Derived from :exc:`ClientSSLError` and :exc:`ssl.SSLError`
28172859

28182860
.. class:: ClientConnectorCertificateError
2861+
:canonical: aiohttp.client_exceptions.ClientConnectorCertificateError
28192862

28202863
Response certificate error.
28212864

28222865
Derived from :exc:`ClientSSLError` and :exc:`ssl.CertificateError`
28232866

28242867
.. class:: UnixClientConnectorError
2868+
:canonical: aiohttp.client_exceptions.UnixClientConnectorError
28252869

28262870
Derived from :exc:`ClientConnectorError`
28272871

28282872
.. class:: ServerConnectionError
2873+
:canonical: aiohttp.client_exceptions.ServerConnectionError
28292874

28302875
Derived from :exc:`ClientConnectionError`
28312876

28322877
.. class:: ServerDisconnectedError
2878+
:canonical: aiohttp.client_exceptions.ServerDisconnectedError
28332879

28342880
Server disconnected.
28352881

@@ -2841,12 +2887,14 @@ Connection errors
28412887

28422888

28432889
.. class:: ServerFingerprintMismatch
2890+
:canonical: aiohttp.client_exceptions.ServerFingerprintMismatch
28442891

28452892
Server fingerprint mismatch.
28462893

28472894
Derived from :exc:`ServerConnectionError`
28482895

28492896
.. class:: ServerTimeoutError
2897+
:canonical: aiohttp.client_exceptions.ServerTimeoutError
28502898

28512899
Server operation timeout: read timeout, etc.
28522900

@@ -2856,12 +2904,14 @@ Connection errors
28562904
Derived from :exc:`ServerConnectionError` and :exc:`asyncio.TimeoutError`
28572905

28582906
.. class:: ConnectionTimeoutError
2907+
:canonical: aiohttp.client_exceptions.ConnectionTimeoutError
28592908

28602909
Connection timeout on ``connect`` and ``sock_connect`` timeouts.
28612910

28622911
Derived from :exc:`ServerTimeoutError`
28632912

28642913
.. class:: SocketTimeoutError
2914+
:canonical: aiohttp.client_exceptions.SocketTimeoutError
28652915

28662916
Reading from socket timeout on ``sock_read`` timeout.
28672917

0 commit comments

Comments
 (0)