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

Use setuptools instead of distutils #100

Merged
merged 13 commits into from
Oct 21, 2023
Prev Previous commit
Next Next commit
Use version checks for setuptools in setup.py
  • Loading branch information
oscarbenjamin committed Oct 21, 2023
commit c343f39f79cf269f0b153c90a82e394b7f0aa198
20 changes: 16 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
import os
from subprocess import check_call

from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize


default_include_dirs = []
default_lib_dirs = []
if sys.version_info < (3, 12):
from distutils.core import setup
from distutils.extension import Extension
from numpy.distutils.system_info import default_include_dirs, default_lib_dirs
from distutils.sysconfig import get_config_vars
else:
from setuptools import setup
from setuptools.extension import Extension
from sysconfig import get_config_vars
default_include_dirs = []
default_lib_dirs = []


libraries = ["flint"]

Expand All @@ -36,6 +44,10 @@
else:
# For the MSVC toolchain link with mpir instead of gmp
libraries += ["mpir", "mpfr", "pthreads"]
else:
libraries = ["flint"]
(opt,) = get_config_vars('OPT')
os.environ['OPT'] = " ".join(flag for flag in opt.split() if flag != '-Wstrict-prototypes')


define_macros = []
Expand Down
Loading