From f6a7d4195e2334f41b45618f30c158f9525b74c8 Mon Sep 17 00:00:00 2001 From: Misha Salim Date: Fri, 8 Apr 2022 14:09:44 -0500 Subject: [PATCH] Defer numpy import on first pass of setup.py --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d922a42d..ae0aca87 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,13 @@ import platform import sys -import numpy +try: + import numpy +except: # noqa: E722 + from unittest.mock import MagicMock + sys.modules["numpy"] = MagicMock() + import numpy + from setuptools import Extension, setup from setuptools.command.test import test as TestCommand import versioneer