Skip to content
Snippets Groups Projects
Commit 5bb8cb0f authored by Timothee Besset's avatar Timothee Besset Committed by Timothee Besset
Browse files

update to python 3.12 on Windows, update documentation

parent 3a363850
No related branches found
No related tags found
No related merge requests found
...@@ -5,28 +5,28 @@ Please adapt these instructions to your setup. The steps outlined here were test ...@@ -5,28 +5,28 @@ Please adapt these instructions to your setup. The steps outlined here were test
Install [Chocolatey](https://chocolatey.org) Install [Chocolatey](https://chocolatey.org)
In an Adminstrator powershell: In an Administrator command prompt:
Install misc utilities: Install misc utilities:
- `choco install 7zip` - `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 pip`
- `python -m pip install --upgrade setuptools` - `python -m pip install --upgrade setuptools`
Install the Microsoft Visual C++ compiler, per https://wiki.python.org/moin/WindowsCompilers: 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: Install cygwin with needed packages:
...@@ -35,12 +35,12 @@ Install cygwin with needed packages: ...@@ -35,12 +35,12 @@ Install cygwin with needed packages:
# Windows development: python virtualenv setup # 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 .` - 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` 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`
......
...@@ -7,7 +7,8 @@ appdirs ...@@ -7,7 +7,8 @@ appdirs
bcrypt bcrypt
cffi cffi
cryptography 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' pywin32; sys_platform == 'win32'
shiv; sys_platform == 'linux' shiv; sys_platform == 'linux'
# packaging script on linux expects pipenv # packaging script on linux expects pipenv
......
...@@ -38,7 +38,7 @@ if __name__ == '__main__': ...@@ -38,7 +38,7 @@ if __name__ == '__main__':
sys.stdout = Unbuffered(sys.stdout) sys.stdout = Unbuffered(sys.stdout)
sys.stderr = Unbuffered(sys.stderr) 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') interpreter = os.path.join(ROOT_DIR, r'Scripts\python.exe')
call(f'{interpreter} -m pip install --upgrade pip') call(f'{interpreter} -m pip install --upgrade pip')
pip = os.path.join(ROOT_DIR, r'Scripts\pip.exe') pip = os.path.join(ROOT_DIR, r'Scripts\pip.exe')
......
...@@ -59,7 +59,7 @@ if __name__ == '__main__': ...@@ -59,7 +59,7 @@ if __name__ == '__main__':
print(f'Build the package') print(f'Build the package')
subprocess.check_call([r'.\Scripts\python.exe', r'.\setup\cxfreeze-windows.py', 'build'], cwd=ROOT_DIR) 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'): for name in ('devkit-msvsmon', 'devkit-utils', 'gpuvis'):
dir_path = os.path.join(CLIENT_DIR, name) dir_path = os.path.join(CLIENT_DIR, name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment