Skip to content

Commit a89c299

Browse files
committed
ENH: disable saving the bytecode cache for editable Python modules
This avoids cluttering the source directory with bytecode cache. It should also avoid surprising behavior when the source is removed from version control but the bytecode cache is still present in the working directory.
1 parent 1fd5586 commit a89c299

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mesonpy/_editable.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ def __init__(self, name: str, path: str, tree: Node):
151151
super().__init__(name, path)
152152
self._tree = tree
153153

154+
def set_data(self, path: Union[bytes, str], data: bytes, *, _mode: int = ...) -> None:
155+
# disable saving bytecode
156+
pass
157+
154158
def get_resource_reader(self, name: str) -> TraversableResources:
155159
return MesonpyReader(name, self._tree)
156160

0 commit comments

Comments
 (0)