summaryrefslogtreecommitdiff
path: root/ot/helpers
diff options
context:
space:
mode:
authorNathan Cassereau <84033440+ncassereau-idris@users.noreply.github.com>2022-11-21 17:27:50 +0100
committerGitHub <noreply@github.com>2022-11-21 17:27:50 +0100
commitfa0d4f2afff73284f4b79bfebb085eed332c112f (patch)
tree2b4f175da95f9a4097ca0ab1513b71862a9ee610 /ot/helpers
parente433775c2015eb85c2683b6955618c2836f001bc (diff)
[MRG] Replaces numpy compiler with setuptools (#409)
* Numpy ccompiler deprecation handled with setuptools ccompiler * Remove useless OMP Macro, already provides _OPENMP * RELEASES.md * Remove forgotten temporary bug added for logging purposes
Diffstat (limited to 'ot/helpers')
-rw-r--r--ot/helpers/pre_build_helpers.py24
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