Commit 69797b3d authored by Simon Conseil's avatar Simon Conseil

Remove custom build_ext, no more necessary with pyproject.toml

parent ff3cb51a
Pipeline #3735 failed with stages
in 30 seconds
......@@ -35,12 +35,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# See README.rst for details on how to install MPDAF.
import numpy
import os
import subprocess
import sys
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.build_ext import build_ext
from setuptools.command.test import test as TestCommand
if sys.version_info[:2] < (3, 6):
......@@ -87,22 +88,6 @@ class PyTest(TestCommand):
sys.exit(errno)
class build_ext(_build_ext, object):
def run(self):
# For extensions that require 'numpy' in their include dirs,
# replace 'numpy' with the actual paths
import numpy
np_include = numpy.get_include()
for extension in self.extensions:
if 'numpy' in extension.include_dirs:
idx = extension.include_dirs.index('numpy')
extension.include_dirs.insert(idx, np_include)
extension.include_dirs.remove('numpy')
super(build_ext, self).run()
def use_openmp():
"""Find if OpenMP must be used or not. Disabled by default on MacOS,
enabled otherwise. Usage can be forced with the USEOPENMP env var.
......@@ -167,7 +152,7 @@ ext = '.pyx' if HAVE_CYTHON else '.c'
ext_modules = [
Extension('obj.merging',
['src/tools.c', './lib/mpdaf/obj/merging' + ext],
include_dirs=['numpy']),
include_dirs=[numpy.get_include()]),
]
if HAVE_PKG_CONFIG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment