Skip to content

Commit

Permalink
Merge pull request #2675 from echoix/remove-attrdict3
Browse files Browse the repository at this point in the history
Remove attrdict3 build dependency and use plain dict
swt2c authored Jan 22, 2025
2 parents 169aacf + e56e248 commit 15c6e01
Showing 3 changed files with 8 additions and 11 deletions.
16 changes: 7 additions & 9 deletions buildtools/config.py
Original file line number Diff line number Diff line change
@@ -977,7 +977,7 @@ def getVisCVersion():
raise RuntimeError('getMSVCInfo has not been called yet.')
# Convert a float like 14.28 to 140, for historical reasons
# TODO: decide on switching to 142, 143, etc.??
ver = str(int(MSVCinfo.vc_ver)) + '0'
ver = str(int(MSVCinfo["vc_ver"])) + '0'
return ver


@@ -990,7 +990,7 @@ def getExpectedVisCVersion():
"""
if MSVCinfo is None:
raise RuntimeError('getMSVCInfo has not been called yet.')
py_ver = MSVCinfo.py_ver
py_ver = MSVCinfo["py_ver"]
if py_ver in ((3, 5), (3, 6), (3, 7), (3, 8)):
min_ver = 14.0
elif py_ver in ((3, 9), (3, 10)):
@@ -1009,8 +1009,6 @@ def getMSVCInfo(PYTHON, arch, set_env=False):
if MSVCinfo is not None:
return MSVCinfo

from attrdict import AttrDict

# Note that it starts with a monkey-patch in setuptools.msvc to
# workaround this issue: pypa/setuptools#1902
cmd = \
@@ -1025,13 +1023,13 @@ def getMSVCInfo(PYTHON, arch, set_env=False):
"print(env)"
cmd = cmd.format(arch)
env = eval(runcmd('"%s" -c "%s"' % (PYTHON, cmd), getOutput=True, echoCmd=False))
info = AttrDict(env)
info = dict(env)

if set_env:
os.environ['PATH'] = info.path
os.environ['INCLUDE'] = info.include
os.environ['LIB'] = info.lib
os.environ['LIBPATH'] = info.libpath
os.environ['PATH'] = info["path"]
os.environ['INCLUDE'] = info["include"]
os.environ['LIB'] = info["lib"]
os.environ['LIBPATH'] = info["libpath"]

# We already have everything we need, tell distutils to not go hunting
# for it all again if it happens to be called.
1 change: 0 additions & 1 deletion requirements/devel.txt
Original file line number Diff line number Diff line change
@@ -27,5 +27,4 @@ Jinja2==2.10
markupsafe==1.1.1
doc2dash==2.3.0
beautifulsoup4
attrdict3 ; sys_platform == 'win32'
typing-extensions; python_version < '3.10'
2 changes: 1 addition & 1 deletion wscript
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ def configure(conf):
# WAF uses the VisualStudio version to select the compiler, rather than
# the compiler version like we see elsewhere. Luckily we've got that
# value in the MSVC info.
msvc_version = f"msvc {info.vs_ver}"
msvc_version = f'msvc {info["vs_ver"]}'

conf.env['MSVC_VERSIONS'] = [msvc_version]
conf.env['MSVC_TARGETS'] = [conf.options.msvc_arch]

0 comments on commit 15c6e01

Please sign in to comment.