@@ -110,33 +110,13 @@ def build():
110110 # set VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools
111111
112112 if "GITHUB_ACTION" not in os .environ :
113- if sys .version_info [:2 ] in ((3 , 6 ), (3 , 7 ), (3 , 8 ), (3 , 9 ), (3 , 10 ), (3 , 11 ), (3 , 12 ), (3 , 13 )):
114- FORCE_PYDEVD_VC_VARS = os .environ .get ("FORCE_PYDEVD_VC_VARS" )
115- if FORCE_PYDEVD_VC_VARS :
116- env .update (get_environment_from_batch_command ([FORCE_PYDEVD_VC_VARS ], initial = os .environ .copy ()))
117- else :
118- try :
119- from setuptools ._distutils ._msvccompiler import _find_vcvarsall as find_vcvarsall
120- except Exception :
121- import setuptools # We have to import it first for the compiler to be found
122- from distutils .msvc9compiler import find_vcvarsall
123-
124- vcvarsall = find_vcvarsall (14.0 )
125- if isinstance (vcvarsall , tuple ):
126- vcvarsall = vcvarsall [0 ]
127- if vcvarsall is None or not os .path .exists (vcvarsall ):
128- msvc_version = msvc9compiler .get_build_version ()
129- print ("msvc_version" , msvc_version )
130- vcvarsall = find_vcvarsall (msvc_version )
131-
132- if vcvarsall is None or not os .path .exists (vcvarsall ):
133- raise RuntimeError ("Error finding vcvarsall." )
134-
135- if is_python_64bit ():
136- env .update (get_environment_from_batch_command ([vcvarsall , "amd64" ], initial = os .environ .copy ()))
137- else :
138- env .update (get_environment_from_batch_command ([vcvarsall , "x86" ], initial = os .environ .copy ()))
139-
113+ FORCE_PYDEVD_VC_VARS = os .environ .get ("FORCE_PYDEVD_VC_VARS" )
114+ if not FORCE_PYDEVD_VC_VARS :
115+ FORCE_PYDEVD_VC_VARS = r"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
116+ if not os .path .exists (FORCE_PYDEVD_VC_VARS ):
117+ raise RuntimeError ("Unable to find vcvars64.bat Please set FORCE_PYDEVD_VC_VARS environment variable to the path to the vcvars64.bat file." )
118+ if FORCE_PYDEVD_VC_VARS :
119+ env .update (get_environment_from_batch_command ([FORCE_PYDEVD_VC_VARS ], initial = os .environ .copy ()))
140120 else :
141121 raise AssertionError ("Unable to setup environment for Python: %s" % (sys .version ,))
142122
0 commit comments