From 82c3a5d167236cd8854265e55aba22e60bc02341 Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Wed, 8 Feb 2023 15:44:47 +0100 Subject: [PATCH] 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. --- mesonpy/_editable.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mesonpy/_editable.py b/mesonpy/_editable.py index 44601d9c4..304d0cab3 100644 --- a/mesonpy/_editable.py +++ b/mesonpy/_editable.py @@ -148,6 +148,10 @@ def __init__(self, name: str, path: str, tree: Node): super().__init__(name, path) self._tree = tree + def set_data(self, path: Union[bytes, str], data: bytes, *, _mode: int = ...) -> None: + # disable saving bytecode + pass + def get_resource_reader(self, name: str) -> TraversableResources: return MesonpyReader(name, self._tree)