85
85
_MESON_REQUIRED_VERSION = '0.63.3' # keep in sync with the version requirement in pyproject.toml
86
86
87
87
88
- class _depstr :
89
- """Namespace that holds the requirement strings for dependencies we *might*
90
- need at runtime. Having them in one place makes it easier to update.
91
- """
92
- patchelf = 'patchelf >= 0.11.0'
93
- ninja = f'ninja >= { _NINJA_REQUIRED_VERSION } '
94
-
95
-
96
88
def _init_colors () -> Dict [str , str ]:
97
89
"""Detect if we should be using colors in the output. We will enable colors
98
90
if running in a TTY, and no environment variable overrides it. Setting the
@@ -1017,12 +1009,13 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
1017
1009
1018
1010
1019
1011
@_pyproject_hook
1020
- def get_requires_for_build_sdist (
1021
- config_settings : Optional [ Dict [ str , str ]] = None ,
1022
- ) -> List [ str ]:
1012
+ def get_requires_for_build_sdist (config_settings : Optional [ Dict [ str , str ]] = None ) -> List [ str ]:
1013
+ dependencies = []
1014
+
1023
1015
if os .environ .get ('NINJA' ) is None and _env_ninja_command () is None :
1024
- return [_depstr .ninja ]
1025
- return []
1016
+ dependencies .append (f'ninja >= { _NINJA_REQUIRED_VERSION } ' )
1017
+
1018
+ return dependencies
1026
1019
1027
1020
1028
1021
@_pyproject_hook
@@ -1042,10 +1035,10 @@ def get_requires_for_build_wheel(config_settings: Optional[Dict[str, str]] = Non
1042
1035
dependencies = []
1043
1036
1044
1037
if os .environ .get ('NINJA' ) is None and _env_ninja_command () is None :
1045
- dependencies .append (_depstr . ninja )
1038
+ dependencies .append (f' ninja >= { _NINJA_REQUIRED_VERSION } ' )
1046
1039
1047
1040
if sys .platform .startswith ('linux' ) and not shutil .which ('patchelf' ):
1048
- dependencies .append (_depstr . patchelf )
1041
+ dependencies .append (' patchelf >= 0.11.0' )
1049
1042
1050
1043
return dependencies
1051
1044
0 commit comments