We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5c5886 commit e7d1ea4Copy full SHA for e7d1ea4
setup.py
@@ -18,6 +18,7 @@
18
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
# SOFTWARE.
20
21
+import functools
22
import os
23
import shutil
24
import subprocess
@@ -42,6 +43,11 @@ def build_extension(self, ext):
42
43
super().build_extension(ext)
44
45
46
+# Use a cache to prevent isa-l from being build twice. According to the
47
+# functools docs lru_cache with maxsize None is faster. The shortcut called
48
+# 'cache' is only available from python 3.9 onwards.
49
+# see: https://docs.python.org/3/library/functools.html#functools.cache
50
+@functools.lru_cache(maxsize=None)
51
def build_isa_l():
52
# Creating temporary directories
53
unpack_dir = tempfile.mktemp()
0 commit comments