Skip to content

Commit

Permalink
PYTHON-4813 Update specification documentation links (#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Oct 30, 2024
1 parent 2332d69 commit 351196b
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The PyMongo distribution contains tools for interacting with MongoDB
database from Python. The `bson` package is an implementation of the
[BSON format](http://bsonspec.org) for Python. The `pymongo` package is
a native Python driver for MongoDB. The `gridfs` package is a
[gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/)
[gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.md/)
implementation on top of `pymongo`.

PyMongo supports MongoDB 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0.
Expand Down
2 changes: 1 addition & 1 deletion bson/json_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
when :const:`CANONICAL_JSON_OPTIONS` or :const:`LEGACY_JSON_OPTIONS` is
provided, respectively.
.. _Extended JSON: https://github.com/mongodb/specifications/blob/master/source/extended-json.rst
.. _Extended JSON: https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md
Example usage (deserialization):
Expand Down
2 changes: 1 addition & 1 deletion doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interacting with MongoDB. :mod:`bson` is an implementation of the
`BSON format <http://bsonspec.org>`_, :mod:`pymongo` is a
full-featured driver for MongoDB, and :mod:`gridfs` is a set of tools
for working with the `GridFS
<https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/>`_ storage
<https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.md/>`_ storage
specification.

.. toctree::
Expand Down
8 changes: 4 additions & 4 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ See the `PyMongo 4.0 release notes in JIRA`_ for the list of resolved issues
in this release.

.. _PyMongo 4.0 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=18463
.. _DBRef specification: https://github.com/mongodb/specifications/blob/5a8c8d7/source/dbref.rst
.. _DBRef specification: https://github.com/mongodb/specifications/blob/master/source/dbref/dbref.md

Changes in Version 3.13.0 (2022/11/01)
--------------------------------------
Expand Down Expand Up @@ -1562,7 +1562,7 @@ Unavoidable breaking changes:
bumped to 1.16.0. This is a breaking change for applications that use
PyMongo's SRV support with a version of ``dnspython`` older than 1.16.0.

.. _URI options specification: https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst
.. _URI options specification: https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.md


Issues Resolved
Expand All @@ -1586,7 +1586,7 @@ Changes in Version 3.8.0 (2019/04/22)
must upgrade to PyPy3.5+.

- :class:`~bson.objectid.ObjectId` now implements the `ObjectID specification
version 0.2 <https://github.com/mongodb/specifications/blob/master/source/objectid.rst>`_.
version 0.2 <https://github.com/mongodb/specifications/blob/master/source/bson-objectid/objectid.md>`_.
- For better performance and to better follow the GridFS spec,
:class:`~gridfs.grid_file.GridOut` now uses a single cursor to read all the
chunks in the file. Previously, each chunk in the file was queried
Expand Down Expand Up @@ -1948,7 +1948,7 @@ Highlights include:
:class:`~pymongo.operations.UpdateOne`, and
:class:`~pymongo.operations.UpdateMany`.
- Implemented the `MongoDB Extended JSON
<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst>`_
<https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md>`_
specification.
- :class:`~bson.decimal128.Decimal128` now works when cdecimal is installed.
- PyMongo is now tested against a wider array of operating systems and CPU
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# wiki.centos.org has been flakey.
# sourceforge.net is giving a 403 error, but is still accessible from the browser.
linkcheck_ignore = [
"https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#requesting-an-immediate-check",
"https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.md#requesting-an-immediate-check",
"https://github.com/mongodb/libmongocrypt/blob/master/bindings/python/README.rst#installing-from-source",
r"https://wiki.centos.org/[\w/]*",
r"http://sourceforge.net/",
Expand Down
2 changes: 1 addition & 1 deletion doc/developer/periodic_executor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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-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.md#requesting-an-immediate-check

.. _PYTHON-863: https://jira.mongodb.org/browse/PYTHON-863

Expand Down
2 changes: 1 addition & 1 deletion doc/examples/uuid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Finally, the same UUID would historically be serialized by the Java driver as::
.. note:: For in-depth information about the the byte-order historically
used by different drivers, see the `Handling of Native UUID Types
Specification
<https://github.com/mongodb/specifications/blob/master/source/uuid.rst>`_.
<https://github.com/mongodb/specifications/blob/master/source/bson-binary-uuid/uuid.md>`_.

This difference in the byte-order of UUIDs encoded by different drivers can
result in highly unintuitive behavior in some scenarios. We detail two such
Expand Down
4 changes: 2 additions & 2 deletions doc/migrate-to-pymongo4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Renamed URI options

Several deprecated URI options have been renamed to the standardized
option names defined in the
`URI options specification <https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst>`_.
`URI options specification <https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.md>`_.
The old option names and their renamed equivalents are summarized in the table
below. Some renamed options have different semantics from the option being
replaced as noted in the 'Migration Notes' column.
Expand Down Expand Up @@ -965,7 +965,7 @@ correct type. Otherwise the document is returned as normal. Previously, any
subdocument containing a ``$ref`` field would be decoded as a
:class:`~bson.dbref.DBRef`.

.. _DBRef specification: https://github.com/mongodb/specifications/blob/5a8c8d7/source/dbref.rst
.. _DBRef specification: https://github.com/mongodb/specifications/blob/master/source/dbref/dbref.md

Encoding a UUID raises an error by default
..........................................
Expand Down
6 changes: 3 additions & 3 deletions pymongo/asynchronous/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(
<https://en.wikipedia.org/wiki/TXT_record>`_. See the
`Initial DNS Seedlist Discovery spec
<https://github.com/mongodb/specifications/blob/master/source/
initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.rst>`_
initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.md>`_
for more details. Note that the use of SRV URIs implicitly enables
TLS support. Pass tls=false in the URI to override.
Expand Down Expand Up @@ -367,7 +367,7 @@ def __init__(
:meth:`~pymongo.asynchronous.collection.AsyncCollection.aggregate` using the ``$out``
pipeline operator and any operation with an unacknowledged write
concern (e.g. {w: 0})). See
https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst
https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.md
- `retryReads`: (boolean) Whether supported read operations
executed within this AsyncMongoClient will be retried once after a
network error. Defaults to ``True``.
Expand All @@ -394,7 +394,7 @@ def __init__(
transient errors such as network failures, database upgrades, and
replica set failovers. For an exact definition of which errors
trigger a retry, see the `retryable reads specification
<https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.rst>`_.
<https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.md>`_.
- `compressors`: Comma separated list of compressors for wire
protocol compression. The list is used to negotiate a compressor
Expand Down
2 changes: 1 addition & 1 deletion pymongo/pool_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _metadata_env() -> dict[str, Any]:
_MAX_METADATA_SIZE = 512


# See: https://github.com/mongodb/specifications/blob/5112bcc/source/mongodb-handshake/handshake.rst#limitations
# See: https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.md#limitations
def _truncate_metadata(metadata: MutableMapping[str, Any]) -> None:
"""Perform metadata truncation."""
if len(bson.encode(metadata)) <= _MAX_METADATA_SIZE:
Expand Down
6 changes: 3 additions & 3 deletions pymongo/synchronous/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def __init__(
<https://en.wikipedia.org/wiki/TXT_record>`_. See the
`Initial DNS Seedlist Discovery spec
<https://github.com/mongodb/specifications/blob/master/source/
initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.rst>`_
initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.md>`_
for more details. Note that the use of SRV URIs implicitly enables
TLS support. Pass tls=false in the URI to override.
Expand Down Expand Up @@ -365,7 +365,7 @@ def __init__(
:meth:`~pymongo.collection.Collection.aggregate` using the ``$out``
pipeline operator and any operation with an unacknowledged write
concern (e.g. {w: 0})). See
https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst
https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.md
- `retryReads`: (boolean) Whether supported read operations
executed within this MongoClient will be retried once after a
network error. Defaults to ``True``.
Expand All @@ -392,7 +392,7 @@ def __init__(
transient errors such as network failures, database upgrades, and
replica set failovers. For an exact definition of which errors
trigger a retry, see the `retryable reads specification
<https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.rst>`_.
<https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.md>`_.
- `compressors`: Comma separated list of compressors for wire
protocol compression. The list is used to negotiate a compressor
Expand Down
2 changes: 1 addition & 1 deletion test/asynchronous/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async def test_scram_sha1(self):
await db.command("dbstats")


# https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst#scram-sha-256-and-mechanism-negotiation
# https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#scram-sha-256-and-mechanism-negotiation
class TestSCRAM(AsyncIntegrationTest):
@async_client_context.require_auth
@async_client_context.require_version_min(3, 7, 2)
Expand Down
20 changes: 10 additions & 10 deletions test/asynchronous/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ async def test_automatic(self):
return await self._test_automatic(expected_document_extjson, {"secret_gcp": "string0"})


# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#deadlock-tests
# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#deadlock-tests
class TestDeadlockProse(AsyncEncryptionIntegrationTest):
async def asyncSetUp(self):
self.client_test = await self.async_rs_or_single_client(
Expand Down Expand Up @@ -1837,7 +1837,7 @@ async def test_case_8(self):
self.assertEqual(len(self.topology_listener.results["opened"]), 1)


# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#14-decryption-events
# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#14-decryption-events
class TestDecryptProse(AsyncEncryptionIntegrationTest):
async def asyncSetUp(self):
self.client = async_client_context.client
Expand Down Expand Up @@ -1909,7 +1909,7 @@ async def test_04_decrypt_success(self):
self.assertEqual(event.reply["cursor"]["firstBatch"][0]["encrypted"], self.cipher_text)


# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#bypass-spawning-mongocryptd
# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#bypass-spawning-mongocryptd
class TestBypassSpawningMongocryptdProse(AsyncEncryptionIntegrationTest):
@unittest.skipIf(
os.environ.get("TEST_CRYPT_SHARED"),
Expand Down Expand Up @@ -1990,7 +1990,7 @@ async def test_via_loading_shared_library(self):
with self.assertRaises(ServerSelectionTimeoutError):
await no_mongocryptd_client.db.command("ping")

# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#20-bypass-creating-mongocryptd-client-when-shared-library-is-loaded
# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#20-bypass-creating-mongocryptd-client-when-shared-library-is-loaded
@unittest.skipUnless(os.environ.get("TEST_CRYPT_SHARED"), "crypt_shared lib is not installed")
async def test_client_via_loading_shared_library(self):
connection_established = False
Expand Down Expand Up @@ -2066,7 +2066,7 @@ async def test_invalid_hostname_in_kms_certificate(self):
await self.client_encrypted.create_data_key("aws", master_key=key)


# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#kms-tls-options-tests
# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#kms-tls-options-tests
class TestKmsTLSOptions(AsyncEncryptionIntegrationTest):
@unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set")
async def asyncSetUp(self):
Expand Down Expand Up @@ -2272,7 +2272,7 @@ async def test_06_named_kms_providers_apply_tls_options_kmip(self):
await self.client_encryption_with_names.create_data_key("kmip:with_tls")


# https://github.com/mongodb/specifications/blob/50e26fe/source/client-side-encryption/tests/README.rst#unique-index-on-keyaltnames
# https://github.com/mongodb/specifications/blob/50e26fe/source/client-side-encryption/tests/README.md#unique-index-on-keyaltnames
class TestUniqueIndexOnKeyAltNamesProse(AsyncEncryptionIntegrationTest):
async def asyncSetUp(self):
self.client = async_client_context.client
Expand Down Expand Up @@ -2303,7 +2303,7 @@ async def test_02_add_key_alt_name(self):
assert key_doc["keyAltNames"] == ["def"]


# https://github.com/mongodb/specifications/blob/d4c9432/source/client-side-encryption/tests/README.rst#explicit-encryption
# https://github.com/mongodb/specifications/blob/d4c9432/source/client-side-encryption/tests/README.md#explicit-encryption
class TestExplicitQueryableEncryption(AsyncEncryptionIntegrationTest):
@async_client_context.require_no_standalone
@async_client_context.require_version_min(7, 0, -1)
Expand Down Expand Up @@ -2423,7 +2423,7 @@ async def test_05_roundtrip_encrypted_unindexed(self):
self.assertEqual(decrypted, val)


# https://github.com/mongodb/specifications/blob/072601/source/client-side-encryption/tests/README.rst#rewrap
# https://github.com/mongodb/specifications/blob/072601/source/client-side-encryption/tests/README.md#rewrap
class TestRewrapWithSeparateClientEncryption(AsyncEncryptionIntegrationTest):
MASTER_KEYS: Mapping[str, Mapping[str, Any]] = {
"aws": {
Expand Down Expand Up @@ -2505,7 +2505,7 @@ async def run_test(self, src_provider, dst_provider):
)


# https://github.com/mongodb/specifications/blob/5cf3ed/source/client-side-encryption/tests/README.rst#on-demand-aws-credentials
# https://github.com/mongodb/specifications/blob/5cf3ed/source/client-side-encryption/tests/README.md#on-demand-aws-credentials
class TestOnDemandAWSCredentials(AsyncEncryptionIntegrationTest):
async def asyncSetUp(self):
await super().asyncSetUp()
Expand Down Expand Up @@ -2869,7 +2869,7 @@ async def test_accepts_trim_factor_0(self):
assert len(payload) > len(self.payload_defaults)


# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.rst#automatic-data-encryption-keys
# https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#automatic-data-encryption-keys
class TestAutomaticDecryptionKeys(AsyncEncryptionIntegrationTest):
@async_client_context.require_no_standalone
@async_client_context.require_version_min(7, 0, -1)
Expand Down
4 changes: 2 additions & 2 deletions test/asynchronous/unified_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Unified test format runner.
https://github.com/mongodb/specifications/blob/master/source/unified-test-format/unified-test-format.rst
https://github.com/mongodb/specifications/blob/master/source/unified-test-format/unified-test-format.md
"""
from __future__ import annotations

Expand Down Expand Up @@ -431,7 +431,7 @@ class UnifiedSpecTestMixinV1(AsyncIntegrationTest):
"""Mixin class to run test cases from test specification files.
Assumes that tests conform to the `unified test format
<https://github.com/mongodb/specifications/blob/master/source/unified-test-format/unified-test-format.rst>`_.
<https://github.com/mongodb/specifications/blob/master/source/unified-test-format/unified-test-format.md>`_.
Specification of the test suite being currently run is available as
a class attribute ``TEST_SPEC``.
Expand Down
2 changes: 1 addition & 1 deletion test/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def test_scram_sha1(self):
db.command("dbstats")


# https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst#scram-sha-256-and-mechanism-negotiation
# https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#scram-sha-256-and-mechanism-negotiation
class TestSCRAM(IntegrationTest):
@client_context.require_auth
@client_context.require_version_min(3, 7, 2)
Expand Down
2 changes: 1 addition & 1 deletion test/test_dbref.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_dbref_hash(self):
self.assertNotEqual(hash(dbref_1a), hash(dbref_2a))


# https://github.com/mongodb/specifications/blob/master/source/dbref.rst#test-plan
# https://github.com/mongodb/specifications/blob/master/source/dbref/dbref.md#test-plan
class TestDBRefSpec(unittest.TestCase):
def test_decoding_1_2_3(self):
doc: Any
Expand Down
Loading

0 comments on commit 351196b

Please sign in to comment.