Instagram / LibCST

A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree
https://libcst.readthedocs.io/
Other
1.57k stars 192 forks source link

fix certain matchers breaking under multiprocessing by initializing them late #1204

Closed kiri11 closed 2 months ago

kiri11 commented 2 months ago

Support matcher decorators with multiprocessing on Windows/macOS.

See issue #1181 for more context.

Summary

Test Plan

Before

> hatch run python -m unittest libcst.codemod.tests.test_codemod_cli.TestCodemodCLI.test_matcher_decorators_multiprocessing

FAILED (failures=1)

After

> hatch run python -m unittest libcst.codemod.tests.test_codemod_cli.TestCodemodCLI.test_matcher_decorators_multiprocessing     
.
----------------------------------------------------------------------
Ran 1 test in 0.973s

OK