Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor distutils -> setuptools #293

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ In Ubunutu 20.04::
$ sudo apt install build-essential curl git file pkg-config swig \
libcairo2-dev libnetpbm10-dev netpbm libpng-dev libjpeg-dev \
zlib1g-dev libbz2-dev libcfitsio-dev wcslib-dev \
python3 python3-pip python3-distutils python3-dev \
python3 python3-pip python3-dev \
python3-numpy python3-scipy python3-pil
$ pip install fitsio # or astropy

Expand Down
2 changes: 1 addition & 1 deletion libkd/setup-min.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is part of libkd.
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
from distutils.core import setup, Extension
from setuptools import setup, Extension
import os.path

from numpy import get_include
Expand Down
2 changes: 1 addition & 1 deletion libkd/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function
# This file is part of libkd.
# Licensed under a 3-clause BSD style license - see LICENSE
from distutils.core import setup, Extension
from setuptools import setup, Extension
import os.path

from numpy import get_include
Expand Down
2 changes: 1 addition & 1 deletion plot/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from an_build_ext import an_build_ext
from setuputils import *

from distutils.core import setup, Extension
from setuptools import setup, Extension

import numpy
numpy_inc = numpy.get_include()
Expand Down
2 changes: 1 addition & 1 deletion sdss/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from distutils.core import setup, Extension
from setuptools import setup, Extension
import os
import sys

Expand Down
2 changes: 1 addition & 1 deletion setup-libkd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from distutils.core import setup, Extension
from setuptools import setup, Extension

from numpy import get_include
numpy_inc = get_include()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function
from distutils.core import setup, Extension
from setuptools import setup, Extension
from setuptools.command.install import install
import subprocess
import os
Expand Down
2 changes: 1 addition & 1 deletion solver/setup-solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


from an_build_ext import an_build_ext
from distutils.core import setup, Extension
from setuptools import setup, Extension
import numpy

numpy_inc = [numpy.get_include()]
Expand Down
13 changes: 9 additions & 4 deletions util/an_build_ext.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from distutils.command.build_ext import build_ext # as _build_py
#from distutils.command import build_ext as _build_ext
from distutils.dep_util import newer_group, newer
from distutils import log
from setuptools.command.build_ext import build_ext # as _build_py
#from setuptools.command import build_ext as _build_ext
try:
from setuptools.modified import newer_group, newer
except ModuleNotFoundError:
from setuptools import distutils
newer_group = distutils.dep_util.newer_group
newer = distutils.dep_util.newer
import logging as log
import os

class an_build_ext(build_ext):
Expand Down
6 changes: 3 additions & 3 deletions util/makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ SHAREDLIBFLAGS_DEF := $(shell $(LINKTEST))
SHAREDLIB_SUFFIX = so

# Cygwin peculiarities:
# --.dll filename suffix for shared libraries (created by python distutils)
# --.dll filename suffix for shared libraries (created by python setuptools)
# -- -fPIC produces warnings

UNAME = $(shell uname -s)
ifneq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
SHAREDLIBFLAGS_DEF += -fPIC
endif

# Get the library suffix used by python distutils (.dll on cygwin, .so elsewhere for py2; .PLATFORM.so for py3)
PYTHON_SO_EXT ?= $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX') or sysconfig.get_config_var('SO'))")
# Get the library suffix used by python sysconfig (.dll on cygwin, .so elsewhere for py2; .PLATFORM.so for py3)
PYTHON_SO_EXT ?= $(shell $(PYTHON) -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX') or sysconfig.get_config_var('SO'))")

# Set a default, otherwise terrible things happen:
# in util/Makefile : clean: rm -f *$(PYTHON_SO_EXT)
Expand Down
2 changes: 1 addition & 1 deletion util/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from an_build_ext import *

from distutils.core import setup, Extension
from setuptools import setup, Extension
import numpy
from setuputils import *

Expand Down
Loading