Skip to content

Commit

Permalink
fix a couple of deprecated functions (distutil.sysconfig, numpy.distu…
Browse files Browse the repository at this point in the history
…tils)
  • Loading branch information
dstndstn committed May 10, 2023
1 parent f851361 commit 7fff04d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libkd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ spherematch_c$(PYTHON_SO_EXT): pyspherematch.c setup.py $(SLIB)
# pyspherematch.c includes Python.h -- so have to make sure to add Python.h include path
# (otherwise, get an obscure message from numpy about needing a python built with unicode)
ifeq ($(MAKECMDGOALS),spherematch_c$(PYTHON_SO_EXT))
CFLAGS += $(shell $(PYTHON) -c "from distutils.sysconfig import *; print('-I'+get_python_inc())")
CFLAGS += $(shell $(PYTHON_CONFIG) --cflags)
DEP_OBJ += $(PYSPHEREMATCH_OBJ)
endif
ifeq ($(MAKECMDGOALS),pyspherematch)
CFLAGS += $(shell $(PYTHON) -c "from distutils.sysconfig import *; print('-I'+get_python_inc())")
CFLAGS += $(shell $(PYTHON_CONFIG) --cflags)
DEP_OBJ += $(PYSPHEREMATCH_OBJ)
endif

Expand Down
4 changes: 2 additions & 2 deletions libkd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
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()]

def strlist(s, split=' '):
lst = s.split(split)
Expand Down
1 change: 1 addition & 0 deletions util/makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ INCLUDE_BASE_DIR := $(BASEDIR)/include
INCLUDE_DIR := $(INCLUDE_BASE_DIR)/astrometry

PYTHON ?= python3
PYTHON_CONFIG ?= python3-config
INSTALL_DIR ?= /usr/local/astrometry
# Put INSTALL_DIR in the environment of commands run by Make.
export INSTALL_DIR
Expand Down

0 comments on commit 7fff04d

Please sign in to comment.