diff options
author | Gard Spreemann <gspr@nonempty.org> | 2023-06-14 16:52:13 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2023-06-14 16:52:13 +0200 |
commit | 2b51c7bfcf54d7e17ac7c2514f54408543cbe126 (patch) | |
tree | baf00cc603ceabad00626259eec898e6747d016c /ot/helpers/pre_build_helpers.py | |
parent | a49f648b0b07737f7ef315fb83d8f78871780281 (diff) | |
parent | 96788a3fe5601e4c3f49b592aa0d9c034247862e (diff) |
Merge branch 'dfsg/latest'
Diffstat (limited to 'ot/helpers/pre_build_helpers.py')
-rw-r--r-- | ot/helpers/pre_build_helpers.py | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/ot/helpers/pre_build_helpers.py b/ot/helpers/pre_build_helpers.py index 93ecd6a..2930036 100644 --- a/ot/helpers/pre_build_helpers.py +++ b/ot/helpers/pre_build_helpers.py @@ -4,34 +4,14 @@ import os import sys import glob import tempfile -import setuptools # noqa import subprocess -from distutils.dist import Distribution -from distutils.sysconfig import customize_compiler -from numpy.distutils.ccompiler import new_compiler -from numpy.distutils.command.config_compiler import config_cc +from setuptools.command.build_ext import customize_compiler, new_compiler def _get_compiler(): - """Get a compiler equivalent to the one that will be used to build POT - Handles compiler specified as follows: - - python setup.py build_ext --compiler=<compiler> - - CC=<compiler> python setup.py build_ext - """ - dist = Distribution({'script_name': os.path.basename(sys.argv[0]), - 'script_args': sys.argv[1:], - 'cmdclass': {'config_cc': config_cc}}) - - cmd_opts = dist.command_options.get('build_ext') - if cmd_opts is not None and 'compiler' in cmd_opts: - compiler = cmd_opts['compiler'][1] - else: - compiler = None - - ccompiler = new_compiler(compiler=compiler) + ccompiler = new_compiler() customize_compiler(ccompiler) - return ccompiler |