Merge branch 'master' of github.com:mongodb/mongo-python-driver

This commit is contained in:
Steven Silvester 2025-06-11 14:54:57 -05:00
commit 18588793fe
No known key found for this signature in database
GPG Key ID: B1BF5EC3A8B32F91
4 changed files with 18 additions and 13 deletions

View File

@ -1700,8 +1700,7 @@ Changes in Version 3.8.0 (2019/04/22)
-------------------------------------
.. warning:: PyMongo no longer supports Python 2.6. RHEL 6 users should install
Python 2.7 or newer from `Red Hat Software Collections
<https://developers.redhat.com/products/softwarecollections/overview>`_.
Python 2.7 or newer from Red Hat Software Collections.
CentOS 6 users should install Python 2.7 or newer from `SCL
<https://wiki.centos.org/AdditionalResources/Repositories/SCL>`_

View File

@ -82,7 +82,7 @@ pygments_style = "sphinx"
# Options for link checking
# The anchors on the rendered markdown page are created after the fact,
# so those link results in a 404.
# wiki.centos.org has been flakey.
# wiki.centos.org has been flaky.
# 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.md#requesting-an-immediate-check",
@ -91,6 +91,9 @@ linkcheck_ignore = [
r"https://sourceforge.net/",
]
# Allow for flaky links.
linkcheck_retries = 3
# -- Options for extensions ----------------------------------------------------
autoclass_content = "init"

View File

@ -27,17 +27,15 @@ from test.asynchronous import AsyncIntegrationTest
class TestAsyncContextVarsReset(AsyncIntegrationTest):
async def test_context_vars_are_reset_in_executor(self):
if sys.version_info < (3, 11):
self.skipTest("Test requires asyncio.Task.get_context (added in Python 3.11)")
if sys.version_info < (3, 12):
self.skipTest("Test requires asyncio.Task.get_context (added in Python 3.12)")
client = self.simple_client()
await client.db.test.insert_one({"x": 1})
for server in client._topology._servers.values():
await self.client.db.test.insert_one({"x": 1})
for server in self.client._topology._servers.values():
for context in [
c
for c in server._monitor._executor._task.get_context()
if c.name in ["TIMEOUT", "RTT", "DEADLINE"]
]:
self.assertIn(context.get(), [None, float("inf"), 0.0])
await client.db.test.delete_many({})
await self.client.db.test.delete_many({})

View File

@ -417,13 +417,18 @@ def unasync_directory(files: list[str], src: str, dest: str, replacements: dict[
def main() -> None:
modified_files = [f"./{f}" for f in sys.argv[1:]]
errored = False
for fname in async_files + gridfs_files:
for fname in async_files + gridfs_files + test_files:
# If the async file was modified, we don't need to check if the sync file was also modified.
if str(fname) in modified_files:
continue
sync_name = str(fname).replace("asynchronous", "synchronous")
if sync_name in modified_files and "OVERRIDE_SYNCHRO_CHECK" not in os.environ:
print(f"Refusing to overwrite {sync_name}")
test_sync_name = str(fname).replace("/asynchronous", "")
if (
sync_name in modified_files
or test_sync_name in modified_files
and "OVERRIDE_SYNCHRO_CHECK" not in os.environ
):
print(f"Refusing to overwrite {test_sync_name}")
errored = True
if errored:
raise ValueError("Aborting synchro due to errors")