Skip to content

Commit f016e85

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents 67bb82a + 3a3f3d2 commit f016e85

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

.evergreen/scripts/generate-config.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# Entry point for the generate-config pre-commit hook.
3+
4+
set -eu
5+
6+
python .evergreen/scripts/generate_config.py

.evergreen/scripts/generate_config.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# /// script
2-
# requires-python = ">=3.9"
3-
# dependencies = [
4-
# "shrub.py>=3.2.0",
5-
# "pyyaml>=6.0.2"
6-
# ]
7-
# ///
8-
9-
# Note: Run this file with `pipx run`, or `uv run`.
1+
# Note: See CONTRIBUTING.md for how to update/run this file.
102
from __future__ import annotations
113

124
import sys
@@ -1113,7 +1105,7 @@ def write_variants_to_file():
11131105
with target.open("w") as fid:
11141106
fid.write("buildvariants:\n")
11151107

1116-
for name, func in getmembers(mod, isfunction):
1108+
for name, func in sorted(getmembers(mod, isfunction)):
11171109
if not name.endswith("_variants"):
11181110
continue
11191111
if not name.startswith("create_"):
@@ -1143,7 +1135,7 @@ def write_tasks_to_file():
11431135
with target.open("w") as fid:
11441136
fid.write("tasks:\n")
11451137

1146-
for name, func in getmembers(mod, isfunction):
1138+
for name, func in sorted(getmembers(mod, isfunction)):
11471139
if not name.endswith("_tasks"):
11481140
continue
11491141
if not name.startswith("create_"):

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,9 @@ repos:
116116
(?x)(
117117
.evergreen/retry-with-backoff.sh
118118
)
119+
- id: generate-config
120+
name: generate-config
121+
entry: .evergreen/scripts/generate-config.sh
122+
language: python
123+
require_serial: true
124+
additional_dependencies: ["shrub.py>=3.2.0", "pyyaml>=6.0.2"]

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ If you are running one of the `no-responder` tests, omit the `run-server` step.
367367
- If there are any special test considerations, including not running `pytest` at all, handle it in `.evergreen/scripts/run_tests.py`.
368368
- If there are any services or atlas clusters to teardown, handle them in `.evergreen/scripts/teardown_tests.py`.
369369
- Add functions to generate the test variant(s) and task(s) to the `.evergreen/scripts/generate_config.py`.
370-
- Regenerate the test variants and tasks using the instructions in `.evergreen/scripts/generate_config.py`.
370+
- Regenerate the test variants and tasks using `pre-commit run --all-files generate-config`.
371371
- Make sure to add instructions for running the test suite to `CONTRIBUTING.md`.
372372

373373
## Re-sync Spec Tests

0 commit comments

Comments
 (0)