File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,18 @@ you are attempting to validate new spec tests in PyMongo.
246246
247247Follow the [ Python Driver Release Process Wiki] ( https://wiki.corp.mongodb.com/display/DRIVERS/Python+Driver+Release+Process ) .
248248
249+ ## Asyncio considerations
250+
251+ PyMongo adds asyncio capability by modifying the source files in ` */asynchronous ` to ` */synchronous ` using
252+ [ unasync] ( https://github.com/python-trio/unasync/ ) and some custom transforms.
253+
254+ Where possible, edit the code in ` */asynchronous/*.py ` and not the synchronous files.
255+ You can run ` pre-commit run --all-files synchro ` before running tests if you are testing synchronous code.
256+
257+ To prevent the ` synchro ` hook from accidentally overwriting code, it first checks to see whether a sync version
258+ of a file is changing and not its async counterpart, and will fail.
259+ In the unlikely scenario that you want to override this behavior, first export ` OVERRIDE_SYNCHRO_CHECK=1 ` .
260+
249261## Converting a test to async
250262The ` tools/convert_test_to_async.py ` script takes in an existing synchronous test file and outputs a
251263partially-converted asynchronous version of the same name to the ` test/asynchronous ` directory.
You can’t perform that action at this time.
0 commit comments