cpython: e0c4a5b2b739 (original) (raw)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -293,6 +293,8 @@ Tests Build ----- +- Issue #19550: Implement Windows installer changes of PEP 453 (ensurepip). +
- Issue #19520: Fix compiler warning in the _sha3 module on 32bit Windows.
- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
--- a/Tools/msi/msi.py +++ b/Tools/msi/msi.py @@ -420,6 +420,8 @@ def add_ui(db): compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\tests|venv\scripts" "[TARGETDIR]Lib"' lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
- updatepipargs = r'-m ensurepip -U'
- removepipargs = r'-m ensurepip -r' # does not yet work
add_data(db, "CustomAction", [ See "CustomAction Table" # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
@@ -436,6 +438,9 @@ def add_ui(db): ("CompilePyc", 18, "python.exe", compileargs), ("CompilePyo", 18, "python.exe", "-O "+compileargs), ("CompileGrammar", 18, "python.exe", lib2to3args),
# msidbCustomActionTypeInScript (1024); run during actual installation[](#l2.16)
("UpdatePip", 18+1024, "python.exe", updatepipargs),[](#l2.17)
#("RemovePip", 18, "python.exe", removepipargs),[](#l2.18) ])[](#l2.19)
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table" @@ -462,7 +467,7 @@ def add_ui(db): # Prepend TARGETDIR to the system path, and remove it on uninstall. add_data(db, "Environment",
[("PathAddition", "=-*Path", "[TARGETDIR];[~]", "REGISTRY.path")])[](#l2.26)
[("PathAddition", "=-*Path", "[TARGETDIR];[TARGETDIR]Scripts;[~]", "REGISTRY.path")])[](#l2.27)
# Execute Sequences add_data(db, "InstallExecuteSequence", @@ -472,6 +477,12 @@ def add_ui(db): ("SetLauncherDirToWindows", 'LAUNCHERDIR="" and ' + sys32cond, 753), ("SetLauncherDirToTarget", 'LAUNCHERDIR="" and not ' + sys32cond, 754), ("UpdateEditIDLE", None, 1050),
# run command if install state of pip changes to INSTALLSTATE_LOCAL[](#l2.35)
# run after InstallFiles[](#l2.36)
("UpdatePip", "&pip=3", 4001),[](#l2.37)
# remove pip when state changes to INSTALLSTATE_ABSENT[](#l2.38)
# run before RemoveFiles[](#l2.39)
#("RemovePip", "&pip=2", 3499),[](#l2.40) ("CompilePyc", "COMPILEALL", 6800),[](#l2.41) ("CompilePyo", "COMPILEALL", 6801),[](#l2.42) ("CompileGrammar", "COMPILEALL", 6802),[](#l2.43)
@@ -751,7 +762,8 @@ def add_ui(db): advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title, "CompilePyc", "Ok", "Ok") advanced.title("Advanced Options for [ProductName]")
advanced.checkbox("CompilePyc", 135, 60, 230, 50, 3, A checkbox whether to build pyc files "COMPILEALL", "Compile .py files to byte code after installation", "Ok")
@@ -848,7 +860,8 @@ def add_features(db): # (i.e. additional Python libraries) need to follow the parent feature. # Features that have no advertisement trigger (e.g. the test suite) # must not support advertisement
- global default_feature, tcltk, htmlfiles, tools, testsuite
- global ext_feature, private_crt, prepend_path, update_pip default_feature = Feature(db, "DefaultFeature", "Python", "Python Interpreter and Libraries", 1, directory = "TARGETDIR")
@@ -870,8 +883,14 @@ def add_features(db): tools = Feature(db, "Tools", "Utility Scripts", "Python utility scripts (Tools/)", 9, parent = default_feature, attributes=2)
pip installation isn't enabled by default until a clean uninstall procedure
becomes possible
- update_pip = Feature(db, "pip", "pip",
"Install (or upgrade from an earlier version) pip, "[](#l2.71)
"a tool for installing and managing Python packages.", 11,[](#l2.72)
testsuite = Feature(db, "Testsuite", "Test suite",parent = default_feature, attributes=2|8, level=2)[](#l2.73)
"Python test suite (Lib/test/)", 11,[](#l2.75)
"Python test suite (Lib/test/)", 13,[](#l2.76) parent = default_feature, attributes=2|8)[](#l2.77)
prepend_path is an additional feature which is to be off by default.
@@ -879,7 +898,7 @@ def add_features(db): Since the default level for the above features is 1, this needs to be prepend_path = Feature(db, "PrependPath", "Add python.exe to Path", "Prepend [TARGETDIR] to the system Path variable. " "This allows you to type 'python' into a command "
"prompt without needing the full path.", 13,[](#l2.84)
"prompt without needing the full path.", 15,[](#l2.85) parent = default_feature, attributes=2|8,[](#l2.86) level=2)[](#l2.87)