Skip to content

Commit c9ace20

Browse files
committed
PYTHON-2870 Remove problematic mongodoc sphinx extension and add support for man/text/latex/etc.. docs output
1 parent 0680dfa commit c9ace20

16 files changed

+29
-127
lines changed

bson/dbref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, collection, id, database=None, _extra={}, **kwargs):
4242
- `**kwargs` (optional): additional keyword arguments will
4343
create additional, custom fields
4444
45-
.. mongodoc:: dbrefs
45+
.. seealso:: The MongoDB documentation on `dbrefs <https://dochub.mongodb.org/core/dbrefs>`_.
4646
"""
4747
if not isinstance(collection, str):
4848
raise TypeError("collection must be an instance of str")

bson/objectid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self, oid=None):
8989
:Parameters:
9090
- `oid` (optional): a valid ObjectId.
9191
92-
.. mongodoc:: objectids
92+
.. seealso:: The MongoDB documentation on `ObjectIds`_.
9393
9494
.. versionchanged:: 3.8
9595
:class:`~bson.objectid.ObjectId` now implements the `ObjectID

doc/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# Add any Sphinx extension module names here, as strings. They can be extensions
1515
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
1616
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage',
17-
'sphinx.ext.todo', 'doc.mongo_extensions',
18-
'sphinx.ext.intersphinx']
17+
'sphinx.ext.todo', 'sphinx.ext.intersphinx']
1918

2019
# Add any paths that contain templates here, relative to this directory.
2120
templates_path = ['_templates']

doc/examples/encryption.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ level encryption supports workloads where applications must guarantee that
1616
unauthorized parties, including server administrators, cannot read the
1717
encrypted data.
1818

19-
.. mongodoc:: client-side-field-level-encryption
19+
.. seealso:: The MongoDB documentation on `Client Side Field Level Encryption <https://dochub.mongodb.org/core/client-side-field-level-encryption>`_.
2020

2121
Dependencies
2222
------------

doc/examples/geo.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Geospatial Indexing Example
1010
This example shows how to create and use a :data:`~pymongo.GEO2D`
1111
index in PyMongo. To create a spherical (earth-like) geospatial index use :data:`~pymongo.GEOSPHERE` instead.
1212

13-
.. mongodoc:: geo
13+
.. seealso:: The MongoDB documentation on `Geospatial Indexes <https://dochub.mongodb.org/core/geo>`_.
1414

1515
Creating a Geospatial Index
1616
---------------------------

doc/examples/high_availability.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PyMongo makes working with `replica sets
1414
replica set and show how to handle both initialization and normal
1515
connections with PyMongo.
1616

17-
.. mongodoc:: rs
17+
.. seealso:: The MongoDB documentation on `replication <https://dochub.mongodb.org/core/rs>`_.
1818

1919
Starting a Replica Set
2020
~~~~~~~~~~~~~~~~~~~~~~

doc/mongo_extensions.py

Lines changed: 0 additions & 97 deletions
This file was deleted.

gridfs/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
The :mod:`gridfs` package is an implementation of GridFS on top of
1818
:mod:`pymongo`, exposing a file-like interface.
1919
20-
.. mongodoc:: gridfs
20+
.. seealso:: The MongoDB documentation on `gridfs <https://dochub.mongodb.org/core/gridfs>`_.
2121
"""
2222

2323
from collections import abc
@@ -63,7 +63,7 @@ def __init__(self, database, collection="fs", disable_md5=False):
6363
`database` must use an acknowledged
6464
:attr:`~pymongo.database.Database.write_concern`
6565
66-
.. mongodoc:: gridfs
66+
.. seealso:: The MongoDB documentation on `gridfs <https://dochub.mongodb.org/core/gridfs>`_.
6767
"""
6868
if not isinstance(database, Database):
6969
raise TypeError("database must be an instance of Database")
@@ -367,7 +367,7 @@ def find(self, *args, **kwargs):
367367
Removed the read_preference, tag_sets, and
368368
secondary_acceptable_latency_ms options.
369369
.. versionadded:: 2.7
370-
.. mongodoc:: find
370+
.. seealso:: The MongoDB documentation on `find <https://dochub.mongodb.org/core/find>`_.
371371
"""
372372
return GridOutCursor(self.__collection, *args, **kwargs)
373373

@@ -452,7 +452,7 @@ def __init__(self, db, bucket_name="fs",
452452
453453
.. versionadded:: 3.1
454454
455-
.. mongodoc:: gridfs
455+
.. seealso:: The MongoDB documentation on `gridfs <https://dochub.mongodb.org/core/gridfs>`_.
456456
"""
457457
if not isinstance(db, Database):
458458
raise TypeError("database must be an instance of Database")

gridfs/grid_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ def __init__(self, collection, filter=None, skip=0, limit=0,
816816
817817
.. versionadded 2.7
818818
819-
.. mongodoc:: cursors
819+
.. seealso:: The MongoDB documentation on `cursors <https://dochub.mongodb.org/core/cursors>`_.
820820
"""
821821
_disallow_transactions(session)
822822
collection = _clear_entity_type_registry(collection)

pymongo/change_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ChangeStream(object):
6464
:meth:`pymongo.mongo_client.MongoClient.watch` instead.
6565
6666
.. versionadded:: 3.6
67-
.. mongodoc:: changeStreams
67+
.. seealso:: The MongoDB documentation on `changeStreams <https://dochub.mongodb.org/core/changeStreams>`_.
6868
"""
6969
def __init__(self, target, pipeline, full_document, resume_after,
7070
max_await_time_ms, batch_size, collation,

pymongo/client_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
causally consistent session, an application can read its own writes and is
3838
guaranteed monotonic reads, even when reading from replica set secondaries.
3939
40-
.. mongodoc:: causal-consistency
40+
.. seealso:: The MongoDB documentation on `causal-consistency <https://dochub.mongodb.org/core/causal-consistency>`_.
4141
4242
.. _transactions-ref:
4343
@@ -91,7 +91,7 @@
9191
are routed to the same mongos server. When the transaction is completed, by
9292
running either commitTransaction or abortTransaction, the session is unpinned.
9393
94-
.. mongodoc:: transactions
94+
.. seealso:: The MongoDB documentation on `transactions <https://dochub.mongodb.org/core/transactions>`_.
9595
9696
.. _snapshot-reads-ref:
9797

pymongo/collection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def __init__(self, database, name, create=False, codec_options=None,
144144
.. versionadded:: 2.1
145145
uuid_subtype attribute
146146
147-
.. mongodoc:: collections
147+
.. seealso:: The MongoDB documentation on `collections <https://dochub.mongodb.org/core/collections>`_.
148148
"""
149149
super(Collection, self).__init__(
150150
codec_options or database.codec_options,
@@ -1395,7 +1395,7 @@ def find(self, *args, **kwargs):
13951395
13961396
.. _PYTHON-500: https://jira.mongodb.org/browse/PYTHON-500
13971397
1398-
.. mongodoc:: find
1398+
.. seealso:: The MongoDB documentation on `find <https://dochub.mongodb.org/core/find>`_.
13991399
14001400
"""
14011401
return Cursor(self, *args, **kwargs)
@@ -1776,7 +1776,7 @@ def create_index(self, keys, session=None, **kwargs):
17761776
:meth:`create_index` no longer caches index names. Removed support
17771777
for the drop_dups and bucket_size aliases.
17781778
1779-
.. mongodoc:: indexes
1779+
.. seealso:: The MongoDB documentation on `indexes <https://dochub.mongodb.org/core/indexes>`_.
17801780
17811781
.. _wildcard index: https://docs.mongodb.com/master/core/index-wildcard/#wildcard-index-core
17821782
"""
@@ -2224,7 +2224,7 @@ def watch(self, pipeline=None, full_document=None, resume_after=None,
22242224
22252225
.. versionadded:: 3.6
22262226
2227-
.. mongodoc:: changeStreams
2227+
.. seealso:: The MongoDB documentation on `changeStreams <https://dochub.mongodb.org/core/changeStreams>`_.
22282228
22292229
.. _change streams specification:
22302230
https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst

pymongo/command_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def __init__(self, collection, cursor_info, address,
303303
see :meth:`~pymongo.collection.Collection.aggregate_raw_batches`
304304
instead.
305305
306-
.. mongodoc:: cursors
306+
.. seealso:: The MongoDB documentation on `cursors <https://dochub.mongodb.org/core/cursors>`_.
307307
"""
308308
assert not cursor_info.get('firstBatch')
309309
super(RawBatchCommandCursor, self).__init__(

pymongo/cursor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __init__(self, collection, filter=None, projection=None, skip=0,
146146
Should not be called directly by application developers - see
147147
:meth:`~pymongo.collection.Collection.find` instead.
148148
149-
.. mongodoc:: cursors
149+
.. seealso:: The MongoDB documentation on `cursors <https://dochub.mongodb.org/core/cursors>`_.
150150
"""
151151
# Initialize all attributes used in __del__ before possibly raising
152152
# an error to avoid attribute errors during garbage collection.
@@ -494,7 +494,7 @@ def limit(self, limit):
494494
:Parameters:
495495
- `limit`: the number of results to return
496496
497-
.. mongodoc:: limit
497+
.. seealso:: The MongoDB documentation on `limit <https://dochub.mongodb.org/core/limit>`_.
498498
"""
499499
if not isinstance(limit, int):
500500
raise TypeError("limit must be an integer")
@@ -839,7 +839,7 @@ def explain(self):
839839
:meth:`~pymongo.database.Database.command` to run the explain
840840
command directly.
841841
842-
.. mongodoc:: explain
842+
.. seealso:: The MongoDB documentation on `explain <https://dochub.mongodb.org/core/explain>`_.
843843
"""
844844
c = self.clone()
845845
c.__explain = True
@@ -1236,7 +1236,7 @@ def __init__(self, *args, **kwargs):
12361236
see :meth:`~pymongo.collection.Collection.find_raw_batches`
12371237
instead.
12381238
1239-
.. mongodoc:: cursors
1239+
.. seealso:: The MongoDB documentation on `cursors <https://dochub.mongodb.org/core/cursors>`_.
12401240
"""
12411241
super(RawBatchCursor, self).__init__(*args, **kwargs)
12421242

@@ -1253,7 +1253,7 @@ def _unpack_response(self, response, cursor_id, codec_options,
12531253
def explain(self):
12541254
"""Returns an explain plan record for this cursor.
12551255
1256-
.. mongodoc:: explain
1256+
.. seealso:: The MongoDB documentation on `explain <https://dochub.mongodb.org/core/explain>`_.
12571257
"""
12581258
clone = self._clone(deepcopy=True, base=Cursor(self.collection))
12591259
return clone.explain()

pymongo/database.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(self, client, name, codec_options=None, read_preference=None,
7373
:class:`~pymongo.read_concern.ReadConcern`. If ``None`` (the
7474
default) client.read_concern is used.
7575
76-
.. mongodoc:: databases
76+
.. seealso:: The MongoDB documentation on `databases <https://dochub.mongodb.org/core/databases>`_.
7777
7878
.. versionchanged:: 3.2
7979
Added the read_concern option.
@@ -471,7 +471,7 @@ def watch(self, pipeline=None, full_document=None, resume_after=None,
471471
472472
.. versionadded:: 3.7
473473
474-
.. mongodoc:: changeStreams
474+
.. seealso:: The MongoDB documentation on `changeStreams <https://dochub.mongodb.org/core/changeStreams>`_.
475475
476476
.. _change streams specification:
477477
https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst
@@ -603,7 +603,7 @@ def command(self, command, value=1, check=True,
603603
604604
.. _PYTHON-500: https://jira.mongodb.org/browse/PYTHON-500
605605
606-
.. mongodoc:: commands
606+
.. seealso:: The MongoDB documentation on `commands <https://dochub.mongodb.org/core/commands>`_.
607607
"""
608608
if read_preference is None:
609609
read_preference = ((session and session._txn_read_preference())

pymongo/mongo_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def __init__(
494494
client to use Versioned API. See :ref:`versioned-api-ref` for
495495
details.
496496
497-
.. mongodoc:: connections
497+
.. seealso:: The MongoDB documentation on `connections <https://dochub.mongodb.org/core/connections>`_.
498498
499499
.. versionchanged:: 4.0
500500
Removed the ``waitQueueMultiple`` and ``socketKeepAlive`` keyword
@@ -862,7 +862,7 @@ def watch(self, pipeline=None, full_document=None, resume_after=None,
862862
863863
.. versionadded:: 3.7
864864
865-
.. mongodoc:: changeStreams
865+
.. seealso:: The MongoDB documentation on `changeStreams <https://dochub.mongodb.org/core/changeStreams>`_.
866866
867867
.. _change streams specification:
868868
https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst

0 commit comments

Comments
 (0)