Nuitka-winsvc 2.3.9__cp311-cp311-win_amd64.whl → 2.4.1__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.3.9.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +29 -2
- nuitka/MainControl.py +62 -35
- nuitka/ModuleRegistry.py +11 -3
- nuitka/OptionParsing.py +78 -39
- nuitka/Options.py +142 -35
- nuitka/OutputDirectories.py +5 -0
- nuitka/PostProcessing.py +23 -14
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +26 -23
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +1 -0
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +5 -2
- nuitka/build/include/nuitka/allocator.h +27 -5
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +23 -23
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +0 -2
- nuitka/build/include/nuitka/helper/attributes.h +7 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helpers.h +7 -4
- nuitka/build/include/nuitka/prelude.h +6 -10
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +5 -5
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
- nuitka/build/static_src/CompiledCellType.c +7 -7
- nuitka/build/static_src/CompiledCodeHelpers.c +51 -36
- nuitka/build/static_src/CompiledCoroutineType.c +2 -4
- nuitka/build/static_src/CompiledFrameType.c +109 -82
- nuitka/build/static_src/CompiledFunctionType.c +36 -9
- nuitka/build/static_src/CompiledGeneratorType.c +12 -10
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
- nuitka/build/static_src/CompiledMethodType.c +14 -13
- nuitka/build/static_src/HelpersAttributes.c +13 -15
- nuitka/build/static_src/HelpersBuiltin.c +18 -9
- nuitka/build/static_src/HelpersCalling.c +13 -13
- nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
- nuitka/build/static_src/HelpersComparisonEq.c +110 -110
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +110 -110
- nuitka/build/static_src/HelpersComparisonGt.c +110 -110
- nuitka/build/static_src/HelpersComparisonLe.c +110 -110
- nuitka/build/static_src/HelpersComparisonLt.c +110 -110
- nuitka/build/static_src/HelpersComparisonNe.c +110 -110
- nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
- nuitka/build/static_src/HelpersDictionaries.c +9 -0
- nuitka/build/static_src/HelpersFiles.c +2 -2
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersHeapStorage.c +4 -0
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersLists.c +5 -1
- nuitka/build/static_src/HelpersMatching.c +95 -35
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
- nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +8 -4
- nuitka/build/static_src/MainProgram.c +28 -9
- nuitka/build/static_src/MetaPathBasedLoader.c +126 -110
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +30 -1
- nuitka/build/static_src/OnefileBootstrap.c +34 -6
- nuitka/code_generation/AttributeCodes.py +12 -10
- nuitka/code_generation/CodeGeneration.py +6 -7
- nuitka/code_generation/ConstantCodes.py +53 -10
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +3 -4
- nuitka/code_generation/LoaderCodes.py +3 -0
- nuitka/code_generation/LocalsDictCodes.py +36 -14
- nuitka/code_generation/MatchCodes.py +23 -4
- nuitka/code_generation/ModuleCodes.py +0 -7
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
- nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
- nuitka/freezer/DependsExe.py +3 -1
- nuitka/freezer/DllDependenciesMacOS.py +28 -14
- nuitka/freezer/IncludedDataFiles.py +12 -3
- nuitka/freezer/IncludedEntryPoints.py +8 -2
- nuitka/freezer/Onefile.py +6 -1
- nuitka/freezer/Standalone.py +9 -2
- nuitka/importing/Importing.py +14 -5
- nuitka/importing/Recursion.py +3 -0
- nuitka/nodes/AttributeNodesGenerated.py +21 -12
- nuitka/nodes/BuiltinOpenNodes.py +5 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
- nuitka/nodes/BuiltinRefNodes.py +41 -1
- nuitka/nodes/ChildrenHavingMixins.py +143 -355
- nuitka/nodes/ClassNodes.py +30 -12
- nuitka/nodes/CodeObjectSpecs.py +9 -0
- nuitka/nodes/ExpressionBasesGenerated.py +11 -11
- nuitka/nodes/FunctionNodes.py +11 -12
- nuitka/nodes/FutureSpecs.py +16 -3
- nuitka/nodes/GeneratorNodes.py +2 -2
- nuitka/nodes/HardImportNodesGenerated.py +11 -134
- nuitka/nodes/LocalsScopes.py +19 -23
- nuitka/nodes/MatchNodes.py +18 -7
- nuitka/nodes/ModuleAttributeNodes.py +1 -20
- nuitka/nodes/ModuleNodes.py +23 -6
- nuitka/nodes/NodeBases.py +13 -11
- nuitka/nodes/NodeMetaClasses.py +26 -10
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +11 -11
- nuitka/nodes/SubscriptNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +28 -2
- nuitka/nodes/shapes/BuiltinTypeShapes.py +21 -1
- nuitka/optimizations/FunctionInlining.py +3 -6
- nuitka/optimizations/Optimization.py +13 -12
- nuitka/optimizations/TraceCollections.py +19 -4
- nuitka/plugins/PluginBase.py +121 -133
- nuitka/plugins/Plugins.py +91 -3
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
- nuitka/plugins/standard/DataFilesPlugin.py +15 -6
- nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
- nuitka/plugins/standard/DllFilesPlugin.py +5 -3
- nuitka/plugins/standard/ImplicitImports.py +34 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
- nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +491 -186
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +17 -0
- nuitka/reports/Reports.py +53 -5
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +0 -6
- nuitka/tools/data_composer/DataComposer.py +29 -27
- nuitka/tools/environments/CreateEnvironment.py +1 -0
- nuitka/tools/environments/Virtualenv.py +25 -11
- nuitka/tools/general/find_module/FindModuleCode.py +13 -3
- nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
- nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
- nuitka/tools/specialize/CTypeDescriptions.py +13 -7
- nuitka/tools/specialize/SpecializePython.py +18 -1
- nuitka/tools/testing/Common.py +19 -6
- nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
- nuitka/tools/watch/AutoStage.py +144 -0
- nuitka/tools/watch/__main__.py +79 -32
- nuitka/tree/Building.py +105 -104
- nuitka/tree/ComplexCallHelperFunctions.py +16 -26
- nuitka/tree/InternalModule.py +9 -1
- nuitka/tree/ReformulationAssignmentStatements.py +29 -59
- nuitka/tree/ReformulationClasses.py +10 -17
- nuitka/tree/ReformulationClasses3.py +69 -43
- nuitka/tree/ReformulationComparisonExpressions.py +6 -16
- nuitka/tree/ReformulationContractionExpressions.py +14 -23
- nuitka/tree/ReformulationDictionaryCreation.py +6 -10
- nuitka/tree/ReformulationExecStatements.py +10 -10
- nuitka/tree/ReformulationForLoopStatements.py +6 -12
- nuitka/tree/ReformulationFunctionStatements.py +22 -28
- nuitka/tree/ReformulationImportStatements.py +8 -10
- nuitka/tree/ReformulationLambdaExpressions.py +3 -6
- nuitka/tree/ReformulationMatchStatements.py +166 -60
- nuitka/tree/ReformulationMultidist.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +1 -1
- nuitka/tree/ReformulationPrintStatements.py +3 -6
- nuitka/tree/ReformulationSequenceCreation.py +13 -26
- nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
- nuitka/tree/ReformulationWithStatements.py +12 -16
- nuitka/tree/SourceHandling.py +13 -8
- nuitka/tree/VariableClosure.py +5 -21
- nuitka/utils/Distributions.py +80 -11
- nuitka/utils/Download.py +38 -31
- nuitka/utils/Execution.py +21 -9
- nuitka/utils/FileOperations.py +55 -28
- nuitka/utils/Images.py +6 -1
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/ModuleNames.py +11 -5
- nuitka/utils/ReExecute.py +17 -13
- nuitka/utils/SharedLibraries.py +69 -41
- nuitka/utils/Signing.py +3 -1
- nuitka/utils/StaticLibraries.py +51 -41
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +29 -7
- /Nuitka_winsvc-2.3.9.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
|
@@ -34,7 +34,6 @@ from nuitka.nodes.StatementNodes import (
|
|
|
34
34
|
)
|
|
35
35
|
from nuitka.nodes.VariableAssignNodes import makeStatementAssignmentVariable
|
|
36
36
|
from nuitka.nodes.VariableRefNodes import ExpressionTempVariableRef
|
|
37
|
-
from nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable
|
|
38
37
|
from nuitka.nodes.YieldNodes import ExpressionYieldFromAwaitable
|
|
39
38
|
from nuitka.PythonVersions import python_version
|
|
40
39
|
|
|
@@ -42,7 +41,10 @@ from .ReformulationAssignmentStatements import buildAssignmentStatements
|
|
|
42
41
|
from .ReformulationTryExceptStatements import (
|
|
43
42
|
makeTryExceptSingleHandlerNodeWithPublish,
|
|
44
43
|
)
|
|
45
|
-
from .ReformulationTryFinallyStatements import
|
|
44
|
+
from .ReformulationTryFinallyStatements import (
|
|
45
|
+
makeTryFinallyReleaseStatement,
|
|
46
|
+
makeTryFinallyStatement,
|
|
47
|
+
)
|
|
46
48
|
from .TreeHelpers import (
|
|
47
49
|
buildNode,
|
|
48
50
|
buildStatementsNode,
|
|
@@ -285,19 +287,13 @@ def _buildWithNode(provider, context_expr, assign_target, body, sync, source_ref
|
|
|
285
287
|
),
|
|
286
288
|
)
|
|
287
289
|
|
|
288
|
-
return
|
|
290
|
+
return makeTryFinallyReleaseStatement(
|
|
289
291
|
provider=provider,
|
|
290
292
|
tried=statements,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
makeStatementReleaseVariable(
|
|
296
|
-
variable=tmp_enter_variable, source_ref=with_exit_source_ref
|
|
297
|
-
),
|
|
298
|
-
makeStatementReleaseVariable(
|
|
299
|
-
variable=tmp_exit_variable, source_ref=with_exit_source_ref
|
|
300
|
-
),
|
|
293
|
+
variables=(
|
|
294
|
+
tmp_source_variable,
|
|
295
|
+
tmp_enter_variable,
|
|
296
|
+
tmp_exit_variable,
|
|
301
297
|
),
|
|
302
298
|
source_ref=source_ref,
|
|
303
299
|
)
|
|
@@ -308,13 +304,13 @@ def buildWithNode(provider, node, source_ref):
|
|
|
308
304
|
# manual. Catches exceptions, and provides them to "__exit__", while making
|
|
309
305
|
# the "__enter__" value available under a given name.
|
|
310
306
|
|
|
311
|
-
# Before Python3
|
|
307
|
+
# Before Python3, multiple context managers are not visible in the parse
|
|
312
308
|
# tree, now we need to handle it ourselves.
|
|
313
309
|
if hasattr(node, "items"):
|
|
314
310
|
context_exprs = [item.context_expr for item in node.items]
|
|
315
311
|
assign_targets = [item.optional_vars for item in node.items]
|
|
316
312
|
else:
|
|
317
|
-
# Make it a list for before Python3
|
|
313
|
+
# Make it a list for before Python3
|
|
318
314
|
context_exprs = [node.context_expr]
|
|
319
315
|
assign_targets = [node.optional_vars]
|
|
320
316
|
|
|
@@ -344,7 +340,7 @@ def buildAsyncWithNode(provider, node, source_ref):
|
|
|
344
340
|
# manual. Catches exceptions, and provides them to "__exit__", while making
|
|
345
341
|
# the "__enter__" value available under a given name.
|
|
346
342
|
|
|
347
|
-
# Before Python3
|
|
343
|
+
# Before Python3, multiple context managers are not visible in the parse
|
|
348
344
|
# tree, now we need to handle it ourselves.
|
|
349
345
|
context_exprs = [item.context_expr for item in node.items]
|
|
350
346
|
assign_targets = [item.optional_vars for item in node.items]
|
nuitka/tree/SourceHandling.py
CHANGED
|
@@ -17,10 +17,7 @@ from nuitka.containers.OrderedSets import OrderedSet
|
|
|
17
17
|
from nuitka.plugins.Plugins import Plugins
|
|
18
18
|
from nuitka.PythonVersions import python_version, python_version_str
|
|
19
19
|
from nuitka.Tracing import general, my_print
|
|
20
|
-
from nuitka.utils.FileOperations import
|
|
21
|
-
getFileContentByLine,
|
|
22
|
-
putTextFileContents,
|
|
23
|
-
)
|
|
20
|
+
from nuitka.utils.FileOperations import putTextFileContents
|
|
24
21
|
from nuitka.utils.Shebang import getShebangFromSource, parseShebang
|
|
25
22
|
from nuitka.utils.Utils import isWin32OrPosixWindows
|
|
26
23
|
|
|
@@ -192,7 +189,8 @@ def readSourceCodeFromFilenameWithInformation(
|
|
|
192
189
|
contributing_plugins = ()
|
|
193
190
|
|
|
194
191
|
if (
|
|
195
|
-
|
|
192
|
+
module_name is not None
|
|
193
|
+
and Options.shallShowSourceModifications(module_name)
|
|
196
194
|
and source_code_modified != source_code
|
|
197
195
|
):
|
|
198
196
|
source_diff = getSourceCodeDiff(source_code, source_code_modified)
|
|
@@ -324,7 +322,14 @@ def parsePyIFile(module_name, pyi_filename):
|
|
|
324
322
|
in_import_part = ""
|
|
325
323
|
in_quote = None
|
|
326
324
|
|
|
327
|
-
|
|
325
|
+
pyi_contents = readSourceCodeFromFilename(
|
|
326
|
+
# Do not pass module name, or else plugins modify it, which they
|
|
327
|
+
# should not.
|
|
328
|
+
module_name=None,
|
|
329
|
+
source_filename=pyi_filename,
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
for line in pyi_contents.splitlines():
|
|
328
333
|
line = line.strip()
|
|
329
334
|
|
|
330
335
|
if in_quote:
|
|
@@ -369,11 +374,11 @@ def parsePyIFile(module_name, pyi_filename):
|
|
|
369
374
|
if dot_count > 0:
|
|
370
375
|
if origin_name:
|
|
371
376
|
origin_name = module_name.getRelativePackageName(
|
|
372
|
-
level=dot_count
|
|
377
|
+
level=dot_count
|
|
373
378
|
).getChildNamed(origin_name)
|
|
374
379
|
else:
|
|
375
380
|
origin_name = module_name.getRelativePackageName(
|
|
376
|
-
level=dot_count
|
|
381
|
+
level=dot_count - 1
|
|
377
382
|
)
|
|
378
383
|
|
|
379
384
|
if origin_name != module_name:
|
nuitka/tree/VariableClosure.py
CHANGED
|
@@ -28,7 +28,6 @@ from nuitka.nodes.VariableRefNodes import (
|
|
|
28
28
|
ExpressionTempVariableRef,
|
|
29
29
|
makeExpressionVariableRef,
|
|
30
30
|
)
|
|
31
|
-
from nuitka.nodes.VariableReleaseNodes import makeStatementReleaseVariable
|
|
32
31
|
from nuitka.PythonVersions import (
|
|
33
32
|
getErrorMessageExecWithNestedFunction,
|
|
34
33
|
python_version,
|
|
@@ -37,7 +36,7 @@ from nuitka.Variables import isSharedAmongScopes, releaseSharedScopeInformation
|
|
|
37
36
|
|
|
38
37
|
from .Operations import VisitorNoopMixin, visitTree
|
|
39
38
|
from .ReformulationFunctionStatements import addFunctionVariableReleases
|
|
40
|
-
from .ReformulationTryFinallyStatements import
|
|
39
|
+
from .ReformulationTryFinallyStatements import makeTryFinallyReleaseStatement
|
|
41
40
|
from .SyntaxErrors import raiseSyntaxError
|
|
42
41
|
|
|
43
42
|
# Note: We do the variable scope assignment, as an extra step from tree
|
|
@@ -158,7 +157,7 @@ class VariableClosureLookupVisitorPhase1(VisitorNoopMixin):
|
|
|
158
157
|
source=node.subnode_source.subnode_left,
|
|
159
158
|
source_ref=node.source_ref,
|
|
160
159
|
),
|
|
161
|
-
|
|
160
|
+
makeTryFinallyReleaseStatement(
|
|
162
161
|
provider=provider,
|
|
163
162
|
tried=(
|
|
164
163
|
makeStatementAssignmentVariable(
|
|
@@ -184,9 +183,7 @@ class VariableClosureLookupVisitorPhase1(VisitorNoopMixin):
|
|
|
184
183
|
source_ref=node.source_ref,
|
|
185
184
|
),
|
|
186
185
|
),
|
|
187
|
-
|
|
188
|
-
variable=tmp_variable, source_ref=node.source_ref
|
|
189
|
-
),
|
|
186
|
+
variables=(tmp_variable,),
|
|
190
187
|
source_ref=node.source_ref,
|
|
191
188
|
),
|
|
192
189
|
)
|
|
@@ -294,32 +291,19 @@ class VariableClosureLookupVisitorPhase1(VisitorNoopMixin):
|
|
|
294
291
|
elif node.isExpressionGeneratorObjectBody():
|
|
295
292
|
if python_version >= 0x300:
|
|
296
293
|
self._handleNonLocal(node)
|
|
297
|
-
|
|
298
|
-
# Only Python3.4 or later allows for generators to have qualname.
|
|
299
|
-
if python_version >= 0x340:
|
|
300
294
|
self._handleQualnameSetup(node)
|
|
301
295
|
elif node.isExpressionCoroutineObjectBody():
|
|
302
296
|
self._handleNonLocal(node)
|
|
303
|
-
|
|
304
297
|
self._handleQualnameSetup(node)
|
|
305
298
|
elif node.isExpressionAsyncgenObjectBody():
|
|
306
299
|
self._handleNonLocal(node)
|
|
307
|
-
|
|
308
300
|
self._handleQualnameSetup(node)
|
|
309
|
-
elif node.
|
|
301
|
+
elif node.isExpressionClassMappingBody():
|
|
310
302
|
self._handleNonLocal(node)
|
|
311
|
-
|
|
312
|
-
# Python3.4 allows for class declarations to be made global, even
|
|
313
|
-
# after they were declared, so we need to fix this up.
|
|
314
|
-
if python_version >= 0x340:
|
|
315
|
-
self._handleQualnameSetup(node)
|
|
303
|
+
self._handleQualnameSetup(node)
|
|
316
304
|
elif node.isExpressionFunctionBody():
|
|
317
305
|
if python_version >= 0x300:
|
|
318
306
|
self._handleNonLocal(node)
|
|
319
|
-
|
|
320
|
-
# Python 3.4 allows for class declarations to be made global, even
|
|
321
|
-
# after they were declared, so we need to fix this up.
|
|
322
|
-
if python_version >= 0x340:
|
|
323
307
|
self._handleQualnameSetup(node)
|
|
324
308
|
# Check if continue and break are properly in loops. If not, raise a
|
|
325
309
|
# syntax error.
|
nuitka/utils/Distributions.py
CHANGED
|
@@ -9,6 +9,7 @@ from nuitka.__past__ import ( # pylint: disable=redefined-builtin
|
|
|
9
9
|
FileNotFoundError,
|
|
10
10
|
unicode,
|
|
11
11
|
)
|
|
12
|
+
from nuitka.containers.Namedtuples import makeNamedtupleClass
|
|
12
13
|
from nuitka.containers.OrderedSets import OrderedSet
|
|
13
14
|
from nuitka.Options import isExperimental
|
|
14
15
|
from nuitka.PythonFlavors import (
|
|
@@ -74,6 +75,15 @@ is typically caused by corruption of its installation."""
|
|
|
74
75
|
return None
|
|
75
76
|
|
|
76
77
|
|
|
78
|
+
def _getDistributionInstallerFileContents(distribution):
|
|
79
|
+
installer_name = _getDistributionMetadataFileContents(distribution, "INSTALLER")
|
|
80
|
+
|
|
81
|
+
if installer_name:
|
|
82
|
+
installer_name = installer_name.strip().lower()
|
|
83
|
+
|
|
84
|
+
return installer_name
|
|
85
|
+
|
|
86
|
+
|
|
77
87
|
def getDistributionTopLevelPackageNames(distribution):
|
|
78
88
|
"""Returns the top level package names for a distribution."""
|
|
79
89
|
top_level_txt = _getDistributionMetadataFileContents(distribution, "top_level.txt")
|
|
@@ -126,6 +136,16 @@ def getDistributionTopLevelPackageNames(distribution):
|
|
|
126
136
|
return tuple(result)
|
|
127
137
|
|
|
128
138
|
|
|
139
|
+
def _get_pkg_resources_module():
|
|
140
|
+
# pip and vendored pkg_resources are optional of course, but of course very
|
|
141
|
+
# omnipresent generally, so we don't handle failure here.
|
|
142
|
+
|
|
143
|
+
# pylint: disable=I0021,no-name-in-module
|
|
144
|
+
from pip._vendor import pkg_resources
|
|
145
|
+
|
|
146
|
+
return pkg_resources
|
|
147
|
+
|
|
148
|
+
|
|
129
149
|
def _get_pkg_resource_distributions():
|
|
130
150
|
"""Small replacement of distributions() of importlib.metadata that uses pkg_resources"""
|
|
131
151
|
|
|
@@ -135,11 +155,7 @@ def _get_pkg_resource_distributions():
|
|
|
135
155
|
if _user_site_directory is not None:
|
|
136
156
|
site.USER_SITE = _user_site_directory
|
|
137
157
|
|
|
138
|
-
|
|
139
|
-
# omnipresent generally, so we don't handle failure here.
|
|
140
|
-
|
|
141
|
-
# pylint: disable=I0021,no-name-in-module
|
|
142
|
-
from pip._vendor import pkg_resources
|
|
158
|
+
pkg_resources = _get_pkg_resources_module()
|
|
143
159
|
|
|
144
160
|
return lambda: pkg_resources.working_set
|
|
145
161
|
|
|
@@ -353,14 +369,10 @@ def getDistributionInstallerName(distribution_name):
|
|
|
353
369
|
else:
|
|
354
370
|
_distribution_to_installer[distribution_name] = "not_found"
|
|
355
371
|
else:
|
|
356
|
-
installer_name =
|
|
357
|
-
distribution, "INSTALLER"
|
|
358
|
-
)
|
|
372
|
+
installer_name = _getDistributionInstallerFileContents(distribution)
|
|
359
373
|
|
|
360
374
|
if installer_name:
|
|
361
|
-
_distribution_to_installer[distribution_name] =
|
|
362
|
-
installer_name.strip().lower()
|
|
363
|
-
)
|
|
375
|
+
_distribution_to_installer[distribution_name] = installer_name
|
|
364
376
|
elif isAnacondaPython():
|
|
365
377
|
_distribution_to_installer[distribution_name] = "conda"
|
|
366
378
|
elif isPdmPackageInstallation(distribution):
|
|
@@ -401,6 +413,20 @@ def getDistributionName(distribution):
|
|
|
401
413
|
|
|
402
414
|
if hasattr(distribution, "metadata"):
|
|
403
415
|
result = distribution.metadata["Name"]
|
|
416
|
+
|
|
417
|
+
if result is None:
|
|
418
|
+
installer_name = _getDistributionInstallerFileContents(distribution)
|
|
419
|
+
|
|
420
|
+
if installer_name == "debian":
|
|
421
|
+
distribution_path = _getDistributionPath(distribution)
|
|
422
|
+
|
|
423
|
+
if distribution_path is not None:
|
|
424
|
+
dir_name = os.path.basename(distribution_path)
|
|
425
|
+
|
|
426
|
+
if dir_name.endswith(".dist-info"):
|
|
427
|
+
dir_name = dir_name[:-10]
|
|
428
|
+
|
|
429
|
+
result = dir_name.rsplit("-", 1)[0]
|
|
404
430
|
else:
|
|
405
431
|
result = distribution.project_name
|
|
406
432
|
|
|
@@ -443,6 +469,49 @@ def getDistributionLicense(distribution):
|
|
|
443
469
|
return license_name
|
|
444
470
|
|
|
445
471
|
|
|
472
|
+
def _getEntryPointGroup(group_name):
|
|
473
|
+
try:
|
|
474
|
+
if isExperimental("force-pkg-resources-metadata"):
|
|
475
|
+
raise ImportError
|
|
476
|
+
|
|
477
|
+
try:
|
|
478
|
+
from importlib.metadata import entry_points
|
|
479
|
+
except ImportError:
|
|
480
|
+
from importlib_metadata import entry_points
|
|
481
|
+
|
|
482
|
+
except (ImportError, SyntaxError, RuntimeError):
|
|
483
|
+
pkg_resources = _get_pkg_resources_module()
|
|
484
|
+
|
|
485
|
+
entry_points = pkg_resources.entry_points
|
|
486
|
+
|
|
487
|
+
return entry_points(group=group_name)
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
EntryPointDescription = makeNamedtupleClass(
|
|
491
|
+
"EntryPointDescription",
|
|
492
|
+
(
|
|
493
|
+
"distribution_name",
|
|
494
|
+
"distribution",
|
|
495
|
+
"module_name",
|
|
496
|
+
),
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
def getEntryPointGroup(group_name):
|
|
501
|
+
result = OrderedSet()
|
|
502
|
+
|
|
503
|
+
for entry_point in _getEntryPointGroup(group_name):
|
|
504
|
+
result.add(
|
|
505
|
+
EntryPointDescription(
|
|
506
|
+
distribution_name=getDistributionName(entry_point.dist),
|
|
507
|
+
distribution=entry_point.dist,
|
|
508
|
+
module_name=ModuleName(entry_point.module),
|
|
509
|
+
)
|
|
510
|
+
)
|
|
511
|
+
|
|
512
|
+
return result
|
|
513
|
+
|
|
514
|
+
|
|
446
515
|
# User site directory if any
|
|
447
516
|
_user_site_directory = None
|
|
448
517
|
|
nuitka/utils/Download.py
CHANGED
|
@@ -52,6 +52,7 @@ def getCachedDownload(
|
|
|
52
52
|
name,
|
|
53
53
|
url,
|
|
54
54
|
binary,
|
|
55
|
+
unzip,
|
|
55
56
|
flatten,
|
|
56
57
|
is_arch_specific,
|
|
57
58
|
specificity,
|
|
@@ -114,44 +115,52 @@ Fully automatic, cached. Proceed and download"""
|
|
|
114
115
|
% (url, e, download_path)
|
|
115
116
|
)
|
|
116
117
|
|
|
117
|
-
if
|
|
118
|
-
|
|
118
|
+
if unzip:
|
|
119
|
+
if not os.path.isfile(exe_path) and os.path.isfile(download_path):
|
|
120
|
+
Tracing.general.info("Extracting to '%s'" % exe_path)
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
import zipfile
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
try:
|
|
125
|
+
# Not all Python versions support using it as a context manager, pylint: disable=consider-using-with
|
|
126
|
+
zip_file = zipfile.ZipFile(download_path)
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
for zip_info in zip_file.infolist():
|
|
129
|
+
if zip_info.filename[-1] == "/":
|
|
130
|
+
continue
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
if flatten:
|
|
133
|
+
zip_info.filename = os.path.basename(zip_info.filename)
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
zip_file.extract(zip_info, nuitka_download_dir)
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
except (
|
|
138
|
+
# Catching anything zip throws, pylint: disable=broad-except
|
|
139
|
+
Exception
|
|
140
|
+
):
|
|
141
|
+
Tracing.general.info(
|
|
142
|
+
"Problem with the downloaded zip file, deleting it."
|
|
143
|
+
)
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
|
|
145
|
+
deleteFile(binary, must_exist=False)
|
|
146
|
+
deleteFile(download_path, must_exist=True)
|
|
140
147
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
Tracing.general.sysexit(
|
|
149
|
+
"Error, need '%s' as extracted from '%s'." % (binary, url)
|
|
150
|
+
)
|
|
144
151
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
# Check success here, and make sure it's executable.
|
|
153
|
+
if os.path.isfile(exe_path):
|
|
154
|
+
addFileExecutablePermission(exe_path)
|
|
155
|
+
else:
|
|
156
|
+
if reject:
|
|
157
|
+
Tracing.general.sysexit(reject)
|
|
151
158
|
|
|
152
|
-
|
|
159
|
+
exe_path = None
|
|
153
160
|
|
|
154
|
-
|
|
161
|
+
return exe_path
|
|
162
|
+
else:
|
|
163
|
+
return download_path
|
|
155
164
|
|
|
156
165
|
|
|
157
166
|
def getCachedDownloadedMinGW64(target_arch, assume_yes_for_downloads):
|
|
@@ -164,19 +173,17 @@ def getCachedDownloadedMinGW64(target_arch, assume_yes_for_downloads):
|
|
|
164
173
|
url = "https://github.com/brechtsanders/winlibs_mingw/releases/download/13.2.0-16.0.6-11.0.1-msvcrt-r1/winlibs-i686-posix-dwarf-gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt-11.0.1-r1.zip"
|
|
165
174
|
binary = r"mingw32\bin\gcc.exe"
|
|
166
175
|
elif target_arch == "arm64":
|
|
167
|
-
|
|
176
|
+
return None
|
|
168
177
|
else:
|
|
169
178
|
assert False, target_arch
|
|
170
179
|
|
|
171
|
-
if url is None:
|
|
172
|
-
return None
|
|
173
|
-
|
|
174
180
|
gcc_binary = getCachedDownload(
|
|
175
181
|
name="mingw64",
|
|
176
182
|
url=url,
|
|
177
183
|
is_arch_specific=target_arch,
|
|
178
184
|
specificity=url.rsplit("/", 2)[1],
|
|
179
185
|
binary=binary,
|
|
186
|
+
unzip=True,
|
|
180
187
|
flatten=False,
|
|
181
188
|
message="Nuitka will use gcc from MinGW64 of winlibs to compile on Windows.",
|
|
182
189
|
reject="Only this specific gcc is supported with Nuitka.",
|
nuitka/utils/Execution.py
CHANGED
|
@@ -20,7 +20,8 @@ from .Utils import getArchitecture, isWin32OrPosixWindows, isWin32Windows
|
|
|
20
20
|
# Cache, so we avoid repeated command lookups.
|
|
21
21
|
_executable_command_cache = {}
|
|
22
22
|
|
|
23
|
-
# We emulate and use APIs of stdlib,
|
|
23
|
+
# We emulate and use APIs of stdlib,
|
|
24
|
+
# spell-checker: ignore popenargs,creationflags,preexec_fn,setsid,debuginfod
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
def _getExecutablePath(filename, search_path):
|
|
@@ -289,7 +290,17 @@ def wrapCommandForDebuggerForExec(*args):
|
|
|
289
290
|
general.sysexit("Error, no 'gdb' or 'lldb' binary found in path.")
|
|
290
291
|
|
|
291
292
|
if gdb_path is not None:
|
|
292
|
-
args = (
|
|
293
|
+
args = (
|
|
294
|
+
gdb_path,
|
|
295
|
+
"gdb",
|
|
296
|
+
"-q",
|
|
297
|
+
"-ex=set pagination off",
|
|
298
|
+
"-ex=set debuginfod enabled off",
|
|
299
|
+
"-ex=run",
|
|
300
|
+
"-ex=where",
|
|
301
|
+
"-ex=quit",
|
|
302
|
+
"--args",
|
|
303
|
+
) + args
|
|
293
304
|
else:
|
|
294
305
|
args = (lldb_path, "lldb", "-o", "run", "-o", "bt", "-o", "quit", "--") + args
|
|
295
306
|
|
|
@@ -352,13 +363,14 @@ def executeToolChecked(
|
|
|
352
363
|
# Allow to avoid repeated scans in PATH for the tool.
|
|
353
364
|
command[0] = getExecutablePath(tool)
|
|
354
365
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
366
|
+
with withEnvironmentVarOverridden("LC_ALL", "C"):
|
|
367
|
+
process = subprocess.Popen(
|
|
368
|
+
command,
|
|
369
|
+
stdin=getNullInput(),
|
|
370
|
+
stdout=subprocess.PIPE,
|
|
371
|
+
stderr=subprocess.PIPE,
|
|
372
|
+
shell=False,
|
|
373
|
+
)
|
|
362
374
|
|
|
363
375
|
stdout, stderr = process.communicate()
|
|
364
376
|
result = process.poll()
|
nuitka/utils/FileOperations.py
CHANGED
|
@@ -42,6 +42,7 @@ from nuitka.Tracing import (
|
|
|
42
42
|
from .Importing import importFromInlineCopy
|
|
43
43
|
from .ThreadedExecutor import RLock, getThreadIdent
|
|
44
44
|
from .Utils import (
|
|
45
|
+
decoratorRetries,
|
|
45
46
|
isLinux,
|
|
46
47
|
isMacOS,
|
|
47
48
|
isWin32OrPosixWindows,
|
|
@@ -718,7 +719,7 @@ def addFilenameExtension(path, extension):
|
|
|
718
719
|
return path
|
|
719
720
|
|
|
720
721
|
|
|
721
|
-
def removeDirectory(path, ignore_errors):
|
|
722
|
+
def removeDirectory(path, logger, ignore_errors, extra_recommendation):
|
|
722
723
|
"""Remove a directory recursively.
|
|
723
724
|
|
|
724
725
|
On Windows, it happens that operations fail, and succeed when retried,
|
|
@@ -729,36 +730,52 @@ def removeDirectory(path, ignore_errors):
|
|
|
729
730
|
it hopefully only briefly.
|
|
730
731
|
"""
|
|
731
732
|
|
|
732
|
-
def onError(func, path, exc_info):
|
|
733
|
-
# Record what happened what happened, pylint: disable=unused-argument
|
|
734
|
-
last_error.append((func, path))
|
|
735
|
-
|
|
736
733
|
with withFileLock("removing directory %s" % path):
|
|
737
734
|
if os.path.exists(path):
|
|
738
|
-
previous_error = []
|
|
739
|
-
|
|
740
|
-
while True:
|
|
741
|
-
last_error = []
|
|
742
|
-
shutil.rmtree(path, ignore_errors=False, onerror=onError)
|
|
743
|
-
|
|
744
|
-
# onError as a side effect, modifies last_error
|
|
745
|
-
if previous_error == last_error:
|
|
746
|
-
break
|
|
747
|
-
|
|
748
|
-
previous_error = list(last_error)
|
|
749
|
-
time.sleep(0.1)
|
|
750
|
-
|
|
751
|
-
# if it still exists, try one more time, this time not ignoring errors.
|
|
752
|
-
if os.path.exists(path):
|
|
753
|
-
try:
|
|
754
|
-
shutil.rmtree(path, ignore_errors=ignore_errors)
|
|
755
|
-
except OSError:
|
|
756
|
-
if not ignore_errors:
|
|
757
|
-
raise
|
|
758
|
-
|
|
759
735
|
|
|
760
|
-
|
|
761
|
-
|
|
736
|
+
@decoratorRetries(
|
|
737
|
+
logger=logger,
|
|
738
|
+
purpose="delete '%s'" % path,
|
|
739
|
+
consequence="the path is not fully removed",
|
|
740
|
+
extra_recommendation=extra_recommendation,
|
|
741
|
+
)
|
|
742
|
+
def _removeDirectory():
|
|
743
|
+
def onError(func, path, exc_info):
|
|
744
|
+
# Record what happened what happened, pylint: disable=unused-argument
|
|
745
|
+
last_error.append((func, path))
|
|
746
|
+
|
|
747
|
+
previous_error = []
|
|
748
|
+
|
|
749
|
+
# Try deleting while ignoring errors first.
|
|
750
|
+
while True:
|
|
751
|
+
last_error = []
|
|
752
|
+
shutil.rmtree(path, ignore_errors=False, onerror=onError)
|
|
753
|
+
|
|
754
|
+
# onError as a side effect, modifies last_error
|
|
755
|
+
if previous_error == last_error:
|
|
756
|
+
break
|
|
757
|
+
|
|
758
|
+
previous_error = list(last_error)
|
|
759
|
+
time.sleep(0.2)
|
|
760
|
+
|
|
761
|
+
# If it still exists, try one more time, this time not ignoring errors.
|
|
762
|
+
if os.path.exists(path):
|
|
763
|
+
try:
|
|
764
|
+
shutil.rmtree(path, ignore_errors=ignore_errors)
|
|
765
|
+
except OSError:
|
|
766
|
+
if not ignore_errors:
|
|
767
|
+
raise
|
|
768
|
+
|
|
769
|
+
_removeDirectory()
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
def resetDirectory(path, logger, ignore_errors, extra_recommendation):
|
|
773
|
+
removeDirectory(
|
|
774
|
+
path=path,
|
|
775
|
+
logger=logger,
|
|
776
|
+
ignore_errors=ignore_errors,
|
|
777
|
+
extra_recommendation=extra_recommendation,
|
|
778
|
+
)
|
|
762
779
|
makePath(path)
|
|
763
780
|
|
|
764
781
|
|
|
@@ -1490,6 +1507,16 @@ def isLegalPath(path):
|
|
|
1490
1507
|
if path.endswith(illegal_suffix):
|
|
1491
1508
|
return False, "contains illegal suffix %r" % illegal_suffix
|
|
1492
1509
|
|
|
1510
|
+
for part in path.split(os.path.sep):
|
|
1511
|
+
if part == ".":
|
|
1512
|
+
continue
|
|
1513
|
+
|
|
1514
|
+
if part.endswith(illegal_suffix):
|
|
1515
|
+
return False, "contains illegal suffix %r in path part %r" % (
|
|
1516
|
+
part,
|
|
1517
|
+
illegal_suffix,
|
|
1518
|
+
)
|
|
1519
|
+
|
|
1493
1520
|
return True, None
|
|
1494
1521
|
|
|
1495
1522
|
|
nuitka/utils/Images.py
CHANGED
|
@@ -22,7 +22,12 @@ def checkIconUsage(logger, icon_path):
|
|
|
22
22
|
if needs_conversion:
|
|
23
23
|
try:
|
|
24
24
|
import imageio # pylint: disable=I0021,import-error,unused-import
|
|
25
|
-
except ImportError:
|
|
25
|
+
except ImportError as e:
|
|
26
|
+
from nuitka import Options
|
|
27
|
+
|
|
28
|
+
if Options.is_debug:
|
|
29
|
+
logger.info("Exception importing 'imageio' is %s" % repr(e))
|
|
30
|
+
|
|
26
31
|
logger.sysexit(
|
|
27
32
|
"""\
|
|
28
33
|
Need to install 'imageio' to automatically convert the non native \
|
nuitka/utils/Importing.py
CHANGED
|
@@ -322,7 +322,7 @@ def hasPackageDirFilename(path):
|
|
|
322
322
|
def getPackageDirFilename(path):
|
|
323
323
|
assert os.path.isdir(path)
|
|
324
324
|
|
|
325
|
-
for suffix in (".py",)
|
|
325
|
+
for suffix in getSharedLibrarySuffixes() + (".py",):
|
|
326
326
|
candidate = os.path.join(path, "__init__" + suffix)
|
|
327
327
|
|
|
328
328
|
if os.path.isfile(candidate):
|
nuitka/utils/ModuleNames.py
CHANGED
|
@@ -112,12 +112,18 @@ class ModuleName(str):
|
|
|
112
112
|
yield parent_package
|
|
113
113
|
|
|
114
114
|
def getRelativePackageName(self, level):
|
|
115
|
-
|
|
115
|
+
assert level >= 0
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
parts = self.asString().split(".")
|
|
118
|
+
|
|
119
|
+
while level > 0:
|
|
120
|
+
if not parts:
|
|
121
|
+
return None
|
|
122
|
+
|
|
123
|
+
del parts[-1]
|
|
124
|
+
level -= 1
|
|
125
|
+
|
|
126
|
+
return ModuleName(".".join(parts))
|
|
121
127
|
|
|
122
128
|
def getTopLevelPackageName(self):
|
|
123
129
|
"""Get the top level package name.
|