File tree 1 file changed +21
-10
lines changed
1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change 1
- from setuptools .errors import CompileError as BaseCompileError
1
+ try :
2
+ from setuptools .errors import CompileError as BaseCompileError
3
+ except ImportError :
4
+ import warnings
5
+ from distutils .errors import CompileError as BaseCompileError # type: ignore
6
+ from importlib .metadata import version
2
7
8
+ # These exception classes were made available in setuptools
9
+ # since v59.0.0 via <https://github.com/pypa/setuptools/pull/2858>
10
+ # in preparation for distutils deprecation. Complain loudly if they
11
+ # are not available.
12
+ setuptools_version = version ("setuptools" )
13
+ warnings .warn (
14
+ f"You appear to be using an ancient version of setuptools: "
15
+ f"v{ setuptools_version } . Please upgrade to at least v59.0.0. "
16
+ f"Support for this version of setuptools is provisionary and "
17
+ f"may be removed without warning in the future."
18
+ )
3
19
4
- class MissingGXX (Exception ):
5
- """
6
- This error is raised when we try to generate c code,
7
- but g++ is not available.
8
20
9
- """
21
+ class MissingGXX (Exception ):
22
+ """This error is raised when we try to generate c code, but g++ is not available."""
10
23
11
24
12
- class CompileError (BaseCompileError ):
13
- """This custom `Exception` prints compilation errors with their original
14
- formatting.
15
- """
25
+ class CompileError (BaseCompileError ): # pyright: ignore
26
+ """Custom `Exception` prints compilation errors with their original formatting."""
16
27
17
28
def __str__ (self ):
18
29
return self .args [0 ]
You can’t perform that action at this time.
0 commit comments