From 087950d869096cf44a797f6c402985a73ffec16e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 15 Mar 2022 15:49:11 -0500 Subject: [PATCH] PYTHON-3164 Outdated link from PyMongo docs to community forum (#895) --- .github/workflows/test-python.yml | 18 ++++++++++++++++++ bson/binary.py | 2 +- doc/atlas.rst | 2 +- doc/changelog.rst | 2 +- doc/conf.py | 7 +++++++ doc/developer/periodic_executor.rst | 2 +- doc/examples/high_availability.rst | 2 +- doc/examples/mod_wsgi.rst | 6 +++--- doc/examples/tailable.rst | 2 +- doc/examples/tls.rst | 2 +- doc/faq.rst | 2 +- doc/index.rst | 2 +- doc/migrate-to-pymongo4.rst | 7 +++---- doc/tools.rst | 20 ++++++-------------- pymongo/change_stream.py | 2 +- pymongo/collection.py | 8 ++++---- pymongo/database.py | 2 +- pymongo/mongo_client.py | 2 +- pymongo/operations.py | 2 +- 19 files changed, 54 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 5fda9b881..8eec9d9bf 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -65,3 +65,21 @@ jobs: run: | mypy --install-types --non-interactive bson gridfs tools pymongo mypy --install-types --non-interactive --disable-error-code var-annotated --disable-error-code attr-defined --disable-error-code union-attr --disable-error-code assignment --disable-error-code no-redef --disable-error-code index --allow-redefinition --allow-untyped-globals --exclude "test/mypy_fails/*.*" test + + linkcheck: + name: Check Links + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + cache: 'pip' + cache-dependency-path: 'setup.py' + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install sphinx + - name: Check links + run: | + cd doc + make linkcheck diff --git a/bson/binary.py b/bson/binary.py index 93c43ee40..a270eae8d 100644 --- a/bson/binary.py +++ b/bson/binary.py @@ -208,7 +208,7 @@ class Binary(bytes): - `data`: the binary data to represent. Can be any bytes-like type that implements the buffer protocol. - `subtype` (optional): the `binary subtype - `_ + `_ to use .. versionchanged:: 3.9 diff --git a/doc/atlas.rst b/doc/atlas.rst index 6100e9d3c..6685cf9fb 100644 --- a/doc/atlas.rst +++ b/doc/atlas.rst @@ -35,7 +35,7 @@ Connections to Atlas require TLS/SSL. You can read more about TLS versions and their security implications here: - ``_ + ``_ .. _python.org: https://www.python.org/downloads/ .. _homebrew: https://brew.sh/ diff --git a/doc/changelog.rst b/doc/changelog.rst index 61e2b659e..73e2ea9ba 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1072,7 +1072,7 @@ Changes and Deprecations: - Deprecated the MongoClient option `socketKeepAlive`. It now defaults to true and disabling it is not recommended, see `does TCP keepalive time affect MongoDB Deployments? - `_ + `_ - Deprecated :meth:`~pymongo.collection.Collection.initialize_ordered_bulk_op`, :meth:`~pymongo.collection.Collection.initialize_unordered_bulk_op`, and :class:`~pymongo.bulk.BulkOperationBuilder`. Use diff --git a/doc/conf.py b/doc/conf.py index 714e6121d..a5c5be269 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -80,6 +80,13 @@ pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] +# Options for link checking +# The anchors on the rendered markdown page are created after the fact, +# so this link results in a 404. +linkcheck_ignore = [ + "https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#requesting-an-immediate-check" +] + # -- Options for extensions ---------------------------------------------------- autoclass_content = "init" diff --git a/doc/developer/periodic_executor.rst b/doc/developer/periodic_executor.rst index 6327cfd83..9cb0ce0eb 100644 --- a/doc/developer/periodic_executor.rst +++ b/doc/developer/periodic_executor.rst @@ -106,7 +106,7 @@ Thus the current design of periodic executors is surprisingly simple: they do a simple `time.sleep` for a half-second, check if it is time to wake or terminate, and sleep again. -.. _Server Discovery And Monitoring Spec: https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#requesting-an-immediate-check +.. _Server Discovery And Monitoring Spec: https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#requesting-an-immediate-check .. _PYTHON-863: https://jira.mongodb.org/browse/PYTHON-863 diff --git a/doc/examples/high_availability.rst b/doc/examples/high_availability.rst index 19b48f7d0..efd7a66cc 100644 --- a/doc/examples/high_availability.rst +++ b/doc/examples/high_availability.rst @@ -308,7 +308,7 @@ milliseconds of the closest member's ping time. replica set *through* a mongos. The equivalent is the localThreshold_ command line option. -.. _localThreshold: http://docs.mongodb.org/manual/reference/mongos/#cmdoption--localThreshold +.. _localThreshold: https://docs.mongodb.com/manual/reference/program/mongos/#std-option-mongos.--localThreshold .. _health-monitoring: diff --git a/doc/examples/mod_wsgi.rst b/doc/examples/mod_wsgi.rst index 832d779fd..96d6ce892 100644 --- a/doc/examples/mod_wsgi.rst +++ b/doc/examples/mod_wsgi.rst @@ -3,7 +3,7 @@ PyMongo and mod_wsgi ==================== -To run your application under `mod_wsgi `_, +To run your application under `mod_wsgi `_, follow these guidelines: * Run ``mod_wsgi`` in daemon mode with the ``WSGIDaemonProcess`` directive. @@ -48,9 +48,9 @@ interpreter. Python C extensions in general have issues running in multiple Python sub interpreters. These difficulties are explained in the documentation for -`Py_NewInterpreter `_ +`Py_NewInterpreter `_ and in the `Multiple Python Sub Interpreters -`_ +`_ section of the ``mod_wsgi`` documentation. Beginning with PyMongo 2.7, the C extension for BSON detects when it is running diff --git a/doc/examples/tailable.rst b/doc/examples/tailable.rst index 482b049c5..1242e9ddf 100644 --- a/doc/examples/tailable.rst +++ b/doc/examples/tailable.rst @@ -5,7 +5,7 @@ By default, MongoDB will automatically close a cursor when the client has exhausted all results in the cursor. However, for `capped collections `_ you may use a `tailable cursor -`_ +`_ that remains open after the client exhausts the results in the initial cursor. The following is a basic example of using a tailable cursor to tail the oplog diff --git a/doc/examples/tls.rst b/doc/examples/tls.rst index 03ac63a63..f6920ad27 100644 --- a/doc/examples/tls.rst +++ b/doc/examples/tls.rst @@ -32,7 +32,7 @@ MongoDB. You can read more about TLS versions and their security implications here: - ``_ + ``_ .. _python.org: https://www.python.org/downloads/ .. _homebrew: https://brew.sh/ diff --git a/doc/faq.rst b/doc/faq.rst index 44c1c9a98..a7f7c87bd 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -314,7 +314,7 @@ when it is serialized to BSON and used as a query. Thus you can create a subdocument that exactly matches the subdocument in the collection. .. seealso:: `MongoDB Manual entry on subdocument matching - `_. + `_. What does *CursorNotFound* cursor id not valid at server mean? -------------------------------------------------------------- diff --git a/doc/index.rst b/doc/index.rst index da05bf80a..8fd357b4c 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -54,7 +54,7 @@ everything you need to know to use **PyMongo**. Getting Help ------------ If you're having trouble or have questions about PyMongo, ask your question on -our `MongoDB Community Forum `_. +our `MongoDB Community Forum `_. You may also want to consider a `commercial support subscription `_. Once you get an answer, it'd be great if you could work it back into this diff --git a/doc/migrate-to-pymongo4.rst b/doc/migrate-to-pymongo4.rst index b993e32f4..6fcbdf501 100644 --- a/doc/migrate-to-pymongo4.rst +++ b/doc/migrate-to-pymongo4.rst @@ -88,8 +88,7 @@ The socketKeepAlive parameter is removed Removed the ``socketKeepAlive`` keyword argument to :class:`~pymongo.mongo_client.MongoClient`. PyMongo now always enables TCP -keepalive. For more information see: -https://docs.mongodb.com/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments +keepalive. For more information see the `documentation `_. Renamed URI options ................... @@ -545,8 +544,8 @@ Can be changed to this:: .. _$expr: https://docs.mongodb.com/manual/reference/operator/query/expr/ .. _$geoWithin: https://docs.mongodb.com/manual/reference/operator/query/geoWithin/ -.. _$center: https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center -.. _$centerSphere: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere +.. _$center: https://docs.mongodb.com/manual/reference/operator/query/center/ +.. _$centerSphere: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/ Collection.initialize_ordered_bulk_op and initialize_unordered_bulk_op is removed ................................................................................. diff --git a/doc/tools.rst b/doc/tools.rst index 304a1eaf5..69ee64448 100644 --- a/doc/tools.rst +++ b/doc/tools.rst @@ -34,8 +34,7 @@ PyMODM libraries to target platforms like Django. At the same time, PyMODM is powerful enough to be used for developing applications on its own. Complete documentation is available on `readthedocs - `_ in addition to a `Gitter channel - `_ for discussing the project. + `_. Humongolus `Humongolus `_ is a lightweight ORM @@ -72,7 +71,7 @@ MongoEngine documents and query collections using syntax inspired by the Django ORM. The code is available on `GitHub `_; for more information, see - the `tutorial `_. + the `tutorial `_. MotorEngine `MotorEngine `_ is a port of @@ -122,10 +121,10 @@ Framework Tools This section lists tools and adapters that have been designed to work with various Python frameworks and libraries. -* `Djongo `_ is a connector for using +* `Djongo `_ is a connector for using Django with MongoDB as the database backend. Use the Django Admin GUI to add and modify documents in MongoDB. - The `Djongo Source Code `_ is hosted on GitHub + The `Djongo Source Code `_ is hosted on GitHub and the `Djongo package `_ is on pypi. * `Django MongoDB Engine `_ is a MongoDB @@ -138,24 +137,17 @@ various Python frameworks and libraries. `_ is a MongoDB backend for Django, an `example: `_. - For more information ``_ + For more information see ``_ * `mongodb_beaker `_ is a - project to enable using MongoDB as a backend for `beaker's - `_ caching / session system. + project to enable using MongoDB as a backend for `beakers `_ caching / session system. `The source is on GitHub `_. * `Log4Mongo `_ is a flexible Python logging handler that can store logs in MongoDB using normal and capped collections. * `MongoLog `_ is a Python logging handler that stores logs in MongoDB using a capped collection. -* `c5t `_ is a content-management system - using TurboGears and MongoDB. * `rod.recipe.mongodb `_ is a ZC Buildout recipe for downloading and installing MongoDB. -* `repoze-what-plugins-mongodb - `_ is a project - working to support a plugin for using MongoDB as a backend for - :mod:`repoze.what`. * `mongobox `_ is a tool to run a sandboxed MongoDB instance from within a python app. * `Flask-MongoAlchemy `_ Add diff --git a/pymongo/change_stream.py b/pymongo/change_stream.py index d054046bd..db3399978 100644 --- a/pymongo/change_stream.py +++ b/pymongo/change_stream.py @@ -78,7 +78,7 @@ class ChangeStream(Generic[_DocumentType]): :meth:`pymongo.mongo_client.MongoClient.watch` instead. .. versionadded:: 3.6 - .. seealso:: The MongoDB documentation on `changeStreams `_. + .. seealso:: The MongoDB documentation on `changeStreams `_. """ def __init__( diff --git a/pymongo/collection.py b/pymongo/collection.py index 46916f98f..ad75fb760 100644 --- a/pymongo/collection.py +++ b/pymongo/collection.py @@ -1784,8 +1784,8 @@ class Collection(common.BaseObject, Generic[_DocumentType]): .. _$expr: https://docs.mongodb.com/manual/reference/operator/query/expr/ .. _$geoWithin: https://docs.mongodb.com/manual/reference/operator/query/geoWithin/ - .. _$center: https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center - .. _$centerSphere: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere + .. _$center: https://docs.mongodb.com/manual/reference/operator/query/center/ + .. _$centerSphere: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/ """ pipeline = [{"$match": filter}] if "skip" in kwargs: @@ -2011,7 +2011,7 @@ class Collection(common.BaseObject, Generic[_DocumentType]): .. seealso:: The MongoDB documentation on `indexes `_. - .. _wildcard index: https://docs.mongodb.com/master/core/index-wildcard/#wildcard-index-core + .. _wildcard index: https://docs.mongodb.com/master/core/index-wildcard/ """ cmd_options = {} if "maxTimeMS" in kwargs: @@ -2557,7 +2557,7 @@ class Collection(common.BaseObject, Generic[_DocumentType]): .. versionadded:: 3.6 - .. seealso:: The MongoDB documentation on `changeStreams `_. + .. seealso:: The MongoDB documentation on `changeStreams `_. .. _change streams specification: https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst diff --git a/pymongo/database.py b/pymongo/database.py index c2f2eb4bc..934b50219 100644 --- a/pymongo/database.py +++ b/pymongo/database.py @@ -558,7 +558,7 @@ class Database(common.BaseObject, Generic[_DocumentType]): .. versionadded:: 3.7 - .. seealso:: The MongoDB documentation on `changeStreams `_. + .. seealso:: The MongoDB documentation on `changeStreams `_. .. _change streams specification: https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst diff --git a/pymongo/mongo_client.py b/pymongo/mongo_client.py index cd9067f46..ee8927981 100644 --- a/pymongo/mongo_client.py +++ b/pymongo/mongo_client.py @@ -932,7 +932,7 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]): .. versionadded:: 3.7 - .. seealso:: The MongoDB documentation on `changeStreams `_. + .. seealso:: The MongoDB documentation on `changeStreams `_. .. _change streams specification: https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst diff --git a/pymongo/operations.py b/pymongo/operations.py index 8f264c48c..e528f2a2d 100644 --- a/pymongo/operations.py +++ b/pymongo/operations.py @@ -488,7 +488,7 @@ class IndexModel(object): Added the ``partialFilterExpression`` option to support partial indexes. - .. _wildcard index: https://docs.mongodb.com/master/core/index-wildcard/#wildcard-index-core + .. _wildcard index: https://docs.mongodb.com/master/core/index-wildcard/ """ keys = _index_list(keys) if "name" not in kwargs: