From 87d25f99d5ff1d3cf8b221e3ab9de6195b1d40a2 Mon Sep 17 00:00:00 2001 From: Daggertail Date: Mon, 21 Feb 2022 04:29:11 -0600 Subject: [PATCH] Python BS + Mapmerge changes --- dependencies.sh | 2 +- tools/bootstrap/python.bat | 3 ++- tools/bootstrap/{python36._pth => python37._pth} | 2 +- tools/bootstrap/python_.ps1 | 2 +- tools/mapmerge2/convert.py | 2 +- tools/mapmerge2/dmm.py | 2 +- tools/mapmerge2/fixup.py | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) rename tools/bootstrap/{python36._pth => python37._pth} (84%) diff --git a/dependencies.sh b/dependencies.sh index 4474cc8736..0a27dd623f 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -18,7 +18,7 @@ export NODE_VERSION_PRECISE=12.22.4 export SPACEMAN_DMM_VERSION=suite-1.7 # Python version for mapmerge and other tools -export PYTHON_VERSION=3.6.8 +export PYTHON_VERSION=3.7.9 # Auxmos git tag export AUXMOS_VERSION=v0.3.0 diff --git a/tools/bootstrap/python.bat b/tools/bootstrap/python.bat index 3b20c2d436..5bec61b84c 100644 --- a/tools/bootstrap/python.bat +++ b/tools/bootstrap/python.bat @@ -1 +1,2 @@ -@call powershell.exe -NoLogo -ExecutionPolicy Bypass -File "%~dp0\python_.ps1" %* +@echo off +call powershell.exe -NoLogo -ExecutionPolicy Bypass -File "%~dp0\python_.ps1" %* diff --git a/tools/bootstrap/python36._pth b/tools/bootstrap/python37._pth similarity index 84% rename from tools/bootstrap/python36._pth rename to tools/bootstrap/python37._pth index 2bd2e8a7d6..4fe5437261 100644 --- a/tools/bootstrap/python36._pth +++ b/tools/bootstrap/python37._pth @@ -1,4 +1,4 @@ -python36.zip +python37.zip . ..\..\.. diff --git a/tools/bootstrap/python_.ps1 b/tools/bootstrap/python_.ps1 index c9e3915613..93a6f75696 100644 --- a/tools/bootstrap/python_.ps1 +++ b/tools/bootstrap/python_.ps1 @@ -50,7 +50,7 @@ if (!(Test-Path $PythonExe -PathType Leaf)) { [System.IO.Compression.ZipFile]::ExtractToDirectory($Archive, $PythonDir) # Copy a ._pth file without "import site" commented, so pip will work - Copy-Item "$Bootstrap/python36._pth" $PythonDir ` + Copy-Item "$Bootstrap/python37._pth" $PythonDir ` -ErrorAction Stop Remove-Item $Archive diff --git a/tools/mapmerge2/convert.py b/tools/mapmerge2/convert.py index 35fa606834..63fe8cbb9a 100755 --- a/tools/mapmerge2/convert.py +++ b/tools/mapmerge2/convert.py @@ -4,4 +4,4 @@ from . import frontend, dmm if __name__ == '__main__': settings = frontend.read_settings() for fname in frontend.process(settings, "convert"): - dmm.DMM.from_file(fname).to_file(fname, settings.tgm) + dmm.DMM.from_file(fname).to_file(fname, tgm = settings.tgm) diff --git a/tools/mapmerge2/dmm.py b/tools/mapmerge2/dmm.py index 2d87cfc172..453cdf5c8a 100755 --- a/tools/mapmerge2/dmm.py +++ b/tools/mapmerge2/dmm.py @@ -58,7 +58,7 @@ class DMM: self.grid[coord] = self.get_or_generate_key(tile) def generate_new_key(self): - free_keys = self._ensure_free_keys(1) + self._ensure_free_keys(1) max_key = max_key_for(self.key_length) # choose one of the free keys at random key = random.randint(0, max_key - 1) diff --git a/tools/mapmerge2/fixup.py b/tools/mapmerge2/fixup.py index f3133d1d73..6953e7ab77 100644 --- a/tools/mapmerge2/fixup.py +++ b/tools/mapmerge2/fixup.py @@ -96,7 +96,7 @@ def main(repo): converted[path] = merge_map(head_files[path], dmm.DMM.from_bytes(data)) if len(working_commit.parents) != 1: print("A merge commit was encountered before good versions of these maps were found:") - print("\n".join(f" {x}" for x in head_files.keys() - base_files.keys())) + print("\n".join(f" {x}" for x in head_files.keys() - converted.keys())) return 1 working_commit = working_commit.parents[0]