From 702588e60a5324599e1e5b2e0d180ec89ad4e81c Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 4 Nov 2024 21:33:20 +0800 Subject: [PATCH 1/4] add --- bucket/python313.json | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 bucket/python313.json diff --git a/bucket/python313.json b/bucket/python313.json new file mode 100644 index 00000000000..f4278964841 --- /dev/null +++ b/bucket/python313.json @@ -0,0 +1,115 @@ +{ + "version": "3.13.0", + "description": "A programming language that lets you work quickly and integrate systems more effectively.", + "homepage": "https://www.python.org/", + "license": "Python-2.0", + "notes": "Allow applications and third-party installers to find python by running: \"$dir\\install-pep-514.reg\"", + "architecture": { + "64bit": { + "url": "https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe#/setup.exe", + "hash": "md5:f5e5d48ba86586d4bef67bcb3790d339" + }, + "32bit": { + "url": "https://www.python.org/ftp/python/3.13.0/python-3.13.0.exe#/setup.exe", + "hash": "md5:8e96d6243623ff7acc61c9dc7cd3638f" + }, + "arm64": { + "url": "https://www.python.org/ftp/python/3.13.0/python-3.13.0-arm64.exe#/setup.exe", + "hash": "md5:291f811b17b4943de92cffdce6f2014f" + } + }, + "pre_install": [ + "$py_root = \"$dir\".Replace('\\', '\\\\')", + "$py_archLabel = '64-bit'", + "$bit = '64'", + "if ($architecture -eq '32bit') {", + " $py_archLabel = '32-bit'", + " $bit = '32'", + "}", + "if ($architecture -eq 'arm64') { $py_archLabel = 'ARM64' }", + "'install-pep-514.reg', 'uninstall-pep-514.reg' | ForEach-Object {", + " $py_version = ($version -split '\\.')[0..1] -join '.'", + " $content = Get-Content \"$bucketsdir\\main\\scripts\\python\\$_\"", + " $content = $content.Replace('$py_root', $py_root)", + " $content = $content.Replace('$py_version', $py_version)", + " $content = $content.Replace('$py_fullversion', $version)", + " $content = $content.Replace('$py_cleanVersion', $version -replace '\\.')", + " $content = $content.Replace('$py_archLabel', $py_archLabel)", + " $content = $content.Replace('$py_arch', \"$bit\")", + " if ($global) {", + " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", + " }", + " Set-Content \"$dir\\$_\" $content -Encoding Ascii", + "}" + ], + "installer": { + "script": [ + "Expand-DarkArchive \"$dir\\setup.exe\" \"$dir\\_tmp\"", + "@('path.msi', 'pip.msi') | ForEach-Object {", + " Remove-Item \"$dir\\_tmp\\AttachedContainer\\$_\"", + "}", + "(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object {", + " # appendpath.msi does not contain any file, which causes 'msiexec /a' to fail", + " if($((Get-Item $_).Basename) -eq 'appendpath') { return }", + " Expand-MsiArchive $_ \"$dir\" ", + "}", + "Remove-Item \"$dir\\_tmp\", \"$dir\\setup.exe\" -Force -Recurse", + "if ($global) {", + " $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''", + " Set-EnvVar -Name PATHEXT -Value \"$pathext;.PY;.PYW\" -Global", + "}" + ] + }, + "post_install": [ + "python -E -s -m ensurepip -U --default-pip | Out-Null", + "Write-Output \"$([char]0x1b)[0m\" # Reset ansi to prevent color leak from installer" + ], + "uninstaller": { + "script": [ + "if ($global) {", + " $pathext = (Get-EnvVar -Name PATHEXT -Global) -replace ';.PYW?', ''", + " Set-EnvVar -Name PATHEXT -Value \"$pathext\" -Global", + "}" + ] + }, + "bin": [ + [ + "python.exe", + "python3" + ], + "Lib\\idlelib\\idle.bat", + [ + "Lib\\idlelib\\idle.bat", + "idle3" + ] + ], + "env_add_path": [ + "Scripts", + "." + ], + "persist": [ + "Scripts", + "Lib\\site-packages" + ], + "checkver": { + "url": "https://www.python.org/downloads/windows/", + "regex": "Latest Python 3 Release - Python ([\\d.]+)" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://www.python.org/ftp/python/$version/python-$version-amd64.exe#/setup.exe" + }, + "32bit": { + "url": "https://www.python.org/ftp/python/$version/python-$version.exe#/setup.exe" + }, + "arm64": { + "url": "https://www.python.org/ftp/python/$version/python-$version-arm64.exe#/setup.exe" + } + }, + "hash": { + "url": "https://www.python.org/downloads/release/python-$cleanVersion/", + "regex": "(?sm)$basename.*?$md5" + } + } +} From 917b23f1439b8b4b1d0032a8e8c2a5fc7e34350b Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 4 Nov 2024 21:35:40 +0800 Subject: [PATCH 2/4] fix --- bucket/python313.json | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bucket/python313.json b/bucket/python313.json index f4278964841..3f714ff5ff8 100644 --- a/bucket/python313.json +++ b/bucket/python313.json @@ -72,28 +72,36 @@ "}" ] }, + "env_add_path": [ + "Scripts", + "." + ], "bin": [ [ "python.exe", "python3" ], + [ + "python.exe", + "python313" + ], "Lib\\idlelib\\idle.bat", [ "Lib\\idlelib\\idle.bat", "idle3" + ], + [ + "Lib\\idlelib\\idle.bat", + "idle313" ] ], - "env_add_path": [ - "Scripts", - "." - ], "persist": [ "Scripts", "Lib\\site-packages" ], "checkver": { "url": "https://www.python.org/downloads/windows/", - "regex": "Latest Python 3 Release - Python ([\\d.]+)" + "regex": "python-(3\\.13\\.[\\d.]+)-" }, "autoupdate": { "architecture": { From f26e49a859d27af988dac637424154f3e208988b Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 4 Nov 2024 21:39:11 +0800 Subject: [PATCH 3/4] fix --- bucket/python313.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/bucket/python313.json b/bucket/python313.json index 3f714ff5ff8..2b5bc8281ab 100644 --- a/bucket/python313.json +++ b/bucket/python313.json @@ -77,19 +77,10 @@ "." ], "bin": [ - [ - "python.exe", - "python3" - ], [ "python.exe", "python313" ], - "Lib\\idlelib\\idle.bat", - [ - "Lib\\idlelib\\idle.bat", - "idle3" - ], [ "Lib\\idlelib\\idle.bat", "idle313" From 5da6926f74561f8bbe2598129febbb9df4a6ec97 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 4 Nov 2024 21:40:32 +0800 Subject: [PATCH 4/4] fix --- bucket/python313.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bucket/python313.json b/bucket/python313.json index 2b5bc8281ab..3f714ff5ff8 100644 --- a/bucket/python313.json +++ b/bucket/python313.json @@ -77,10 +77,19 @@ "." ], "bin": [ + [ + "python.exe", + "python3" + ], [ "python.exe", "python313" ], + "Lib\\idlelib\\idle.bat", + [ + "Lib\\idlelib\\idle.bat", + "idle3" + ], [ "Lib\\idlelib\\idle.bat", "idle313"