From 5bb8cb0f66593dbfd73b69fa9dd9d986fc248836 Mon Sep 17 00:00:00 2001 From: Timothee 'TTimo' Besset <ttimo@ttimo.net> Date: Thu, 2 Nov 2023 16:32:01 -0500 Subject: [PATCH] update to python 3.12 on Windows, update documentation --- README.md | 20 ++++++++++---------- requirements.txt | 3 ++- setup/gitlab-windows.py | 2 +- setup/package-windows.py | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 213ad02..2b4656d 100644 --- a/README.md +++ b/README.md @@ -5,28 +5,28 @@ Please adapt these instructions to your setup. The steps outlined here were test Install [Chocolatey](https://chocolatey.org) -In an Adminstrator powershell: +In an Administrator command prompt: Install misc utilities: - `choco install 7zip` -Install Python 3.11: +Install Python 3.12: -- `choco install python --version 3.11.3 --params "'/qn /norestart ALLUSERS=1 TARGETDIR=c:\Python311'"` +- `choco install python --version 3.12.0 --params "'/qn /norestart ALLUSERS=1 TARGETDIR=c:\Python312'"` -Python will install to C:\Python31 for all users. Restart the shell to pickup it up. +Python will install to C:\Python312 for all users. -Run the following: +Restart the Administrator command prompt to pick up the new python and run the following: - `python -m pip install --upgrade pip` - `python -m pip install --upgrade setuptools` Install the Microsoft Visual C++ compiler, per https://wiki.python.org/moin/WindowsCompilers: -- `choco install visualstudio2019community` +- `choco install visualstudio2022community` -Then run 'Visual Studio Installer' from the Start menu, and enable the 'Python development' workload, plus the 'Python native development tools' option. +Then run 'Visual Studio Installer' from the Start menu, and enable the 'Python development' workload, plus the 'Python native development tools' option. See [the pyhon wiki](https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.x_with_Visual_Studio_2022_.28x86.2C_x64.2C_ARM.2C_ARM64.29) for more details. Install cygwin with needed packages: @@ -35,12 +35,12 @@ Install cygwin with needed packages: # Windows development: python virtualenv setup -Next, prepare a python virtualenv with all the necessary dependencies. This step can be repeated in fresh clones of the repositories. +Next, prepare a python virtualenv with all the necessary dependencies. This step needs to be repeated in every fresh clone of the repository. -From your checkout of steamos-devkit: +Open a Visual Studio Developer command prompt in the steamos-devkit folder and run the following: - setup: `python -m venv .` -- activate: `.\Scripts\Activate.ps1` +- activate: `.\Scripts\activate.bat` If you get an `UnauthorizedAccess` error due to [execution policies](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies), run the following command first: `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process` diff --git a/requirements.txt b/requirements.txt index f28dd46..d6cb6f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,8 @@ appdirs bcrypt cffi cryptography -cx-Freeze; sys_platform == 'win32' +# Python 3.12 support started with 6.16.0 +cx-Freeze >= 6.16.0; sys_platform == 'win32' pywin32; sys_platform == 'win32' shiv; sys_platform == 'linux' # packaging script on linux expects pipenv diff --git a/setup/gitlab-windows.py b/setup/gitlab-windows.py index 64d2057..2a4b1c0 100644 --- a/setup/gitlab-windows.py +++ b/setup/gitlab-windows.py @@ -38,7 +38,7 @@ if __name__ == '__main__': sys.stdout = Unbuffered(sys.stdout) sys.stderr = Unbuffered(sys.stderr) - call(f'python3.11 -m venv .') + call(f'python3.12 -m venv .') interpreter = os.path.join(ROOT_DIR, r'Scripts\python.exe') call(f'{interpreter} -m pip install --upgrade pip') pip = os.path.join(ROOT_DIR, r'Scripts\pip.exe') diff --git a/setup/package-windows.py b/setup/package-windows.py index a2d4763..17f3f9e 100644 --- a/setup/package-windows.py +++ b/setup/package-windows.py @@ -59,7 +59,7 @@ if __name__ == '__main__': print(f'Build the package') subprocess.check_call([r'.\Scripts\python.exe', r'.\setup\cxfreeze-windows.py', 'build'], cwd=ROOT_DIR) - shutil.copytree(os.path.join(BUILD_DIR, 'exe.win-amd64-3.11'), DIST_DIR, dirs_exist_ok=True) + shutil.copytree(os.path.join(BUILD_DIR, 'exe.win-amd64-3.12'), DIST_DIR, dirs_exist_ok=True) for name in ('devkit-msvsmon', 'devkit-utils', 'gpuvis'): dir_path = os.path.join(CLIENT_DIR, name) -- GitLab