Skip to content

Commit a7cbe05

Browse files
committed
Bump setuptools in the script because we were using deprecated functions
1 parent 00ace66 commit a7cbe05

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

tools/build.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# "packaging",
55
# "pefile",
66
# "pyelftools", # elftools
7-
# "setuptools < 74",
7+
# "setuptools < 81", # Check the _get_vc_env function before bumping this
88
# ]
99
# ///
1010

@@ -14,10 +14,11 @@
1414
import stat
1515
import subprocess
1616
import sys
17+
import warnings
1718
from datetime import datetime
1819

1920
import packaging.version
20-
import setuptools.msvc
21+
import setuptools._distutils._msvccompiler
2122

2223
os.chdir(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
2324

@@ -87,11 +88,11 @@ def build_binaries(version, arch, system, run_tests=True):
8788
if system == 'linux':
8889
env = None
8990
else:
90-
env = setuptools.msvc.msvc14_get_vc_env(arch)
91-
# env = os.environ.copy()
92-
# msvc_env = setuptools.msvc.EnvironmentInfo(arch).return_env()
93-
# env.update(msvc_env)
94-
# print(env)
91+
# This API is not public and hence it throws warnings, but there are no workarounds for now
92+
# See: https://github.com/pypa/distutils/issues/340
93+
with warnings.catch_warnings():
94+
warnings.simplefilter("ignore")
95+
env = setuptools._distutils._msvccompiler._get_vc_env(arch) # noqa
9596

9697
if os.path.exists('ninja'):
9798
shutil.rmtree('ninja')

tools/rebuild_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# "packaging",
55
# "pefile",
66
# "pyelftools", # elftools
7-
# "setuptools < 74",
7+
# "setuptools < 81", # Check the _get_vc_env function before bumping this
88
# ]
99
# ///
1010

tools/safety_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# "packaging",
55
# "pefile",
66
# "pyelftools", # elftools
7-
# "setuptools < 74",
7+
# "setuptools < 81", # Check the _get_vc_env function before bumping this
88
# ]
99
# ///
1010

0 commit comments

Comments
 (0)