Skip to content

Commit

Permalink
Enable install under poetry
Browse files Browse the repository at this point in the history
Implement numpy hack in setup.py to enable install under Poetry piskvorky#3363
  • Loading branch information
simonseed committed Sep 5, 2022
1 parent e889fa3 commit db54e97
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ def finalize_options(self):
build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
# https://docs.python.org/2/library/__builtin__.html#module-__builtin__
__builtins__.__NUMPY_SETUP__ = False
try:
__builtins__.__NUMPY_SETUP__ = False
except:
try:
# For python 3
import builtins
builtins.__NUMPY_SETUP__ = False
except:
print("Skipping numpy hack; if gemsum installation fails, try installing numpy first")

import numpy
self.include_dirs.append(numpy.get_include())
Expand Down

0 comments on commit db54e97

Please sign in to comment.