Skip to content

Commit

Permalink
Merge pull request #289 from mattiaverga/numpy-distutils-removal
Browse files Browse the repository at this point in the history
Remove calls to numpy.distutils
  • Loading branch information
dstndstn authored Jan 30, 2024
2 parents 35435dc + 6b98ac6 commit e1fcd4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions libkd/setup-min.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
from distutils.core import setup, Extension
import numpy
import os.path

from numpy.distutils.misc_util import get_numpy_include_dirs
numpy_inc = get_numpy_include_dirs()
from numpy import get_include
numpy_inc = get_include()
print('Numpy inc:', numpy_inc)

def strlist(s, split=' '):
Expand All @@ -29,7 +28,7 @@ def strlist(s, split=' '):

c_module = Extension('spherematch_c',
sources = ['pyspherematch.c'],
include_dirs = numpy_inc + inc,
include_dirs = [numpy_inc] + inc,
extra_objects = ['libkd-min.a'],
extra_compile_args = cflags,
extra_link_args=link,
Expand Down
5 changes: 2 additions & 3 deletions libkd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
# This file is part of libkd.
# Licensed under a 3-clause BSD style license - see LICENSE
from distutils.core import setup, Extension
import numpy
import os.path

from numpy import get_include
numpy_inc = [get_include()]
numpy_inc = get_include()

def strlist(s, split=' '):
lst = s.split(split)
Expand All @@ -28,7 +27,7 @@ def strlist(s, split=' '):

c_module = Extension('spherematch_c',
sources = ['pyspherematch.c'],
include_dirs = numpy_inc + inc,
include_dirs = [numpy_inc] + inc,
extra_objects = objs,
extra_compile_args = cflags,
extra_link_args=link,
Expand Down
6 changes: 3 additions & 3 deletions setup-libkd.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
from distutils.core import setup, Extension

from numpy.distutils.misc_util import get_numpy_include_dirs
numpy_inc = get_numpy_include_dirs()
from numpy import get_include
numpy_inc = get_include()

inc = ['include', 'include/astrometry', 'util', 'qfits-an']

Expand Down Expand Up @@ -37,7 +37,7 @@

ext = Extension('astrometry.libkd.spherematch_c',
sources = srcs,
include_dirs = numpy_inc + inc,
include_dirs = [numpy_inc] + inc,
)

setup(name='libkd',
Expand Down

0 comments on commit e1fcd4c

Please sign in to comment.