diff --git a/.efrocachemap b/.efrocachemap index ad178d76..35867d71 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4056,26 +4056,26 @@ "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "279d063ae54801d02d5f9739a8cf2fcb", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "21fb39e8d8aba6d6027f3465ab5fbc6b", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "c1dc7f237469dd36deffe5414a81a5c2", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "13436c4ecb012fa616ab3b52d765a4a8", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "481e76f0d618ea949640779db8089e46", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "6452a4a354d36a5618275719046c45c0", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "99ea8e8d810194730a58c1f61baf6bd4", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "9206a652925c58d5f54ac3b19202568b", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "de160cabd194d8e1a08945e2a990c6e7", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "45f1d057b67eea2b8937c0987f4600df", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "05fd1a0c61f766d01fdb4d8a6f21884a", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "652bb06c069ea03d82b20d94a1c0d8b0", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "90e139a76507c00deff3ea1dcf569935", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "7314fa7928a4714dfb2c44bd0e976878", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "eb68e8ab4ee7c9bb9748ba72d92424ce", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "69c56cc9b9a373953008c5a3742c514a", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "ff043c91883c2c3fb71f64b744774232", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "014cb8642e6fae3bf542117433bea233", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "f640bd3d830548bf42960643f89a7564", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "1a340e7924157c2e84b0cd3c3ac84a6b", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "9d6c7dcd7bf389dcbe29cfc7937d9a56", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "4f40db9f40f1c16799254b2c94696942", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "2d224e9438975458e1952af0c2b0d533", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "ad311de40204ae2c96af8b7159fc4b28", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "403fe6bd30d80cf4ecefd47dba093f09", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "d9b98710fe088d506543a50294c5a3a4", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "29c87115ee8771a4a0bc17317a4a127a", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "27a27244b971b48dc545b40a3011ef1a", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "5c7540dc387ae395dd73eeb0eaea28ba", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "81bd15d634824d149e50774b3233a31e", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "37b5d59fb91dca52f1adec53e31b084f", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "af1a00445c5801b194f02ccd9398004d", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "75f400ca9e44557aa1c68aeb87b411f7", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "aa7f3acd8b8a5161fc74897b6f24d307", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "40c465bbefbb7a76abe944a237606965", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "a4ab928602e225bf6cab87fe66418420", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "386448718b4cc1df3b4ddb4792a3a38c", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "59eec91d53ef39b46c69d6955f7920c8", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "57e8c777723b873c7e90ad5d7655de15", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "67899fad5203c451e5e3411bd887100b", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "11668f7191dc8d4e2b03db15ff2a4241", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "b190199ce8b8fe122993d14fb7e8e813", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "11668f7191dc8d4e2b03db15ff2a4241", @@ -4092,14 +4092,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "4fab22abc481a97e884cce9d67b35c6b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "7c536b056d78148a302c975bf9238118", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "4fab22abc481a97e884cce9d67b35c6b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "cf2978894cde54eed829e1c5b641c656", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "a9a883ae6660b516ab3da8202ecf8afd", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "dc18e0fbb1c7c42a1d2ae7dbe8104fc9", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "2b20efd81ca876dee30ec64917ae53fb", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "093edb4112d70c03032d938d345ff0be", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "286e901c3f7395b790213295586ba619", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "2aae411134c4eb841f28dc932baba0d3", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "e9989960860d3371f4b17eec3d6c098a", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "8072b0140655621c07fd97cab9e9ca2d", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "758e51a2b6f52436796c607371221bbc", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "240aea32d29d4cc6260c5be61faad5c7", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "30ea6e77aa5e33949bba018acbbe0b93", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "8dfb5b9a723189015c9b3eaf73816f90", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "2b82beecc22a653fc8881e76b1c9adcb", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "29893062fd160d20b621ead316232961", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "ed2ce864584e0ed9d6427bf4b1c5743c", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "b611c090513a21e2fe90e56582724e9d", "src/ballistica/base/mgen/pyembed/binding_base.inc": "72bfed2cce8ff19741989dec28302f3f", diff --git a/CHANGELOG.md b/CHANGELOG.md index fa2671b1..9b766165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.34 (build 21802, api 8, 2024-04-23) +### 1.7.34 (build 21804, api 8, 2024-04-23) - Bumped Python version from 3.11 to 3.12 for all builds and project tools. One of the things this means is that we can use `typing.override` instead of the `typing_extensions` version so the annoying requirement of installing diff --git a/Makefile b/Makefile index 391f058e..b303f93d 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ venv: .venv/efro_venv_complete # Update pip requirements to latest versions. venv-upgrade: prereqs - $(PCOMMAND) pur -r config/requirements.txt + $(PCOMMAND) requirements_upgrade config/requirements.txt venv-clean: rm -rf .venv @@ -1225,14 +1225,15 @@ ENV_SRC = tools/batools/build.py .venv/efro_venv_complete tools/pcommand # This is a prereq dependency so should not itself depend on prereqs. tools/pcommand: tools/efrotools/genwrapper.py tools/efrotools/pyver.py @echo Generating tools/pcommand... - @PYTHONPATH=tools python3 -m efrotools.genwrapper pcommand tools/pcommand \ - batools.pcommandmain + @PYTHONPATH=tools python3 -m \ + efrotools.genwrapper pcommand batools.pcommandmain tools/pcommand # Generate a cloudshell script hard-coded to use our virtual environment. # This is a prereq dependency so should not itself depend on prereqs. tools/cloudshell: tools/efrotools/genwrapper.py tools/efrotools/pyver.py @echo Generating tools/cloudshell... - @PYTHONPATH=tools python3 -m efrotools.genwrapper cloudshell tools/cloudshell + @PYTHONPATH=tools python3 -m \ + efrotools.genwrapper cloudshell efrotoolsinternal.cloudshell tools/cloudshell .clang-format: config/toolconfigsrc/clang-format $(TOOL_CFG_SRC) @$(TOOL_CFG_INST) $< $@ diff --git a/config/requirements.txt b/config/requirements.txt index 7edcaf0d..401505ce 100644 --- a/config/requirements.txt +++ b/config/requirements.txt @@ -1,25 +1,24 @@ -typing_extensions==4.11.0 -filelock==3.13.4 -python-daemon==3.0.1 -python-lsp-server==1.11.0 -python-lsp-black==2.0.0 -mypy==1.9.0 -pylint==3.1.0 -cpplint==1.6.1 -pytest==8.1.1 -pytz==2024.1 ansiwrap==0.8.4 -requests==2.31.0 +cpplint==1.6.1 +filelock==3.13.4 +furo==2024.1.29 +mypy==1.9.0 +pbxproj==4.1.0 pdoc==14.4.0 +pur==7.3.1 +pylint==3.1.0 +pylsp-mypy==0.6.8 +pytest==8.1.1 +python-daemon==3.0.1 +python-lsp-black==2.0.0 +python-lsp-server==1.11.0 +pytz==2024.1 PyYAML==6.0.1 +requests==2.31.0 +Sphinx==7.3.7 +types-certifi==2021.10.8.3 types-filelock==3.2.7 -types-requests==2.31.0.20240406 types-pytz==2024.1.0.20240417 types-PyYAML==6.0.12.20240311 -types-certifi==2021.10.8.3 -pbxproj==4.1.0 -Sphinx==7.3.7 -furo==2024.1.29 -pylsp-mypy==0.6.8 -pur==7.3.1 - +types-requests==2.31.0.20240406 +typing_extensions==4.11.0 diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 886e0cff..ee7482ae 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -52,7 +52,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21802 +TARGET_BALLISTICA_BUILD = 21804 TARGET_BALLISTICA_VERSION = '1.7.34' diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 770845b4..cbbcdb0e 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21802; +const int kEngineBuildNumber = 21804; const char* kEngineVersion = "1.7.34"; const int kEngineApiVersion = 8; diff --git a/tools/batools/pcommandmain.py b/tools/batools/pcommandmain.py index 278bbd6a..b0790e27 100644 --- a/tools/batools/pcommandmain.py +++ b/tools/batools/pcommandmain.py @@ -55,7 +55,7 @@ from efrotools.pcommands import ( tweak_empty_py_files, make_ensure, make_target_debug, - pur, + requirements_upgrade, ) from efrotools.pcommands2 import ( with_build_lock, diff --git a/tools/efrotools/genwrapper.py b/tools/efrotools/genwrapper.py index 92dddb16..52f4ed97 100644 --- a/tools/efrotools/genwrapper.py +++ b/tools/efrotools/genwrapper.py @@ -12,8 +12,6 @@ if TYPE_CHECKING: pass if __name__ == '__main__': - if len(sys.argv) not in (3, 4): - raise RuntimeError('Expected 2 args') from efrotools.project import ( getprojectconfig, @@ -21,9 +19,12 @@ if __name__ == '__main__': get_non_public_legal_notice, ) - gentype = sys.argv[1] - path = sys.argv[2] - module = sys.argv[3] if len(sys.argv) > 3 else None + # We expect 3 args: tool-name, tool-module, output-path + if len(sys.argv) != 4: + raise RuntimeError('Expected 3 args') + toolname = sys.argv[1] + toolmodule = sys.argv[2] + outpath = sys.argv[3] # We technically could stick the 'python' or 'python3' path in, but # let's go with the full versioned one just to keep it clear what @@ -41,39 +42,22 @@ if __name__ == '__main__': if public else get_non_public_legal_notice() ) - if gentype == 'pcommand': - assert module is not None - contents = ( - f'#!{pybinpath}\n' - f'# {legalnotice}\n' - '# This file is autogenerated; do not hand edit.\n' - '#\n' - '"""Simple wrapper so pcommand uses our internal virtual' - ' environment."""\n' - f'from {module} import run_pcommand_main\n' - '\n' - 'if __name__ == "__main__":\n' - ' run_pcommand_main()\n' - ) + contents = ( + f'#!{pybinpath}\n' + f'# {legalnotice}\n' + f'# This file is autogenerated; do not edit.\n' + f'#\n' + f'"""Simple wrapper so {toolname} uses our internal virtual' + f' environment."""\n' + f'from {toolmodule} import run_{toolname}_main\n' + f'\n' + f'if __name__ == "__main__":\n' + f' run_{toolname}_main()\n' + ) - elif gentype == 'cloudshell': - contents = ( - f'#!{pybinpath}\n' - f'# {legalnotice}\n' - '# This file is autogenerated; do not hand edit.\n' - '#\n' - '"""Simple wrapper so cloudshell uses our' - ' internal virtual environment."""\n' - 'from efrotoolsinternal.cloudshell import run_cloudshell_main\n' - '\n' - 'if __name__ == "__main__":\n' - ' run_cloudshell_main()\n' - ) - else: - raise RuntimeError(f'Unsupported gentype: {gentype}') - - with open(path, 'w', encoding='utf-8') as outfile: + with open(outpath, 'w', encoding='utf-8') as outfile: outfile.write(contents) os.chmod( - path, os.stat(path).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH + outpath, + os.stat(outpath).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH, ) diff --git a/tools/efrotools/pcommands.py b/tools/efrotools/pcommands.py index 47fe9b8c..f4c18dc9 100644 --- a/tools/efrotools/pcommands.py +++ b/tools/efrotools/pcommands.py @@ -45,13 +45,45 @@ def _spelling(words: list[str]) -> None: print(f'Modified {num_modded_dictionaries} dictionaries.') -def pur() -> None: - """Run pur using project's Python version.""" +def requirements_upgrade() -> None: + """Upgrade project requirements.""" + import os + import tempfile import subprocess + from efro.error import CleanError + pcommand.disallow_in_batch() - subprocess.run([sys.executable, '-m', 'pur'] + sys.argv[2:], check=True) + args = pcommand.get_args() + + if len(args) != 1: + raise CleanError('Expected a single arg.') + reqpath = args[0] + + with open(reqpath, encoding='utf-8') as infile: + reqs = infile.read() + + # Operate on a temp file and compare against our existing so we don't + # write unless it has changed. + with tempfile.TemporaryDirectory() as tempdir: + fname = os.path.join(tempdir, 'reqs') + with open(fname, 'w', encoding='utf-8') as outfile: + outfile.write(reqs) + + subprocess.run([sys.executable, '-m', 'pur', '-r', fname], check=True) + + # Sort lines. + with open(reqpath, encoding='utf-8') as infile: + reqs2 = infile.read().strip() + reqs_new = ( + '\n'.join(sorted(reqs2.splitlines(), key=lambda l: l.lower())) + + '\n' + ) + + if reqs_new != reqs: + with open(reqpath, 'w', encoding='utf-8') as outfile: + outfile.write(reqs_new) def spelling_all() -> None: diff --git a/tools/efrotools/pyver.py b/tools/efrotools/pyver.py index 5722dd49..81122da4 100644 --- a/tools/efrotools/pyver.py +++ b/tools/efrotools/pyver.py @@ -16,53 +16,6 @@ _checked_valid_sys_executable = False # pylint: disable=invalid-name _valid_sys_executable: str | None = None -# def get_valid_sys_executable() -> str: -# """Attempt to get a valid Python interpreter path. - -# Using sys.executable for this purpose may return the path to the -# executable containing the embedded Python, which may not be a standard -# iterpreter. -# """ - -# pyverstr = f'{sys.version_info.major}.{sys.version_info.minor}' - -# global _checked_valid_sys_executable -# global _valid_sys_executable -# if not _checked_valid_sys_executable: - -# # First look at sys.executable to see if it seems like a standard -# # python interpreter. -# try: -# output = subprocess.run( -# [sys.executable, '--version'], check=True, capture_output=True -# ).stdout.decode() -# if output.startswith(f'Python {pyverstr}'): -# _valid_sys_executable = sys.executable -# except Exception: -# import logging - -# logging.exception( -# 'Error checking sys.executable in get_valid_sys_executable' -# ) - -# if _valid_sys_executable is None: -# # For now, as a fallback, just go with 'pythonX.Y'. -# _valid_sys_executable = f'python{pyverstr}' - -# # As a fallback, look for bin/pythonX.Y under our sys.prefix. -# # prefixpath = os.path.join( -# sys.prefix, 'bin', f'python{pyverstr}') -# # if os.path.exists(prefixpath): -# # _valid_sys_executable = prefixpath - -# _checked_valid_sys_executable = True - -# if _valid_sys_executable is None: -# raise RuntimeError('Have no valid sys executable.') - -# return _valid_sys_executable - - def get_project_python_executable(projroot: Path | str) -> str: """Return the path to a standalone Python interpreter for this project.