Nuitka-winsvc 2.1.6__cp311-cp311-win_amd64.whl → 2.2.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.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/RECORD +232 -223
- nuitka/Errors.py +4 -0
- nuitka/HardImportRegistry.py +18 -1
- nuitka/MainControl.py +27 -30
- nuitka/OptionParsing.py +32 -30
- nuitka/Options.py +26 -13
- nuitka/OutputDirectories.py +7 -4
- nuitka/PostProcessing.py +9 -7
- nuitka/Progress.py +3 -3
- nuitka/PythonVersions.py +2 -2
- nuitka/TreeXML.py +1 -1
- nuitka/Version.py +1 -1
- nuitka/build/Backend.scons +2 -1
- nuitka/build/DataComposerInterface.py +1 -0
- nuitka/build/Onefile.scons +2 -1
- nuitka/build/SconsCaching.py +64 -46
- nuitka/build/SconsCompilerSettings.py +19 -6
- nuitka/build/SconsHacks.py +0 -1
- nuitka/build/SconsInterface.py +84 -5
- nuitka/build/SconsProgress.py +0 -1
- nuitka/build/SconsUtils.py +8 -4
- nuitka/build/include/nuitka/allocator.h +8 -3
- nuitka/build/include/nuitka/compiled_cell.h +8 -0
- nuitka/build/include/nuitka/exceptions.h +554 -179
- nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
- nuitka/build/include/nuitka/helper/import_hard.h +3 -0
- nuitka/build/include/nuitka/helper/ints.h +15 -2
- nuitka/build/include/nuitka/helper/lists.h +4 -1
- nuitka/build/include/nuitka/helper/raising.h +12 -0
- nuitka/build/include/nuitka/helper/tuples.h +5 -1
- nuitka/build/include/nuitka/helpers.h +4 -0
- nuitka/build/include/nuitka/importing.h +3 -4
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +38 -11
- nuitka/build/include/nuitka/printing.h +3 -0
- nuitka/build/include/nuitka/threading.h +2 -6
- nuitka/build/include/nuitka/type_aliases.h +27 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
- nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
- nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
- nuitka/build/static_src/CompiledCodeHelpers.c +24 -14
- nuitka/build/static_src/CompiledCoroutineType.c +96 -114
- nuitka/build/static_src/CompiledFrameType.c +14 -11
- nuitka/build/static_src/CompiledFunctionType.c +34 -7
- nuitka/build/static_src/CompiledGeneratorType.c +248 -142
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
- nuitka/build/static_src/CompiledMethodType.c +8 -7
- nuitka/build/static_src/HelpersAttributes.c +2 -19
- nuitka/build/static_src/HelpersBuiltin.c +2 -1
- nuitka/build/static_src/HelpersComparisonEq.c +32 -18
- nuitka/build/static_src/HelpersComparisonGe.c +50 -36
- nuitka/build/static_src/HelpersComparisonGt.c +50 -36
- nuitka/build/static_src/HelpersComparisonLe.c +50 -36
- nuitka/build/static_src/HelpersComparisonLt.c +50 -36
- nuitka/build/static_src/HelpersComparisonNe.c +32 -18
- nuitka/build/static_src/HelpersDeepcopy.c +6 -8
- nuitka/build/static_src/HelpersDictionaries.c +8 -3
- nuitka/build/static_src/HelpersExceptions.c +36 -22
- nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
- nuitka/build/static_src/HelpersImportHard.c +15 -0
- nuitka/build/static_src/HelpersJitSources.c +46 -0
- nuitka/build/static_src/HelpersLists.c +40 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
- nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
- nuitka/build/static_src/HelpersProfiling.c +3 -4
- nuitka/build/static_src/HelpersRaising.c +62 -1
- nuitka/build/static_src/HelpersStrings.c +203 -8
- nuitka/build/static_src/HelpersTypes.c +42 -0
- nuitka/build/static_src/MainProgram.c +1 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
- nuitka/build/static_src/OnefileBootstrap.c +3 -3
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
- nuitka/code_generation/BuiltinCodes.py +1 -0
- nuitka/code_generation/CodeGeneration.py +11 -0
- nuitka/code_generation/CodeHelpers.py +5 -3
- nuitka/code_generation/CodeObjectCodes.py +10 -6
- nuitka/code_generation/ComparisonCodes.py +19 -3
- nuitka/code_generation/ConstantCodes.py +5 -0
- nuitka/code_generation/Contexts.py +22 -6
- nuitka/code_generation/Emission.py +1 -0
- nuitka/code_generation/ErrorCodes.py +8 -16
- nuitka/code_generation/EvalCodes.py +5 -3
- nuitka/code_generation/ExceptionCodes.py +8 -1
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
- nuitka/code_generation/FrameCodes.py +5 -3
- nuitka/code_generation/FunctionCodes.py +0 -1
- nuitka/code_generation/GeneratorCodes.py +3 -3
- nuitka/code_generation/GlobalConstants.py +0 -2
- nuitka/code_generation/ImportCodes.py +2 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/ListCodes.py +11 -17
- nuitka/code_generation/MatchCodes.py +0 -1
- nuitka/code_generation/ModuleCodes.py +2 -1
- nuitka/code_generation/Namify.py +0 -1
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +8 -6
- nuitka/code_generation/PackageResourceCodes.py +7 -5
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TypeAliasCodes.py +71 -0
- nuitka/code_generation/VariableCodes.py +7 -5
- nuitka/code_generation/VariableDeclarations.py +1 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
- nuitka/code_generation/c_types/CTypeVoids.py +1 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +14 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
- nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +4 -1
- nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
- nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
- nuitka/containers/Namedtuples.py +0 -1
- nuitka/finalizations/Finalization.py +1 -0
- nuitka/finalizations/FinalizeMarkups.py +0 -1
- nuitka/freezer/DllDependenciesMacOS.py +60 -13
- nuitka/freezer/DllDependenciesPosix.py +0 -1
- nuitka/freezer/IncludedDataFiles.py +46 -15
- nuitka/freezer/IncludedEntryPoints.py +5 -3
- nuitka/freezer/Standalone.py +6 -1
- nuitka/importing/ImportCache.py +2 -2
- nuitka/importing/ImportResolving.py +80 -78
- nuitka/importing/Importing.py +34 -1
- nuitka/nodes/AttributeNodesGenerated.py +21 -6
- nuitka/nodes/BuiltinComplexNodes.py +1 -0
- nuitka/nodes/BuiltinFormatNodes.py +1 -0
- nuitka/nodes/BuiltinIteratorNodes.py +5 -3
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
- nuitka/nodes/BuiltinRefNodes.py +8 -1
- nuitka/nodes/BuiltinVarsNodes.py +0 -1
- nuitka/nodes/ChildrenHavingMixins.py +906 -186
- nuitka/nodes/CodeObjectSpecs.py +1 -1
- nuitka/nodes/ConstantRefNodes.py +38 -0
- nuitka/nodes/CtypesNodes.py +0 -1
- nuitka/nodes/DictionaryNodes.py +0 -1
- nuitka/nodes/ExceptionNodes.py +10 -0
- nuitka/nodes/ExpressionBases.py +15 -9
- nuitka/nodes/ExpressionBasesGenerated.py +32 -15
- nuitka/nodes/FunctionNodes.py +50 -5
- nuitka/nodes/HardImportNodesGenerated.py +245 -60
- nuitka/nodes/ImportHardNodes.py +27 -13
- nuitka/nodes/ImportNodes.py +90 -70
- nuitka/nodes/InjectCNodes.py +0 -1
- nuitka/nodes/ModuleNodes.py +10 -5
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/OperatorNodesUnary.py +1 -0
- nuitka/nodes/OsSysNodes.py +0 -1
- nuitka/nodes/PackageMetadataNodes.py +0 -1
- nuitka/nodes/PackageResourceNodes.py +10 -6
- nuitka/nodes/StatementBasesGenerated.py +107 -60
- nuitka/nodes/StringConcatenationNodes.py +1 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TypeNodes.py +21 -0
- nuitka/nodes/VariableRefNodes.py +1 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
- nuitka/optimizations/Optimization.py +7 -6
- nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
- nuitka/optimizations/Tags.py +0 -1
- nuitka/optimizations/TraceCollections.py +6 -55
- nuitka/optimizations/ValueTraces.py +49 -1
- nuitka/plugins/PluginBase.py +26 -4
- nuitka/plugins/Plugins.py +49 -12
- nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
- nuitka/plugins/standard/DataFilesPlugin.py +2 -6
- nuitka/plugins/standard/DillPlugin.py +3 -3
- nuitka/plugins/standard/DllFilesPlugin.py +29 -23
- nuitka/plugins/standard/GiPlugin.py +1 -0
- nuitka/plugins/standard/ImplicitImports.py +8 -7
- nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
- nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
- nuitka/plugins/standard/PmwPlugin.py +10 -9
- nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
- nuitka/plugins/standard/TensorflowPlugin.py +1 -0
- nuitka/plugins/standard/TorchPlugin.py +1 -0
- nuitka/plugins/standard/TrioPlugin.py +1 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +242 -34
- nuitka/reports/CompilationReportReader.py +0 -1
- nuitka/reports/Reports.py +49 -5
- nuitka/specs/BuiltinParameterSpecs.py +10 -2
- nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
- nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
- nuitka/specs/HardImportSpecs.py +34 -1
- nuitka/specs/ParameterSpecs.py +11 -9
- nuitka/tools/environments/Virtualenv.py +0 -1
- nuitka/tools/specialize/CTypeDescriptions.py +15 -11
- nuitka/tools/specialize/SpecializeC.py +11 -9
- nuitka/tools/specialize/SpecializePython.py +57 -30
- nuitka/tools/testing/Common.py +24 -7
- nuitka/tools/testing/OutputComparison.py +4 -0
- nuitka/tools/testing/Pythons.py +0 -1
- nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
- nuitka/tools/watch/GitHub.py +4 -1
- nuitka/tools/watch/__main__.py +22 -1
- nuitka/tree/Building.py +3 -0
- nuitka/tree/InternalModule.py +0 -1
- nuitka/tree/ReformulationAssertStatements.py +1 -0
- nuitka/tree/ReformulationAssignmentStatements.py +26 -3
- nuitka/tree/ReformulationClasses3.py +23 -26
- nuitka/tree/ReformulationContractionExpressions.py +5 -3
- nuitka/tree/ReformulationDictionaryCreation.py +6 -5
- nuitka/tree/ReformulationExecStatements.py +8 -6
- nuitka/tree/ReformulationFunctionStatements.py +10 -6
- nuitka/tree/SourceHandling.py +8 -0
- nuitka/tree/TreeHelpers.py +6 -3
- nuitka/utils/AppDirs.py +6 -2
- nuitka/utils/CStrings.py +1 -1
- nuitka/utils/CommandLineOptions.py +0 -1
- nuitka/utils/Distributions.py +3 -3
- nuitka/utils/Download.py +5 -1
- nuitka/utils/Execution.py +6 -3
- nuitka/utils/FileOperations.py +61 -34
- nuitka/utils/Importing.py +4 -4
- nuitka/utils/InstanceCounters.py +1 -0
- nuitka/utils/MacOSApp.py +1 -0
- nuitka/utils/Shebang.py +1 -0
- nuitka/utils/Utils.py +39 -1
- nuitka/utils/WindowsFileUsage.py +4 -3
- {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/WHEEL +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/top_level.txt +0 -0
|
@@ -20,6 +20,7 @@ from nuitka.Options import (
|
|
|
20
20
|
getShallIncludeExternallyDataFilePatterns,
|
|
21
21
|
getShallIncludePackageData,
|
|
22
22
|
getShallNotIncludeDataFilePatterns,
|
|
23
|
+
isAcceleratedMode,
|
|
23
24
|
isOnefileMode,
|
|
24
25
|
isStandaloneMode,
|
|
25
26
|
shallMakeModule,
|
|
@@ -27,6 +28,7 @@ from nuitka.Options import (
|
|
|
27
28
|
from nuitka.OutputDirectories import getStandaloneDirectoryPath
|
|
28
29
|
from nuitka.Tracing import options_logger
|
|
29
30
|
from nuitka.utils.FileOperations import (
|
|
31
|
+
areSamePaths,
|
|
30
32
|
containsPathElements,
|
|
31
33
|
copyFileWithPermissions,
|
|
32
34
|
getFileContents,
|
|
@@ -145,18 +147,6 @@ def makeIncludedDataFile(source_path, dest_path, reason, tracer, tags):
|
|
|
145
147
|
if "framework_resource" in tags and not isMacOS():
|
|
146
148
|
tracer.sysexit("Using resource files on non-MacOS")
|
|
147
149
|
|
|
148
|
-
inside = True
|
|
149
|
-
if not isRelativePath(dest_path):
|
|
150
|
-
if "framework_resource" in tags and not isOnefileMode():
|
|
151
|
-
inside = isRelativePath(os.path.join("Resources", dest_path))
|
|
152
|
-
else:
|
|
153
|
-
inside = False
|
|
154
|
-
|
|
155
|
-
if not inside:
|
|
156
|
-
tracer.sysexit(
|
|
157
|
-
"Error, cannot use dest path '%s' outside of distribution." % dest_path
|
|
158
|
-
)
|
|
159
|
-
|
|
160
150
|
# Refuse directories, these must be kept distinct.
|
|
161
151
|
if os.path.isdir(source_path):
|
|
162
152
|
tracer.sysexit(
|
|
@@ -164,6 +154,27 @@ def makeIncludedDataFile(source_path, dest_path, reason, tracer, tags):
|
|
|
164
154
|
% source_path
|
|
165
155
|
)
|
|
166
156
|
|
|
157
|
+
# In accelerated mode, data files can be everywhere, but they cannot
|
|
158
|
+
# change place.
|
|
159
|
+
if isAcceleratedMode():
|
|
160
|
+
if "package_data" not in tags and not areSamePaths(source_path, dest_path):
|
|
161
|
+
tracer.sysexit(
|
|
162
|
+
"Error, cannot change paths for data files in accelerated mode '%s'."
|
|
163
|
+
% dest_path
|
|
164
|
+
)
|
|
165
|
+
else:
|
|
166
|
+
inside = True
|
|
167
|
+
if not isRelativePath(dest_path):
|
|
168
|
+
if "framework_resource" in tags and not isOnefileMode():
|
|
169
|
+
inside = isRelativePath(os.path.join("Resources", dest_path))
|
|
170
|
+
else:
|
|
171
|
+
inside = False
|
|
172
|
+
|
|
173
|
+
if not inside:
|
|
174
|
+
tracer.sysexit(
|
|
175
|
+
"Error, cannot use dest path '%s' outside of distribution." % dest_path
|
|
176
|
+
)
|
|
177
|
+
|
|
167
178
|
return IncludedDataFile(
|
|
168
179
|
kind="data_file",
|
|
169
180
|
source_path=source_path,
|
|
@@ -506,7 +517,25 @@ def _reportDataFiles():
|
|
|
506
517
|
_data_file_traces.clear()
|
|
507
518
|
|
|
508
519
|
|
|
509
|
-
def
|
|
520
|
+
def _checkPathConflict(dest_path, standalone_entry_points):
|
|
521
|
+
assert os.path.normpath(dest_path) == dest_path
|
|
522
|
+
|
|
523
|
+
while dest_path:
|
|
524
|
+
for standalone_entry_point in standalone_entry_points:
|
|
525
|
+
if dest_path == standalone_entry_point.dest_path:
|
|
526
|
+
options_logger.sysexit(
|
|
527
|
+
"""\
|
|
528
|
+
Error, data file to be placed in distribution as '%s' conflicts with %s '%s'."""
|
|
529
|
+
% (
|
|
530
|
+
dest_path,
|
|
531
|
+
standalone_entry_point.kind,
|
|
532
|
+
standalone_entry_point.dest_path,
|
|
533
|
+
)
|
|
534
|
+
)
|
|
535
|
+
dest_path = os.path.dirname(dest_path)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def _handleDataFile(included_datafile, standalone_entry_points):
|
|
510
539
|
"""Handle a data file."""
|
|
511
540
|
tracer = included_datafile.tracer
|
|
512
541
|
|
|
@@ -529,6 +558,7 @@ def _handleDataFile(included_datafile):
|
|
|
529
558
|
if "external" in included_datafile.tags:
|
|
530
559
|
dest_path = getOutputPath(included_datafile.dest_path)
|
|
531
560
|
else:
|
|
561
|
+
_checkPathConflict(included_datafile.dest_path, standalone_entry_points)
|
|
532
562
|
dest_path = os.path.join(dist_dir, included_datafile.dest_path)
|
|
533
563
|
|
|
534
564
|
if included_datafile.kind == "data_blob":
|
|
@@ -548,7 +578,7 @@ def _handleDataFile(included_datafile):
|
|
|
548
578
|
assert False, included_datafile
|
|
549
579
|
|
|
550
580
|
|
|
551
|
-
def copyDataFiles():
|
|
581
|
+
def copyDataFiles(standalone_entry_points):
|
|
552
582
|
"""Copy the data files needed for standalone distribution.
|
|
553
583
|
|
|
554
584
|
Notes:
|
|
@@ -576,7 +606,8 @@ plugins '--embed-*' options. Not done for '%s'."""
|
|
|
576
606
|
)
|
|
577
607
|
|
|
578
608
|
_handleDataFile(
|
|
579
|
-
included_datafile,
|
|
609
|
+
included_datafile=included_datafile,
|
|
610
|
+
standalone_entry_points=standalone_entry_points,
|
|
580
611
|
)
|
|
581
612
|
|
|
582
613
|
_reportDataFiles()
|
|
@@ -316,9 +316,11 @@ def addExtensionModuleEntryPoint(module):
|
|
|
316
316
|
+ getSharedLibrarySuffix(preferred=False),
|
|
317
317
|
module_name=module.getFullName(),
|
|
318
318
|
package_name=module.getFullName().getPackageName(),
|
|
319
|
-
reason=
|
|
320
|
-
|
|
321
|
-
|
|
319
|
+
reason=(
|
|
320
|
+
"required extension module for CPython library startup"
|
|
321
|
+
if module.isTechnical()
|
|
322
|
+
else "used extension module"
|
|
323
|
+
),
|
|
322
324
|
)
|
|
323
325
|
)
|
|
324
326
|
|
nuitka/freezer/Standalone.py
CHANGED
|
@@ -28,6 +28,8 @@ from nuitka.Progress import (
|
|
|
28
28
|
reportProgressBar,
|
|
29
29
|
setupProgressBar,
|
|
30
30
|
)
|
|
31
|
+
from nuitka.PythonFlavors import isAnacondaPython, isHomebrewPython
|
|
32
|
+
from nuitka.PythonVersions import getSystemPrefixPath
|
|
31
33
|
from nuitka.Tracing import general, inclusion_logger
|
|
32
34
|
from nuitka.utils.FileOperations import areInSamePaths, isFilenameBelowPath
|
|
33
35
|
from nuitka.utils.SharedLibraries import copyDllFile, setSharedLibraryRPATH
|
|
@@ -220,6 +222,9 @@ def copyDllsUsed(dist_dir, standalone_entry_points):
|
|
|
220
222
|
def _reduceToPythonPath(used_dlls):
|
|
221
223
|
inside_paths = getPythonUnpackedSearchPath()
|
|
222
224
|
|
|
225
|
+
if isAnacondaPython() or isHomebrewPython():
|
|
226
|
+
inside_paths.insert(0, getSystemPrefixPath())
|
|
227
|
+
|
|
223
228
|
def decideInside(dll_filename):
|
|
224
229
|
return any(
|
|
225
230
|
isFilenameBelowPath(path=inside_path, filename=dll_filename)
|
|
@@ -284,7 +289,7 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
|
|
|
284
289
|
# TODO: If used by a DLL from the same folder, put it there,
|
|
285
290
|
# otherwise top level, but for now this is limited to a few cases
|
|
286
291
|
# where required that way (openvino) or known to be good only (av),
|
|
287
|
-
# because it broke other things.
|
|
292
|
+
# because it broke other things. spell-checker: ignore openvino
|
|
288
293
|
if standalone_entry_point.package_name in (
|
|
289
294
|
"openvino",
|
|
290
295
|
"av",
|
nuitka/importing/ImportCache.py
CHANGED
|
@@ -68,14 +68,14 @@ def replaceImportedModule(old, new):
|
|
|
68
68
|
imported_by_name[key] = new
|
|
69
69
|
break
|
|
70
70
|
else:
|
|
71
|
-
assert False
|
|
71
|
+
assert False, (old, new)
|
|
72
72
|
|
|
73
73
|
for key, value in imported_modules.items():
|
|
74
74
|
if value == old:
|
|
75
75
|
imported_modules[key] = new
|
|
76
76
|
break
|
|
77
77
|
else:
|
|
78
|
-
assert False
|
|
78
|
+
assert False, (old, new)
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -15,101 +15,103 @@ from nuitka.utils.ModuleNames import ModuleName
|
|
|
15
15
|
|
|
16
16
|
_six_moves = {
|
|
17
17
|
"six.moves.builtins": "__builtin__" if python_version < 0x300 else "builtins",
|
|
18
|
-
"six.moves.configparser":
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
"six.moves.configparser": (
|
|
19
|
+
"ConfigParser" if python_version < 0x300 else "configparser"
|
|
20
|
+
),
|
|
21
21
|
"six.moves.copyreg": "copy_reg" if python_version < 0x300 else "copyreg",
|
|
22
22
|
"six.moves.dbm_gnu": "gdbm" if python_version < 0x300 else "dbm.gnu",
|
|
23
|
-
"six.moves._dummy_thread":
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"six.moves.http_cookiejar":
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
"six.moves._dummy_thread": (
|
|
24
|
+
"dummy_thread" if python_version < 0x300 else "_dummy_thread"
|
|
25
|
+
),
|
|
26
|
+
"six.moves.http_cookiejar": (
|
|
27
|
+
"cookielib" if python_version < 0x300 else "http.cookiejar"
|
|
28
|
+
),
|
|
29
29
|
"six.moves.http_cookies": "Cookie" if python_version < 0x300 else "http.cookies",
|
|
30
|
-
"six.moves.html_entities":
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
"six.moves.html_entities": (
|
|
31
|
+
"htmlentitydefs" if python_version < 0x300 else "html.entities"
|
|
32
|
+
),
|
|
33
33
|
"six.moves.html_parser": "HTMLParser" if python_version < 0x300 else "html.parser",
|
|
34
34
|
"six.moves.http_client": "httplib" if python_version < 0x300 else "http.client",
|
|
35
|
-
"six.moves.email_mime_multipart":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"six.moves.email_mime_nonmultipart":
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
"six.moves.email_mime_multipart": (
|
|
36
|
+
"email.MIMEMultipart" if python_version < 0x300 else "email.mime.multipart"
|
|
37
|
+
),
|
|
38
|
+
"six.moves.email_mime_nonmultipart": (
|
|
39
|
+
"email.MIMENonMultipart"
|
|
40
|
+
if python_version < 0x300
|
|
41
|
+
else "email.mime.nonmultipart"
|
|
42
|
+
),
|
|
43
|
+
"six.moves.email_mime_text": (
|
|
44
|
+
"email.MIMEText" if python_version < 0x300 else "email.mime.text"
|
|
45
|
+
),
|
|
46
|
+
"six.moves.email_mime_base": (
|
|
47
|
+
"email.MIMEBase" if python_version < 0x300 else "email.mime.base"
|
|
48
|
+
),
|
|
49
|
+
"six.moves.BaseHTTPServer": (
|
|
50
|
+
"BaseHTTPServer" if python_version < 0x300 else "http.server"
|
|
51
|
+
),
|
|
52
|
+
"six.moves.CGIHTTPServer": (
|
|
53
|
+
"CGIHTTPServer" if python_version < 0x300 else "http.server"
|
|
54
|
+
),
|
|
55
|
+
"six.moves.SimpleHTTPServer": (
|
|
56
|
+
"SimpleHTTPServer" if python_version < 0x300 else "http.server"
|
|
57
|
+
),
|
|
56
58
|
"six.moves.cPickle": "cPickle" if python_version < 0x300 else "pickle",
|
|
57
59
|
"six.moves.queue": "Queue" if python_version < 0x300 else "queue",
|
|
58
60
|
"six.moves.reprlib": "repr" if python_version < 0x300 else "reprlib",
|
|
59
|
-
"six.moves.socketserver":
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
"six.moves.socketserver": (
|
|
62
|
+
"SocketServer" if python_version < 0x300 else "socketserver"
|
|
63
|
+
),
|
|
62
64
|
"six.moves._thread": "thread" if python_version < 0x300 else "_thread",
|
|
63
65
|
"six.moves.tkinter": "Tkinter" if python_version < 0x300 else "tkinter",
|
|
64
|
-
"six.moves.tkinter_dialog":
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"six.moves.tkinter_filedialog":
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"six.moves.tkinter_scrolledtext":
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"six.moves.tkinter_simpledialog":
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
"six.moves.tkinter_dialog": (
|
|
67
|
+
"Dialog" if python_version < 0x300 else "tkinter.dialog"
|
|
68
|
+
),
|
|
69
|
+
"six.moves.tkinter_filedialog": (
|
|
70
|
+
"FileDialog" if python_version < 0x300 else "tkinter.filedialog"
|
|
71
|
+
),
|
|
72
|
+
"six.moves.tkinter_scrolledtext": (
|
|
73
|
+
"ScrolledText" if python_version < 0x300 else "tkinter.scrolledtext"
|
|
74
|
+
),
|
|
75
|
+
"six.moves.tkinter_simpledialog": (
|
|
76
|
+
"SimpleDialog" if python_version < 0x300 else "tkinter.simpledialog"
|
|
77
|
+
),
|
|
76
78
|
"six.moves.tkinter_tix": "Tix" if python_version < 0x300 else "tkinter.tix",
|
|
77
79
|
"six.moves.tkinter_ttk": "ttk" if python_version < 0x300 else "tkinter.ttk",
|
|
78
|
-
"six.moves.tkinter_constants":
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
"six.moves.tkinter_constants": (
|
|
81
|
+
"Tkconstants" if python_version < 0x300 else "tkinter.constants"
|
|
82
|
+
),
|
|
81
83
|
"six.moves.tkinter_dnd": "Tkdnd" if python_version < 0x300 else "tkinter.dnd",
|
|
82
|
-
"six.moves.tkinter_colorchooser":
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"six.moves.tkinter_commondialog":
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"six.moves.tkinter_tkfiledialog":
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
"six.moves.tkinter_colorchooser": (
|
|
85
|
+
"tkColorChooser" if python_version < 0x300 else "tkinter_colorchooser"
|
|
86
|
+
),
|
|
87
|
+
"six.moves.tkinter_commondialog": (
|
|
88
|
+
"tkCommonDialog" if python_version < 0x300 else "tkinter_commondialog"
|
|
89
|
+
),
|
|
90
|
+
"six.moves.tkinter_tkfiledialog": (
|
|
91
|
+
"tkFileDialog" if python_version < 0x300 else "tkinter.filedialog"
|
|
92
|
+
),
|
|
91
93
|
"six.moves.tkinter_font": "tkFont" if python_version < 0x300 else "tkinter.font",
|
|
92
|
-
"six.moves.tkinter_messagebox":
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"six.moves.tkinter_tksimpledialog":
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
"six.moves.tkinter_messagebox": (
|
|
95
|
+
"tkMessageBox" if python_version < 0x300 else "tkinter.messagebox"
|
|
96
|
+
),
|
|
97
|
+
"six.moves.tkinter_tksimpledialog": (
|
|
98
|
+
"tkSimpleDialog" if python_version < 0x300 else "tkinter_tksimpledialog"
|
|
99
|
+
),
|
|
98
100
|
"six.moves.urllib_parse": None if python_version < 0x300 else "urllib.parse",
|
|
99
101
|
"six.moves.urllib_error": None if python_version < 0x300 else "urllib.error",
|
|
100
|
-
"six.moves.urllib_robotparser":
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"six.moves.xmlrpc_client":
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"six.moves.xmlrpc_server":
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
"six.moves.urllib_robotparser": (
|
|
103
|
+
"robotparser" if python_version < 0x300 else "urllib.robotparser"
|
|
104
|
+
),
|
|
105
|
+
"six.moves.xmlrpc_client": (
|
|
106
|
+
"xmlrpclib" if python_version < 0x300 else "xmlrpc.client"
|
|
107
|
+
),
|
|
108
|
+
"six.moves.xmlrpc_server": (
|
|
109
|
+
"SimpleXMLRPCServer" if python_version < 0x300 else "xmlrpc.server"
|
|
110
|
+
),
|
|
109
111
|
"six.moves.winreg": "_winreg" if python_version < 0x300 else "winreg",
|
|
110
|
-
"six.moves.urllib.request":
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
"six.moves.urllib.request": (
|
|
113
|
+
"urllib2" if python_version < 0x300 else "urllib.request"
|
|
114
|
+
),
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
|
nuitka/importing/Importing.py
CHANGED
|
@@ -21,7 +21,6 @@ it's from the standard library, one can abuse the attribute ``__file__`` of the
|
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
import collections
|
|
26
25
|
import os
|
|
27
26
|
import sys
|
|
@@ -131,6 +130,38 @@ def makeModuleUsageAttempt(
|
|
|
131
130
|
)
|
|
132
131
|
|
|
133
132
|
|
|
133
|
+
def makeParentModuleUsagesAttempts(module_usage_attempt):
|
|
134
|
+
result = []
|
|
135
|
+
|
|
136
|
+
for parent_package_name in module_usage_attempt.module_name.getParentPackageNames():
|
|
137
|
+
(
|
|
138
|
+
_parent_package_name,
|
|
139
|
+
parent_module_filename,
|
|
140
|
+
parent_module_kind,
|
|
141
|
+
parent_module_finding,
|
|
142
|
+
) = locateModule(
|
|
143
|
+
module_name=parent_package_name,
|
|
144
|
+
parent_package=None,
|
|
145
|
+
level=0,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
result.append(
|
|
149
|
+
makeModuleUsageAttempt(
|
|
150
|
+
module_name=parent_package_name,
|
|
151
|
+
filename=parent_module_filename,
|
|
152
|
+
finding=parent_module_finding,
|
|
153
|
+
module_kind=parent_module_kind,
|
|
154
|
+
level=0,
|
|
155
|
+
source_ref=module_usage_attempt.source_ref,
|
|
156
|
+
reason="import path parent",
|
|
157
|
+
)
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
result.append(module_usage_attempt)
|
|
161
|
+
|
|
162
|
+
return tuple(result)
|
|
163
|
+
|
|
164
|
+
|
|
134
165
|
def addMainScriptDirectory(main_dir):
|
|
135
166
|
"""Initialize the main script directory.
|
|
136
167
|
|
|
@@ -920,6 +951,7 @@ _stdlib_module_raises = {
|
|
|
920
951
|
"_subprocess": False,
|
|
921
952
|
"_sha": False, # TODO: Not entirely clear if that's true
|
|
922
953
|
"_sha1": False,
|
|
954
|
+
"_sha2": False,
|
|
923
955
|
"_sha256": False,
|
|
924
956
|
"_sha3": False,
|
|
925
957
|
"_sha512": False,
|
|
@@ -983,6 +1015,7 @@ _stdlib_module_raises = {
|
|
|
983
1015
|
"zipimport": False,
|
|
984
1016
|
"zlib": False,
|
|
985
1017
|
"_ssl": True,
|
|
1018
|
+
"_xxinterpchannels": False,
|
|
986
1019
|
}
|
|
987
1020
|
|
|
988
1021
|
|
|
@@ -2,18 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
# We are not avoiding these in generated code at all
|
|
5
|
-
# pylint: disable=I0021,too-many-lines
|
|
6
|
-
# pylint: disable=I0021,
|
|
7
|
-
# pylint: disable=I0021,too-many-instance-attributes
|
|
8
|
-
# pylint: disable=I0021,too-many-return-statements
|
|
5
|
+
# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines
|
|
6
|
+
# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
"""Specialized attribute nodes
|
|
12
10
|
|
|
13
11
|
WARNING, this code is GENERATED. Modify the template AttributeNodeFixed.py.j2 instead!
|
|
14
12
|
|
|
15
|
-
spell-checker: ignore append
|
|
16
|
-
spell-checker: ignore
|
|
13
|
+
spell-checker: ignore __prepare__ append args autograph buffering capitalize casefold
|
|
14
|
+
spell-checker: ignore center chars clear closefd copy count decode default delete dist
|
|
15
|
+
spell-checker: ignore distribution_name encode encoding end endswith errors exit_code
|
|
16
|
+
spell-checker: ignore expandtabs experimental_attributes experimental_autograph_options
|
|
17
|
+
spell-checker: ignore experimental_compile experimental_follow_type_hints
|
|
18
|
+
spell-checker: ignore experimental_implements experimental_relax_shapes extend file
|
|
19
|
+
spell-checker: ignore fillchar find format format_map formatmap fromkeys func get group
|
|
20
|
+
spell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha
|
|
21
|
+
spell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable
|
|
22
|
+
spell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys
|
|
23
|
+
spell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower
|
|
24
|
+
spell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package
|
|
25
|
+
spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
|
|
26
|
+
spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
|
|
27
|
+
spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
|
|
28
|
+
spell-checker: ignore sort split splitlines start startswith stop strip sub suffix
|
|
29
|
+
spell-checker: ignore swapcase table tabsize title translate update upper use_errno
|
|
30
|
+
spell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width
|
|
31
|
+
spell-checker: ignore winmode zfill
|
|
17
32
|
"""
|
|
18
33
|
|
|
19
34
|
|
|
@@ -203,9 +203,11 @@ class StatementSpecialUnpackCheckFromIterated(
|
|
|
203
203
|
result = makeRaiseExceptionReplacementStatement(
|
|
204
204
|
statement=self,
|
|
205
205
|
exception_type="ValueError",
|
|
206
|
-
exception_value=
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
exception_value=(
|
|
207
|
+
"too many values to unpack"
|
|
208
|
+
if python_version < 0x300
|
|
209
|
+
else "too many values to unpack (expected %d)" % self.count
|
|
210
|
+
),
|
|
209
211
|
)
|
|
210
212
|
|
|
211
213
|
trace_collection.onExceptionRaiseExit(TypeError)
|
|
@@ -2,18 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
# We are not avoiding these in generated code at all
|
|
5
|
-
# pylint: disable=I0021,too-many-lines
|
|
6
|
-
# pylint: disable=I0021,
|
|
7
|
-
# pylint: disable=I0021,too-many-instance-attributes
|
|
8
|
-
# pylint: disable=I0021,too-many-return-statements
|
|
5
|
+
# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines
|
|
6
|
+
# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
"""Specialized attribute nodes
|
|
12
10
|
|
|
13
11
|
WARNING, this code is GENERATED. Modify the template BuiltinOperationNodeBases.py.j2 instead!
|
|
14
12
|
|
|
15
|
-
spell-checker: ignore append
|
|
16
|
-
spell-checker: ignore
|
|
13
|
+
spell-checker: ignore __prepare__ append args autograph buffering capitalize casefold
|
|
14
|
+
spell-checker: ignore center chars clear closefd copy count decode default delete dist
|
|
15
|
+
spell-checker: ignore distribution_name encode encoding end endswith errors exit_code
|
|
16
|
+
spell-checker: ignore expandtabs experimental_attributes experimental_autograph_options
|
|
17
|
+
spell-checker: ignore experimental_compile experimental_follow_type_hints
|
|
18
|
+
spell-checker: ignore experimental_implements experimental_relax_shapes extend file
|
|
19
|
+
spell-checker: ignore fillchar find format format_map formatmap fromkeys func get group
|
|
20
|
+
spell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha
|
|
21
|
+
spell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable
|
|
22
|
+
spell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys
|
|
23
|
+
spell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower
|
|
24
|
+
spell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package
|
|
25
|
+
spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
|
|
26
|
+
spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
|
|
27
|
+
spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
|
|
28
|
+
spell-checker: ignore sort split splitlines start startswith stop strip sub suffix
|
|
29
|
+
spell-checker: ignore swapcase table tabsize title translate update upper use_errno
|
|
30
|
+
spell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width
|
|
31
|
+
spell-checker: ignore winmode zfill
|
|
17
32
|
"""
|
|
18
33
|
|
|
19
34
|
|
nuitka/nodes/BuiltinRefNodes.py
CHANGED
|
@@ -10,7 +10,6 @@ to variables only ever read.
|
|
|
10
10
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
from nuitka.Builtins import (
|
|
15
14
|
builtin_anon_names,
|
|
16
15
|
builtin_exception_names,
|
|
@@ -26,6 +25,7 @@ from .ConstantRefNodes import makeConstantRefNode
|
|
|
26
25
|
from .ExceptionNodes import (
|
|
27
26
|
ExpressionBuiltinMakeException,
|
|
28
27
|
ExpressionBuiltinMakeExceptionImportError,
|
|
28
|
+
ExpressionBuiltinMakeExceptionModuleNotFoundError,
|
|
29
29
|
)
|
|
30
30
|
from .ExpressionBases import CompileTimeConstantExpressionBase
|
|
31
31
|
from .shapes.BuiltinTypeShapes import tshape_exception_class
|
|
@@ -235,6 +235,13 @@ class ExpressionBuiltinExceptionRef(ExpressionBuiltinRefBase):
|
|
|
235
235
|
path=path,
|
|
236
236
|
source_ref=source_ref,
|
|
237
237
|
)
|
|
238
|
+
elif exception_name == "ModuleNotFoundError" and python_version >= 0x360:
|
|
239
|
+
return ExpressionBuiltinMakeExceptionModuleNotFoundError(
|
|
240
|
+
args=args,
|
|
241
|
+
name=name,
|
|
242
|
+
path=path,
|
|
243
|
+
source_ref=source_ref,
|
|
244
|
+
)
|
|
238
245
|
else:
|
|
239
246
|
# We expect to only get the star arguments for these.
|
|
240
247
|
assert name is None
|
nuitka/nodes/BuiltinVarsNodes.py
CHANGED
|
@@ -7,7 +7,6 @@ Not used much, esp. not in the form with arguments. Maybe used in some meta prog
|
|
|
7
7
|
and hopefully can be predicted, because at run time, it is hard to support.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
from .ChildrenHavingMixins import ChildHavingSourceMixin
|
|
12
11
|
from .ExpressionBases import ExpressionBase
|
|
13
12
|
|