Skip to content

Commit 3a1642a

Browse files
authored
Ports from distutils to setuptools (#166)
In [PEP-632](https://peps.python.org/pep-0632/) `distutils` becomes deprecated and applications should be ported to `setuptools` At the moment `setuptools` does not implement `distutils.ccompiler.new_compiler()` see pypa/setuptools#4540 closes #139
2 parents f5517e4 + 591a3cb commit 3a1642a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

scorep/subsystem.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def generate(scorep_config, keep_files=False):
8888
# setuptools, which replaces distutils, calls uname in python < 3.9 during distutils bootstraping.
8989
# When LD_PRELOAD is set, this leads to preloading Score-P to uname, and crashes the later tracing.
9090
# To avoid this, we need to do the distutils bootstrap as late as possible.
91-
import distutils.ccompiler
92-
cc = distutils.ccompiler.new_compiler()
91+
# Setuptools does not support ccompiler.new_compiler https://github.com/pypa/setuptools/issues/4540
92+
from setuptools._distutils.ccompiler import new_compiler
93+
cc = new_compiler()
9394

9495
compiled_subsystem = cc.compile(
9596
[temp_dir + "/scorep_init.c"], output_dir=temp_dir)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import sys
3-
from distutils.core import setup, Extension
3+
from setuptools import setup, Extension
44
import scorep.helper
55
from scorep.instrumenter import has_c_instrumenter
66

0 commit comments

Comments
 (0)