Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +108 -54
- nuitka/Options.py +69 -13
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +4 -0
- nuitka/build/SconsCompilerSettings.py +14 -3
- nuitka/build/SconsInterface.py +3 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +8 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helper/tuples.h +12 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +36 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
- nuitka/build/static_src/CompiledCoroutineType.c +41 -31
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
- nuitka/build/static_src/CompiledMethodType.c +6 -12
- nuitka/build/static_src/HelpersAllocator.c +266 -28
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +23 -14
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
- nuitka/build/static_src/HelpersDeepcopy.c +1 -0
- nuitka/build/static_src/HelpersDictionaries.c +195 -36
- nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +2 -2
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +132 -28
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +5 -2
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +6 -0
- nuitka/freezer/IncludedDataFiles.py +37 -6
- nuitka/freezer/Onefile.py +1 -0
- nuitka/freezer/Standalone.py +72 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +5 -2
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +2 -2
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/VariableAssignNodes.py +2 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +18 -0
- nuitka/nodes/shapes/StandardShapes.py +47 -44
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +16 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/DllFilesPlugin.py +78 -2
- nuitka/plugins/standard/ImplicitImports.py +5 -15
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +23 -3
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/environments/Virtualenv.py +13 -5
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +69 -62
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +18 -39
- nuitka/utils/Hashing.py +5 -1
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/SharedLibraries.py +24 -0
- nuitka/utils/Signing.py +9 -1
- nuitka/utils/Utils.py +1 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
nuitka/tools/testing/Common.py
CHANGED
|
@@ -7,7 +7,6 @@ import ast
|
|
|
7
7
|
import atexit
|
|
8
8
|
import gc
|
|
9
9
|
import os
|
|
10
|
-
import re
|
|
11
10
|
import shutil
|
|
12
11
|
import signal
|
|
13
12
|
import sys
|
|
@@ -18,6 +17,7 @@ from contextlib import contextmanager
|
|
|
18
17
|
from optparse import OptionParser
|
|
19
18
|
|
|
20
19
|
from nuitka.__past__ import md5, subprocess
|
|
20
|
+
from nuitka.Options import getCommercialVersion
|
|
21
21
|
from nuitka.PythonVersions import getTestExecutionPythonVersions, isDebugPython
|
|
22
22
|
from nuitka.Tracing import OurLogger, my_print
|
|
23
23
|
from nuitka.tree.SourceHandling import readSourceCodeFromFilename
|
|
@@ -228,8 +228,9 @@ def convertUsing2to3(path, force=False):
|
|
|
228
228
|
|
|
229
229
|
if not force:
|
|
230
230
|
if "xrange" not in getFileContents(path):
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
with getNullOutput() as null_output:
|
|
232
|
+
if check_result(command, stderr=null_output):
|
|
233
|
+
return path, False
|
|
233
234
|
|
|
234
235
|
filename = os.path.basename(path)
|
|
235
236
|
|
|
@@ -258,16 +259,17 @@ def convertUsing2to3(path, force=False):
|
|
|
258
259
|
|
|
259
260
|
command += ("-w", "-n", "--no-diffs", new_path)
|
|
260
261
|
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
with getNullOutput() as null_output:
|
|
263
|
+
try:
|
|
264
|
+
check_output(command, stderr=null_output)
|
|
263
265
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
except subprocess.CalledProcessError:
|
|
267
|
+
if isWin32Windows():
|
|
268
|
+
raise
|
|
267
269
|
|
|
268
|
-
|
|
270
|
+
command[0:3] = ["2to3"]
|
|
269
271
|
|
|
270
|
-
|
|
272
|
+
check_output(command, stderr=null_output)
|
|
271
273
|
|
|
272
274
|
data = getFileContents(new_path)
|
|
273
275
|
|
|
@@ -297,6 +299,10 @@ def decideFilenameVersionSkip(filename):
|
|
|
297
299
|
|
|
298
300
|
assert type(filename) is str, repr(filename)
|
|
299
301
|
|
|
302
|
+
# There are commercial only test cases
|
|
303
|
+
if "commercial" in filename.lower() and getCommercialVersion() is None:
|
|
304
|
+
return False
|
|
305
|
+
|
|
300
306
|
# Skip runner scripts by default.
|
|
301
307
|
if filename.startswith("run_"):
|
|
302
308
|
return False
|
|
@@ -364,11 +370,11 @@ def decideFilenameVersionSkip(filename):
|
|
|
364
370
|
if filename.endswith("312.py") and _python_version < (3, 12):
|
|
365
371
|
return False
|
|
366
372
|
|
|
367
|
-
|
|
368
|
-
|
|
373
|
+
# Skip tests that require Python 3.13 at least.
|
|
374
|
+
if filename.endswith("313.py") and _python_version < (3, 13):
|
|
375
|
+
return False
|
|
369
376
|
|
|
370
|
-
|
|
371
|
-
return _python_version >= (3,) and not re.match(r".*3\d+\.py", filename)
|
|
377
|
+
return True
|
|
372
378
|
|
|
373
379
|
|
|
374
380
|
def _removeCPythonTestSuiteDir():
|
|
@@ -395,9 +401,7 @@ def _removeCPythonTestSuiteDir():
|
|
|
395
401
|
raise
|
|
396
402
|
|
|
397
403
|
|
|
398
|
-
def compareWithCPython(
|
|
399
|
-
dirname, filename, extra_flags, search_mode, needs_2to3, on_error=None
|
|
400
|
-
):
|
|
404
|
+
def compareWithCPython(dirname, filename, extra_flags, search_mode, on_error=None):
|
|
401
405
|
"""Call the comparison tool. For a given directory filename.
|
|
402
406
|
|
|
403
407
|
The search mode decides if the test case aborts on error or gets extra
|
|
@@ -405,19 +409,11 @@ def compareWithCPython(
|
|
|
405
409
|
|
|
406
410
|
"""
|
|
407
411
|
|
|
408
|
-
# Many cases to consider here, pylint: disable=too-many-branches
|
|
409
|
-
|
|
410
412
|
if dirname is None:
|
|
411
413
|
path = filename
|
|
412
414
|
else:
|
|
413
415
|
path = os.path.join(dirname, filename)
|
|
414
416
|
|
|
415
|
-
# Apply 2to3 conversion if necessary.
|
|
416
|
-
if needs_2to3:
|
|
417
|
-
path, converted = convertUsing2to3(path)
|
|
418
|
-
else:
|
|
419
|
-
converted = False
|
|
420
|
-
|
|
421
417
|
if os.getenv("NUITKA_TEST_INSTALLED", "") == "1":
|
|
422
418
|
command = [
|
|
423
419
|
sys.executable,
|
|
@@ -455,9 +451,6 @@ def compareWithCPython(
|
|
|
455
451
|
|
|
456
452
|
search_mode.onErrorDetected("Error exit! %s" % result)
|
|
457
453
|
|
|
458
|
-
if converted:
|
|
459
|
-
os.unlink(path)
|
|
460
|
-
|
|
461
454
|
if result == 2:
|
|
462
455
|
test_logger.sysexit("Interrupted, with CTRL-C\n", exit_code=2)
|
|
463
456
|
|
|
@@ -545,11 +538,12 @@ def displayRuntimeTraces(logger, path):
|
|
|
545
538
|
|
|
546
539
|
|
|
547
540
|
def hasModule(module_name):
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
541
|
+
with getNullOutput() as null_output:
|
|
542
|
+
result = subprocess.call(
|
|
543
|
+
(os.environ["PYTHON"], "-c", "import %s" % module_name),
|
|
544
|
+
stdout=null_output,
|
|
545
|
+
stderr=subprocess.STDOUT,
|
|
546
|
+
)
|
|
553
547
|
|
|
554
548
|
return result == 0
|
|
555
549
|
|
|
@@ -769,6 +763,14 @@ Execute only tests matching the pattern. Defaults to all tests.""",
|
|
|
769
763
|
help="""\
|
|
770
764
|
Execute all tests, continue execution even after failure of one.""",
|
|
771
765
|
)
|
|
766
|
+
select_group.add_option(
|
|
767
|
+
"--jobs",
|
|
768
|
+
action="store",
|
|
769
|
+
dest="jobs",
|
|
770
|
+
default=None,
|
|
771
|
+
help="""\
|
|
772
|
+
Pass this as the --jobs value to Nuitka.""",
|
|
773
|
+
)
|
|
772
774
|
|
|
773
775
|
del select_group
|
|
774
776
|
|
|
@@ -800,6 +802,9 @@ Defaults to off.""",
|
|
|
800
802
|
if options.debug:
|
|
801
803
|
addExtendedExtraOptions("--debug")
|
|
802
804
|
|
|
805
|
+
if options.jobs is not None:
|
|
806
|
+
addExtendedExtraOptions("--jobs=%s" % options.jobs)
|
|
807
|
+
|
|
803
808
|
if options.show_commands:
|
|
804
809
|
os.environ["NUITKA_TRACE_COMMANDS"] = "1"
|
|
805
810
|
|
|
@@ -873,20 +878,19 @@ def executeReferenceChecked(
|
|
|
873
878
|
continue
|
|
874
879
|
|
|
875
880
|
# Avoid non-raisable output.
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
new_stderr.close()
|
|
881
|
+
with getNullOutput() as null_output:
|
|
882
|
+
try:
|
|
883
|
+
if number in tests_stderr:
|
|
884
|
+
sys.stderr = null_output
|
|
885
|
+
except OSError: # Windows
|
|
886
|
+
if not checkReferenceCount(names[name], explain=explain):
|
|
887
|
+
result = False
|
|
888
|
+
else:
|
|
889
|
+
if not checkReferenceCount(names[name], explain=explain):
|
|
890
|
+
result = False
|
|
891
|
+
finally:
|
|
892
|
+
if number in tests_stderr:
|
|
893
|
+
sys.stderr = old_stderr
|
|
890
894
|
|
|
891
895
|
gc.enable()
|
|
892
896
|
return result
|
|
@@ -1272,12 +1276,13 @@ def setupCacheHashSalt(test_code_path):
|
|
|
1272
1276
|
if os.path.exists(os.path.join(test_code_path, ".git")):
|
|
1273
1277
|
git_cmd = ["git", "ls-tree", "-r", "HEAD", test_code_path]
|
|
1274
1278
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1279
|
+
with getNullInput() as null_input:
|
|
1280
|
+
process = subprocess.Popen(
|
|
1281
|
+
args=git_cmd,
|
|
1282
|
+
stdin=null_input,
|
|
1283
|
+
stdout=subprocess.PIPE,
|
|
1284
|
+
stderr=subprocess.PIPE,
|
|
1285
|
+
)
|
|
1281
1286
|
|
|
1282
1287
|
stdout_git, stderr_git = process.communicate()
|
|
1283
1288
|
assert process.returncode == 0, stderr_git
|
|
@@ -1346,15 +1351,17 @@ def checkTestRequirements(filename):
|
|
|
1346
1351
|
if line.startswith("# nuitka-skip-unless-"):
|
|
1347
1352
|
if line[21:33] == "expression: ":
|
|
1348
1353
|
expression = line[33:]
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1354
|
+
|
|
1355
|
+
with getNullOutput() as null_output:
|
|
1356
|
+
result = subprocess.call(
|
|
1357
|
+
(
|
|
1358
|
+
os.environ["PYTHON"],
|
|
1359
|
+
"-c",
|
|
1360
|
+
"import sys, os; sys.exit(not bool(%s))" % expression,
|
|
1361
|
+
),
|
|
1362
|
+
stdout=null_output,
|
|
1363
|
+
stderr=subprocess.STDOUT,
|
|
1364
|
+
)
|
|
1358
1365
|
if result != 0:
|
|
1359
1366
|
return (False, "Expression '%s' evaluated to false" % expression)
|
|
1360
1367
|
|
|
@@ -322,7 +322,9 @@ def main():
|
|
|
322
322
|
|
|
323
323
|
extra_options = os.getenv("NUITKA_EXTRA_OPTIONS", "").split()
|
|
324
324
|
|
|
325
|
-
if os.path.normcase(os.environ["PYTHON"]).endswith(
|
|
325
|
+
if os.path.normcase(os.environ["PYTHON"]).endswith(
|
|
326
|
+
("-dbg", "-debug", "d", "_d.exe")
|
|
327
|
+
):
|
|
326
328
|
python_debug = True
|
|
327
329
|
elif "--python-debug" in extra_options or "--python-dbg" in extra_options:
|
|
328
330
|
python_debug = True
|
|
@@ -17,8 +17,6 @@ from optparse import OptionParser
|
|
|
17
17
|
from nuitka.__past__ import md5
|
|
18
18
|
from nuitka.tools.testing.Common import (
|
|
19
19
|
check_output,
|
|
20
|
-
convertUsing2to3,
|
|
21
|
-
decideNeeds2to3,
|
|
22
20
|
getPythonSysPath,
|
|
23
21
|
getPythonVersionString,
|
|
24
22
|
getTempDir,
|
|
@@ -98,8 +96,6 @@ def main():
|
|
|
98
96
|
my_print("PYTHON_BINARY='%s'" % os.environ["PYTHON"])
|
|
99
97
|
my_print("TEST_CASE_HASH='%s'" % md5(getFileContents(test_case, "rb")).hexdigest())
|
|
100
98
|
|
|
101
|
-
needs_2to3 = decideNeeds2to3(test_case)
|
|
102
|
-
|
|
103
99
|
if options.target_dir:
|
|
104
100
|
copyFile(
|
|
105
101
|
test_case, os.path.join(options.target_dir, os.path.basename(test_case))
|
|
@@ -116,10 +112,6 @@ def main():
|
|
|
116
112
|
putTextFileContents(test_case_1, case_1_source)
|
|
117
113
|
putTextFileContents(test_case_2, case_2_source)
|
|
118
114
|
|
|
119
|
-
if needs_2to3:
|
|
120
|
-
test_case_1, _needs_delete = convertUsing2to3(test_case_1)
|
|
121
|
-
test_case_2, _needs_delete = convertUsing2to3(test_case_2)
|
|
122
|
-
|
|
123
115
|
os.environ["PYTHONHASHSEED"] = "0"
|
|
124
116
|
|
|
125
117
|
if nuitka:
|
|
@@ -143,6 +135,7 @@ def main():
|
|
|
143
135
|
"--no-progressbar",
|
|
144
136
|
"--nofollow-imports",
|
|
145
137
|
"--python-flag=no_site",
|
|
138
|
+
"--static-libpython=yes",
|
|
146
139
|
]
|
|
147
140
|
|
|
148
141
|
nuitka_call.extend(os.getenv("NUITKA_EXTRA_OPTIONS", "").split())
|
|
@@ -251,6 +251,16 @@ The standard CPython3.12 test suite. Execute this for all corner cases to be
|
|
|
251
251
|
covered. With Python 2.x these are not run. Default is %default.""",
|
|
252
252
|
)
|
|
253
253
|
|
|
254
|
+
parser.add_option(
|
|
255
|
+
"--skip-cpython313-tests",
|
|
256
|
+
action="store_false",
|
|
257
|
+
dest="cpython313",
|
|
258
|
+
default=True,
|
|
259
|
+
help="""\
|
|
260
|
+
The standard CPython3.13 test suite. Execute this for all corner cases to be
|
|
261
|
+
covered. With Python 2.x these are not run. Default is %default.""",
|
|
262
|
+
)
|
|
263
|
+
|
|
254
264
|
parser.add_option(
|
|
255
265
|
"--skip-other-cpython-tests",
|
|
256
266
|
action="store_true",
|
|
@@ -380,6 +390,15 @@ Do not use Python3.11 even if available on the system. Default is %default.""",
|
|
|
380
390
|
Do not use Python3.12 even if available on the system. Default is %default.""",
|
|
381
391
|
)
|
|
382
392
|
|
|
393
|
+
parser.add_option(
|
|
394
|
+
"--no-python3.13",
|
|
395
|
+
action="store_true",
|
|
396
|
+
dest="no313",
|
|
397
|
+
default=False,
|
|
398
|
+
help="""\
|
|
399
|
+
Do not use Python3.13 even if available on the system. Default is %default.""",
|
|
400
|
+
)
|
|
401
|
+
|
|
383
402
|
parser.add_option(
|
|
384
403
|
"--coverage",
|
|
385
404
|
action="store_true",
|
|
@@ -416,6 +435,17 @@ Allow Nuitka to download code if necessary, e.g. dependency walker on Windows. D
|
|
|
416
435
|
Enforce the use of MinGW64 on Windows. Defaults to off.""",
|
|
417
436
|
)
|
|
418
437
|
|
|
438
|
+
parser.add_option(
|
|
439
|
+
"--jobs",
|
|
440
|
+
action="store",
|
|
441
|
+
dest="jobs",
|
|
442
|
+
default=None,
|
|
443
|
+
help="""\
|
|
444
|
+
The value of --jobs to use when calling Nuitka. Use negative values to
|
|
445
|
+
keep cores unused. Nuitka uses available cores by default. Defaults to
|
|
446
|
+
not being passed.""",
|
|
447
|
+
)
|
|
448
|
+
|
|
419
449
|
options, positional_args = parser.parse_args()
|
|
420
450
|
|
|
421
451
|
if positional_args:
|
|
@@ -446,6 +476,8 @@ Enforce the use of MinGW64 on Windows. Defaults to off.""",
|
|
|
446
476
|
options.no311 = True
|
|
447
477
|
if sys.version_info[0:2] != (3, 12):
|
|
448
478
|
options.no312 = True
|
|
479
|
+
if sys.version_info[0:2] != (3, 13):
|
|
480
|
+
options.no313 = True
|
|
449
481
|
|
|
450
482
|
if options.cpython_no_other:
|
|
451
483
|
if sys.version_info[0:2] != (2, 6):
|
|
@@ -472,6 +504,8 @@ Enforce the use of MinGW64 on Windows. Defaults to off.""",
|
|
|
472
504
|
options.cpython311 = False
|
|
473
505
|
if sys.version_info[0:2] != (3, 12):
|
|
474
506
|
options.cpython312 = False
|
|
507
|
+
if sys.version_info[0:2] != (3, 13):
|
|
508
|
+
options.cpython313 = False
|
|
475
509
|
|
|
476
510
|
if options.cpython_none:
|
|
477
511
|
options.cpython26 = False
|
|
@@ -486,6 +520,7 @@ Enforce the use of MinGW64 on Windows. Defaults to off.""",
|
|
|
486
520
|
options.cpython310 = False
|
|
487
521
|
options.cpython311 = False
|
|
488
522
|
options.cpython312 = False
|
|
523
|
+
options.cpython313 = False
|
|
489
524
|
|
|
490
525
|
if options.coverage and os.path.exists(".coverage"):
|
|
491
526
|
os.unlink(".coverage")
|
|
@@ -593,6 +628,8 @@ def main():
|
|
|
593
628
|
return False
|
|
594
629
|
if command == "python3.12" and options.no312:
|
|
595
630
|
return False
|
|
631
|
+
if command == "python3.13" and options.no313:
|
|
632
|
+
return False
|
|
596
633
|
|
|
597
634
|
# Shortcuts for python versions, also needed for Windows as it won't have
|
|
598
635
|
# the version number in the Python binaries at all.
|
|
@@ -616,6 +653,10 @@ def main():
|
|
|
616
653
|
return True
|
|
617
654
|
if command == "python3.11" and sys.version_info[0:2] == (3, 11):
|
|
618
655
|
return True
|
|
656
|
+
if command == "python3.12" and sys.version_info[0:2] == (3, 12):
|
|
657
|
+
return True
|
|
658
|
+
if command == "python3.13" and sys.version_info[0:2] == (3, 13):
|
|
659
|
+
return True
|
|
619
660
|
|
|
620
661
|
path = os.environ["PATH"]
|
|
621
662
|
|
|
@@ -654,6 +695,9 @@ def main():
|
|
|
654
695
|
if os.name == "nt" and options.mingw64:
|
|
655
696
|
yield "--mingw64"
|
|
656
697
|
|
|
698
|
+
if options.jobs is not None:
|
|
699
|
+
yield "--jobs=%s" % options.jobs
|
|
700
|
+
|
|
657
701
|
if where is not None:
|
|
658
702
|
tmp_dir = getTempDir()
|
|
659
703
|
|
|
@@ -686,7 +730,8 @@ def main():
|
|
|
686
730
|
my_print("Run '%s' in '%s'." % (" ".join(parts), os.getcwd()))
|
|
687
731
|
|
|
688
732
|
if hide_output:
|
|
689
|
-
|
|
733
|
+
with getNullOutput() as null_output:
|
|
734
|
+
result = subprocess.call(parts, stdout=null_output)
|
|
690
735
|
else:
|
|
691
736
|
result = subprocess.call(parts)
|
|
692
737
|
|
|
@@ -933,6 +978,17 @@ def main():
|
|
|
933
978
|
else:
|
|
934
979
|
my_print("The CPython3.12 tests are not present, not run.")
|
|
935
980
|
|
|
981
|
+
# Running the Python 3.12 test suite only with CPython3.x.
|
|
982
|
+
if not use_python.startswith("python2"):
|
|
983
|
+
if options.cpython313:
|
|
984
|
+
if os.path.exists("./tests/CPython313/run_all.py"):
|
|
985
|
+
with withExtendedExtraOptions(
|
|
986
|
+
*getExtraFlags(where, "313tests", flags)
|
|
987
|
+
):
|
|
988
|
+
executeSubTest("./tests/CPython313/run_all.py search")
|
|
989
|
+
else:
|
|
990
|
+
my_print("The CPython3.13 tests are not present, not run.")
|
|
991
|
+
|
|
936
992
|
if not any(
|
|
937
993
|
checkExecutableCommand("python%s" % python_version)
|
|
938
994
|
for python_version in getTestExecutionPythonVersions()
|
|
@@ -951,55 +1007,65 @@ def main():
|
|
|
951
1007
|
my_print("Cannot execute tests with Python 2.7, disabled or not installed.")
|
|
952
1008
|
|
|
953
1009
|
if checkExecutableCommand("python2.6"):
|
|
954
|
-
execute_tests("python2.6-
|
|
1010
|
+
execute_tests("python2.6-no-debug", "python2.6", "")
|
|
955
1011
|
else:
|
|
956
1012
|
my_print("Cannot execute tests with Python 2.6, disabled or not installed.")
|
|
957
1013
|
|
|
958
1014
|
if checkExecutableCommand("python2.7"):
|
|
959
|
-
execute_tests("python2.7-
|
|
1015
|
+
execute_tests("python2.7-no-debug", "python2.7", "")
|
|
960
1016
|
else:
|
|
961
1017
|
my_print("Cannot execute tests with Python 2.7, disabled or not installed.")
|
|
962
1018
|
|
|
963
1019
|
if checkExecutableCommand("python3.4"):
|
|
964
|
-
execute_tests("python3.4-
|
|
1020
|
+
execute_tests("python3.4-no-debug", "python3.4", "")
|
|
965
1021
|
else:
|
|
966
1022
|
my_print("Cannot execute tests with Python 3.4, disabled or not installed.")
|
|
967
1023
|
|
|
968
1024
|
if checkExecutableCommand("python3.5"):
|
|
969
|
-
execute_tests("python3.5-
|
|
1025
|
+
execute_tests("python3.5-no-debug", "python3.5", "")
|
|
970
1026
|
else:
|
|
971
1027
|
my_print("Cannot execute tests with Python 3.5, disabled or not installed.")
|
|
972
1028
|
|
|
973
1029
|
if checkExecutableCommand("python3.6"):
|
|
974
|
-
execute_tests("python3.6-
|
|
1030
|
+
execute_tests("python3.6-no-debug", "python3.6", "")
|
|
975
1031
|
else:
|
|
976
1032
|
my_print("Cannot execute tests with Python 3.6, disabled or not installed.")
|
|
977
1033
|
|
|
978
1034
|
if checkExecutableCommand("python3.7"):
|
|
979
|
-
execute_tests("python3.7-
|
|
1035
|
+
execute_tests("python3.7-no-debug", "python3.7", "")
|
|
980
1036
|
else:
|
|
981
1037
|
my_print("Cannot execute tests with Python 3.7, disabled or not installed.")
|
|
982
1038
|
|
|
983
1039
|
if checkExecutableCommand("python3.8"):
|
|
984
|
-
execute_tests("python3.8-
|
|
1040
|
+
execute_tests("python3.8-no-debug", "python3.8", "")
|
|
985
1041
|
else:
|
|
986
1042
|
my_print("Cannot execute tests with Python 3.8, disabled or not installed.")
|
|
987
1043
|
|
|
988
1044
|
if checkExecutableCommand("python3.9"):
|
|
989
|
-
execute_tests("python3.9-
|
|
1045
|
+
execute_tests("python3.9-no-debug", "python3.9", "")
|
|
990
1046
|
else:
|
|
991
1047
|
my_print("Cannot execute tests with Python 3.9, disabled or not installed.")
|
|
992
1048
|
|
|
993
1049
|
if checkExecutableCommand("python3.10"):
|
|
994
|
-
execute_tests("python3.10-
|
|
1050
|
+
execute_tests("python3.10-no-debug", "python3.10", "")
|
|
995
1051
|
else:
|
|
996
1052
|
my_print("Cannot execute tests with Python 3.10, disabled or not installed.")
|
|
997
1053
|
|
|
998
1054
|
if checkExecutableCommand("python3.11"):
|
|
999
|
-
execute_tests("python3.11-
|
|
1055
|
+
execute_tests("python3.11-no-debug", "python3.11", "")
|
|
1000
1056
|
else:
|
|
1001
1057
|
my_print("Cannot execute tests with Python 3.11, disabled or not installed.")
|
|
1002
1058
|
|
|
1059
|
+
if checkExecutableCommand("python3.12"):
|
|
1060
|
+
execute_tests("python3.12-no-debug", "python3.12", "")
|
|
1061
|
+
else:
|
|
1062
|
+
my_print("Cannot execute tests with Python 3.12, disabled or not installed.")
|
|
1063
|
+
|
|
1064
|
+
if checkExecutableCommand("python3.13"):
|
|
1065
|
+
execute_tests("python3.13-no-debug", "python3.13", "")
|
|
1066
|
+
else:
|
|
1067
|
+
my_print("Cannot execute tests with Python 3.13, disabled or not installed.")
|
|
1068
|
+
|
|
1003
1069
|
if options.coverage:
|
|
1004
1070
|
publishCoverageData()
|
|
1005
1071
|
|
nuitka/tools/watch/AutoStage.py
CHANGED
nuitka/tree/Building.py
CHANGED
|
@@ -146,6 +146,7 @@ from .ReformulationAssignmentStatements import (
|
|
|
146
146
|
buildInplaceAssignNode,
|
|
147
147
|
buildNamedExprNode,
|
|
148
148
|
buildTypeAliasNode,
|
|
149
|
+
buildTypeVarNode,
|
|
149
150
|
)
|
|
150
151
|
from .ReformulationBooleanExpressions import buildBoolOpNode
|
|
151
152
|
from .ReformulationCallExpressions import buildCallNode
|
|
@@ -463,7 +464,7 @@ def handleGlobalDeclarationNode(provider, node, source_ref):
|
|
|
463
464
|
provider.isExpressionClassBodyBase()
|
|
464
465
|
and closure_variable.getName() == "__class__"
|
|
465
466
|
):
|
|
466
|
-
if python_version <
|
|
467
|
+
if python_version < 0x300:
|
|
467
468
|
SyntaxErrors.raiseSyntaxError(
|
|
468
469
|
"cannot make __class__ global", source_ref
|
|
469
470
|
)
|
|
@@ -778,6 +779,7 @@ setBuildingDispatchers(
|
|
|
778
779
|
"Num": buildNumberNode,
|
|
779
780
|
"Bytes": buildBytesNode,
|
|
780
781
|
"Continue": buildStatementLoopContinue,
|
|
782
|
+
"TypeVar": buildTypeVarNode,
|
|
781
783
|
},
|
|
782
784
|
path_args1={"Ellipsis": buildEllipsisNode},
|
|
783
785
|
)
|
|
@@ -785,7 +787,7 @@ setBuildingDispatchers(
|
|
|
785
787
|
|
|
786
788
|
def buildParseTree(provider, ast_tree, source_ref, is_main):
|
|
787
789
|
# There are a bunch of branches here, mostly to deal with version
|
|
788
|
-
# differences for module default variables.
|
|
790
|
+
# differences for module default variables.
|
|
789
791
|
|
|
790
792
|
# Maybe one day, we do exec inlining again, that is what this is for,
|
|
791
793
|
# then is_module won't be True, for now it always is.
|
|
@@ -873,7 +875,7 @@ def buildParseTree(provider, ast_tree, source_ref, is_main):
|
|
|
873
875
|
# This assigns "__path__" value.
|
|
874
876
|
statements.append(createPathAssignment(provider, internal_source_ref))
|
|
875
877
|
|
|
876
|
-
if python_version >=
|
|
878
|
+
if python_version >= 0x300 and not is_main:
|
|
877
879
|
statements += (
|
|
878
880
|
StatementAssignmentAttribute(
|
|
879
881
|
expression=ExpressionModuleAttributeSpecRef(
|
|
@@ -925,23 +927,6 @@ def buildParseTree(provider, ast_tree, source_ref, is_main):
|
|
|
925
927
|
)
|
|
926
928
|
)
|
|
927
929
|
|
|
928
|
-
needs__initializing__ = (
|
|
929
|
-
not provider.isMainModule() and 0x300 <= python_version < 0x340
|
|
930
|
-
)
|
|
931
|
-
|
|
932
|
-
if needs__initializing__:
|
|
933
|
-
# Set "__initializing__" at the beginning to True
|
|
934
|
-
statements.append(
|
|
935
|
-
StatementAssignmentVariableName(
|
|
936
|
-
provider=provider,
|
|
937
|
-
variable_name="__initializing__",
|
|
938
|
-
source=makeConstantRefNode(
|
|
939
|
-
constant=True, source_ref=internal_source_ref, user_provided=True
|
|
940
|
-
),
|
|
941
|
-
source_ref=internal_source_ref,
|
|
942
|
-
)
|
|
943
|
-
)
|
|
944
|
-
|
|
945
930
|
if provider.needsAnnotationsDictionary():
|
|
946
931
|
# Set "__annotations__" on module level to {}
|
|
947
932
|
statements.append(
|
|
@@ -959,19 +944,6 @@ def buildParseTree(provider, ast_tree, source_ref, is_main):
|
|
|
959
944
|
if result is not None:
|
|
960
945
|
statements.extend(result.subnode_statements)
|
|
961
946
|
|
|
962
|
-
if needs__initializing__:
|
|
963
|
-
# Set "__initializing__" at the end to False
|
|
964
|
-
statements.append(
|
|
965
|
-
StatementAssignmentVariableName(
|
|
966
|
-
provider=provider,
|
|
967
|
-
variable_name="__initializing__",
|
|
968
|
-
source=makeConstantRefNode(
|
|
969
|
-
constant=False, source_ref=internal_source_ref, user_provided=True
|
|
970
|
-
),
|
|
971
|
-
source_ref=internal_source_ref,
|
|
972
|
-
)
|
|
973
|
-
)
|
|
974
|
-
|
|
975
947
|
result = makeModuleFrame(
|
|
976
948
|
module=provider, statements=statements, source_ref=source_ref
|
|
977
949
|
)
|
|
@@ -990,14 +962,15 @@ def decideCompilationMode(is_top, module_name, module_filename, for_pgo):
|
|
|
990
962
|
|
|
991
963
|
is_stdlib = module_filename is not None and isStandardLibraryPath(module_filename)
|
|
992
964
|
|
|
993
|
-
# Technically required modules must be bytecode
|
|
965
|
+
# Technically required modules must be bytecode, do not even ask plugins
|
|
966
|
+
# about it.
|
|
994
967
|
if is_stdlib and module_name in detectEarlyImports():
|
|
995
968
|
return "bytecode"
|
|
996
969
|
|
|
997
970
|
result = Plugins.decideCompilation(module_name)
|
|
998
971
|
|
|
999
|
-
# Cannot change mode of __main__ to bytecode, that is not going
|
|
1000
|
-
#
|
|
972
|
+
# Cannot change mode of "__main__" to bytecode, that is not going to work
|
|
973
|
+
# currently, maybe in the future we could allow it.
|
|
1001
974
|
if result == "bytecode" and is_top:
|
|
1002
975
|
plugins_logger.warning(
|
|
1003
976
|
"""\
|
|
@@ -1010,7 +983,7 @@ required to compiled."""
|
|
|
1010
983
|
|
|
1011
984
|
# Include all of standard library as bytecode, for now. We need to identify
|
|
1012
985
|
# which ones really need that.
|
|
1013
|
-
if not is_top and is_stdlib:
|
|
986
|
+
if not is_top and is_stdlib and result is None:
|
|
1014
987
|
result = "bytecode"
|
|
1015
988
|
|
|
1016
989
|
# Plugins need to win over PGO, as they might know it better
|
|
@@ -350,6 +350,7 @@ def makeStarListArgumentErrorRaise(called_variable, star_list_variable):
|
|
|
350
350
|
source_ref=internal_source_ref,
|
|
351
351
|
),
|
|
352
352
|
),
|
|
353
|
+
for_raise=False,
|
|
353
354
|
source_ref=internal_source_ref,
|
|
354
355
|
),
|
|
355
356
|
exception_value=None,
|
|
@@ -481,6 +482,7 @@ def _makeRaiseExceptionMustBeMapping(called_variable, star_dict_variable):
|
|
|
481
482
|
source_ref=internal_source_ref,
|
|
482
483
|
),
|
|
483
484
|
),
|
|
485
|
+
for_raise=False,
|
|
484
486
|
source_ref=internal_source_ref,
|
|
485
487
|
),
|
|
486
488
|
exception_value=None,
|
|
@@ -695,6 +697,7 @@ def _makeRaiseNoStringItem(called_variable):
|
|
|
695
697
|
exception_type=ExpressionBuiltinMakeException(
|
|
696
698
|
exception_name="TypeError",
|
|
697
699
|
args=(raise_arg,),
|
|
700
|
+
for_raise=False,
|
|
698
701
|
source_ref=internal_source_ref,
|
|
699
702
|
),
|
|
700
703
|
exception_value=None,
|
|
@@ -748,6 +751,7 @@ def _makeRaiseDuplicationItem(called_variable, tmp_key_variable):
|
|
|
748
751
|
source_ref=internal_source_ref,
|
|
749
752
|
),
|
|
750
753
|
),
|
|
754
|
+
for_raise=False,
|
|
751
755
|
source_ref=internal_source_ref,
|
|
752
756
|
),
|
|
753
757
|
exception_value=None,
|