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/containers/OrderedSets.py
CHANGED
|
@@ -1,15 +1,115 @@
|
|
|
1
1
|
""" This module is only an abstraction of OrderedSet which is not present in
|
|
2
2
|
Python at all.
|
|
3
3
|
|
|
4
|
+
spell-checker: ignore orderedset,orderedsets
|
|
5
|
+
|
|
4
6
|
"""
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import os
|
|
9
|
+
import subprocess
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
from nuitka.PythonVersions import python_version
|
|
13
|
+
from nuitka.utils.InlineCopies import getDownloadCopyFolder
|
|
14
|
+
|
|
15
|
+
recommended_orderedset_package_name, recommended_orderedset_module_name = (
|
|
16
|
+
("ordered-set", "ordered_set")
|
|
17
|
+
if python_version >= 0x370
|
|
18
|
+
else ("orderedset", "orderedsets")
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _tryImportOrderedSet():
|
|
10
23
|
try:
|
|
11
|
-
from
|
|
24
|
+
from orderedset import OrderedSet as result
|
|
12
25
|
except ImportError:
|
|
26
|
+
try:
|
|
27
|
+
from ordered_set import OrderedSet as result
|
|
28
|
+
except ImportError:
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
return result
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
OrderedSet = _tryImportOrderedSet()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _findDownloadSitePackagesDir(download_folder):
|
|
38
|
+
for root, dirnames, _filenames in os.walk(download_folder):
|
|
39
|
+
found_candidate = None
|
|
40
|
+
for candidate in ("site-packages", "dist-packages", "vendor-packages"):
|
|
41
|
+
if candidate in dirnames:
|
|
42
|
+
# Unclear which one to use.
|
|
43
|
+
if found_candidate is not None:
|
|
44
|
+
return
|
|
45
|
+
|
|
46
|
+
found_candidate = candidate
|
|
47
|
+
|
|
48
|
+
if found_candidate:
|
|
49
|
+
return os.path.join(root, found_candidate)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def tryDownloadPackageName(package_name, module_name, package_version):
|
|
53
|
+
download_folder = getDownloadCopyFolder()
|
|
54
|
+
|
|
55
|
+
site_packages_folder = _findDownloadSitePackagesDir(download_folder)
|
|
56
|
+
|
|
57
|
+
if site_packages_folder is not None:
|
|
58
|
+
candidate = os.path.join(site_packages_folder, module_name)
|
|
59
|
+
|
|
60
|
+
if os.path.exists(candidate):
|
|
61
|
+
return site_packages_folder
|
|
62
|
+
|
|
63
|
+
if os.getenv("NUITKA_ASSUME_YES_FOR_DOWNLOADS") in ("1", "true", "yes"):
|
|
64
|
+
if package_version is not None:
|
|
65
|
+
package_spec = "%s==%s" % (package_name, package_version)
|
|
66
|
+
else:
|
|
67
|
+
package_spec = package_name
|
|
68
|
+
|
|
69
|
+
exit_code = subprocess.call(
|
|
70
|
+
[
|
|
71
|
+
sys.executable,
|
|
72
|
+
"-m",
|
|
73
|
+
"pip",
|
|
74
|
+
"install",
|
|
75
|
+
"--root",
|
|
76
|
+
download_folder,
|
|
77
|
+
package_spec,
|
|
78
|
+
],
|
|
79
|
+
shell=False,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
if exit_code != 0:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if site_packages_folder is None:
|
|
86
|
+
site_packages_folder = _findDownloadSitePackagesDir(download_folder)
|
|
87
|
+
|
|
88
|
+
if site_packages_folder is not None:
|
|
89
|
+
candidate = os.path.join(site_packages_folder, module_name)
|
|
90
|
+
|
|
91
|
+
if os.path.exists(candidate):
|
|
92
|
+
return site_packages_folder
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _tryDownloadOrderedSet():
|
|
96
|
+
return tryDownloadPackageName(
|
|
97
|
+
recommended_orderedset_package_name,
|
|
98
|
+
recommended_orderedset_module_name,
|
|
99
|
+
package_version=None,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if OrderedSet is None:
|
|
104
|
+
downloaded_pip = _tryDownloadOrderedSet()
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
sys.path.insert(0, downloaded_pip)
|
|
108
|
+
OrderedSet = _tryImportOrderedSet()
|
|
109
|
+
finally:
|
|
110
|
+
del sys.path[0]
|
|
111
|
+
|
|
112
|
+
if OrderedSet is None:
|
|
13
113
|
from .OrderedSetsFallback import OrderedSet
|
|
14
114
|
|
|
15
115
|
|
nuitka/distutils/Build.py
CHANGED
|
@@ -23,6 +23,20 @@ class NuitkaBuildMetaBackend(setuptools.build_meta._BuildMetaBackend):
|
|
|
23
23
|
def build_wheel(
|
|
24
24
|
self, wheel_directory, config_settings=None, metadata_directory=None
|
|
25
25
|
):
|
|
26
|
+
# Allow falling back to setuptools when the `build_with_nuitka` configuration setting is set to true.
|
|
27
|
+
if config_settings:
|
|
28
|
+
build_with_nuitka = config_settings.pop("build_with_nuitka", "true").lower()
|
|
29
|
+
|
|
30
|
+
if build_with_nuitka not in ("true", "false"):
|
|
31
|
+
raise ValueError(
|
|
32
|
+
"When passing the 'build_with_nuitka' setting, it must either be 'true' or 'false'."
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
if build_with_nuitka == "false":
|
|
36
|
+
return super().build_wheel(
|
|
37
|
+
wheel_directory, config_settings, metadata_directory
|
|
38
|
+
)
|
|
39
|
+
|
|
26
40
|
os.environ["NUITKA_TOML_FILE"] = os.path.join(os.getcwd(), "pyproject.toml")
|
|
27
41
|
|
|
28
42
|
with suppress_known_deprecation():
|
|
@@ -21,6 +21,10 @@ from nuitka.importing.Importing import (
|
|
|
21
21
|
locateModule,
|
|
22
22
|
)
|
|
23
23
|
from nuitka.PythonVersions import python_version
|
|
24
|
+
from nuitka.reports.CompilationReportReader import (
|
|
25
|
+
getEmbeddedDataFilenames,
|
|
26
|
+
parseCompilationReport,
|
|
27
|
+
)
|
|
24
28
|
from nuitka.Tracing import wheel_logger
|
|
25
29
|
from nuitka.utils.Execution import check_call
|
|
26
30
|
from nuitka.utils.FileOperations import deleteFile, getFileList, renameFile
|
|
@@ -31,6 +35,7 @@ def setupNuitkaDistutilsCommands(dist, keyword, value):
|
|
|
31
35
|
# If the user project setup.py includes the key "build_with_nuitka=True" all
|
|
32
36
|
# build operations (build, bdist_wheel, install etc) will run via Nuitka.
|
|
33
37
|
# pylint: disable=unused-argument
|
|
38
|
+
# spell-checker: ignore cmdclass
|
|
34
39
|
|
|
35
40
|
if not value:
|
|
36
41
|
return
|
|
@@ -213,6 +218,9 @@ class build(distutils.command.build.build):
|
|
|
213
218
|
|
|
214
219
|
@staticmethod
|
|
215
220
|
def _parseOptionsEntry(option, value):
|
|
221
|
+
if option == "build_with_nuitka":
|
|
222
|
+
return
|
|
223
|
+
|
|
216
224
|
option = "--" + option.lstrip("-")
|
|
217
225
|
|
|
218
226
|
if type(value) is tuple and len(value) == 2 and value[0] == "setup.py":
|
|
@@ -231,7 +239,8 @@ class build(distutils.command.build.build):
|
|
|
231
239
|
yield "%s=%s" % (option, value)
|
|
232
240
|
|
|
233
241
|
def _build(self, build_lib):
|
|
234
|
-
# High complexity,
|
|
242
|
+
# High complexity,
|
|
243
|
+
# pylint: disable=too-many-branches,too-many-locals,too-many-statements
|
|
235
244
|
|
|
236
245
|
old_dir = os.getcwd()
|
|
237
246
|
|
|
@@ -249,6 +258,8 @@ class build(distutils.command.build.build):
|
|
|
249
258
|
# Search in the build directory preferably.
|
|
250
259
|
addMainScriptDirectory(main_package_dir)
|
|
251
260
|
|
|
261
|
+
embedded_data_files = set()
|
|
262
|
+
|
|
252
263
|
for is_package, module_name in self._findBuildTasks():
|
|
253
264
|
# Nuitka wants the main package by filename, probably we should stop
|
|
254
265
|
# needing that.
|
|
@@ -276,7 +287,12 @@ class build(distutils.command.build.build):
|
|
|
276
287
|
"--enable-plugin=pylint-warnings",
|
|
277
288
|
"--output-dir=%s" % output_dir,
|
|
278
289
|
"--nofollow-import-to=*.tests",
|
|
290
|
+
"--nowarn-mnemonic=compiled-package-hidden-by-package",
|
|
279
291
|
"--remove-output",
|
|
292
|
+
# Note: For when we are debugging module mode of Nuitka, not for general use.
|
|
293
|
+
# "--debug",
|
|
294
|
+
# "--trace",
|
|
295
|
+
# "--python-flag=-v"
|
|
280
296
|
]
|
|
281
297
|
|
|
282
298
|
if package_name is not None:
|
|
@@ -319,12 +335,25 @@ class build(distutils.command.build.build):
|
|
|
319
335
|
):
|
|
320
336
|
command.extend(self._parseOptionsEntry(option, value))
|
|
321
337
|
|
|
338
|
+
report_filename = None
|
|
339
|
+
|
|
322
340
|
# Process any extra options from setuptools
|
|
323
341
|
if "nuitka" in self.distribution.command_options:
|
|
324
342
|
for option, value in self.distribution.command_options[
|
|
325
343
|
"nuitka"
|
|
326
344
|
].items():
|
|
327
|
-
|
|
345
|
+
for option in self._parseOptionsEntry(option, value):
|
|
346
|
+
command.append(option)
|
|
347
|
+
|
|
348
|
+
if option.startswith("--report="):
|
|
349
|
+
report_filename = option.split("=", 1)[1]
|
|
350
|
+
|
|
351
|
+
if report_filename is None:
|
|
352
|
+
command.append("--report=compilation-report.xml")
|
|
353
|
+
report_filename = "compilation-report.xml"
|
|
354
|
+
delete_report = True
|
|
355
|
+
else:
|
|
356
|
+
delete_report = False
|
|
328
357
|
|
|
329
358
|
command.append(main_filename)
|
|
330
359
|
|
|
@@ -337,17 +366,26 @@ class build(distutils.command.build.build):
|
|
|
337
366
|
"Finished compilation of '%s'." % module_name.asString(), style="green"
|
|
338
367
|
)
|
|
339
368
|
|
|
340
|
-
|
|
369
|
+
report = parseCompilationReport(report_filename)
|
|
341
370
|
|
|
342
|
-
|
|
371
|
+
embedded_data_files.update(getEmbeddedDataFilenames(report))
|
|
372
|
+
|
|
373
|
+
if delete_report:
|
|
374
|
+
os.unlink(report_filename)
|
|
375
|
+
|
|
376
|
+
self.build_lib = build_lib
|
|
343
377
|
|
|
344
378
|
# Remove Python code from build folder, that's our job now.
|
|
345
|
-
for
|
|
346
|
-
|
|
347
|
-
|
|
379
|
+
for filename in getFileList(
|
|
380
|
+
build_lib, only_suffixes=(".py", ".pyw", ".pyc", ".pyo")
|
|
381
|
+
):
|
|
382
|
+
os.unlink(filename)
|
|
348
383
|
|
|
349
|
-
|
|
350
|
-
|
|
384
|
+
# Remove data files from build folder, that's our job now too
|
|
385
|
+
for filename in embedded_data_files:
|
|
386
|
+
os.unlink(filename)
|
|
387
|
+
|
|
388
|
+
os.chdir(old_dir)
|
|
351
389
|
|
|
352
390
|
|
|
353
391
|
# Required by distutils, used as command name, pylint: disable=invalid-name
|
|
@@ -355,7 +393,8 @@ class install(distutils.command.install.install):
|
|
|
355
393
|
# pylint: disable=attribute-defined-outside-init
|
|
356
394
|
def finalize_options(self):
|
|
357
395
|
distutils.command.install.install.finalize_options(self)
|
|
358
|
-
# Ensure the purelib folder is not used
|
|
396
|
+
# Ensure the "purelib" folder is not used
|
|
397
|
+
# spell-checker: ignore purelib,platlib
|
|
359
398
|
self.install_lib = self.install_platlib
|
|
360
399
|
|
|
361
400
|
|
|
@@ -376,6 +415,7 @@ class bdist_nuitka(wheel.bdist_wheel.bdist_wheel):
|
|
|
376
415
|
# Force module to use correct platform in name
|
|
377
416
|
self.root_is_pure = False
|
|
378
417
|
|
|
418
|
+
# virtual method name, spell-checker: ignore wheelfile
|
|
379
419
|
def write_wheelfile(self, wheelfile_base, generator=None):
|
|
380
420
|
if generator is None:
|
|
381
421
|
from nuitka.Version import getNuitkaVersion
|
|
@@ -14,9 +14,9 @@ from nuitka.tree import Operations
|
|
|
14
14
|
from .FinalizeMarkups import FinalizeMarkups
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def prepareCodeGeneration(
|
|
18
|
-
visitor = FinalizeMarkups()
|
|
19
|
-
Operations.visitTree(
|
|
17
|
+
def prepareCodeGeneration(module):
|
|
18
|
+
visitor = FinalizeMarkups(module)
|
|
19
|
+
Operations.visitTree(module, visitor)
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -23,6 +23,9 @@ from nuitka.tree.Operations import VisitorNoopMixin
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class FinalizeMarkups(VisitorNoopMixin):
|
|
26
|
+
def __init__(self, module):
|
|
27
|
+
self.module = module
|
|
28
|
+
|
|
26
29
|
def onEnterNode(self, node):
|
|
27
30
|
try:
|
|
28
31
|
self._onEnterNode(node)
|
|
@@ -37,26 +40,17 @@ class FinalizeMarkups(VisitorNoopMixin):
|
|
|
37
40
|
# This has many different things it deals with, so there need to be a
|
|
38
41
|
# lot of branches and statements, pylint: disable=too-many-branches
|
|
39
42
|
|
|
40
|
-
# Also all self specific things have been done on the outside,
|
|
41
|
-
# pylint: disable=no-self-use
|
|
42
43
|
if node.isStatementReturn() or node.isStatementGeneratorReturn():
|
|
43
|
-
search = node
|
|
44
|
-
|
|
45
|
-
in_tried_block = False
|
|
46
|
-
|
|
47
44
|
# Search up to the containing function, and check for a try/finally
|
|
48
45
|
# containing the "return" statement.
|
|
49
|
-
search =
|
|
46
|
+
search = node.getParentReturnConsumer()
|
|
50
47
|
|
|
51
48
|
if (
|
|
52
49
|
search.isExpressionGeneratorObjectBody()
|
|
53
50
|
or search.isExpressionCoroutineObjectBody()
|
|
54
51
|
or search.isExpressionAsyncgenObjectBody()
|
|
55
52
|
):
|
|
56
|
-
|
|
57
|
-
search.markAsNeedsGeneratorReturnHandling(2)
|
|
58
|
-
else:
|
|
59
|
-
search.markAsNeedsGeneratorReturnHandling(1)
|
|
53
|
+
search.markAsNeedsGeneratorReturnHandling()
|
|
60
54
|
|
|
61
55
|
if node.isExpressionFunctionCreation():
|
|
62
56
|
if (
|
|
@@ -72,11 +66,10 @@ class FinalizeMarkups(VisitorNoopMixin):
|
|
|
72
66
|
function_body = node.getFunctionBody()
|
|
73
67
|
parent_module = function_body.getParentModule()
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
if node_module is not parent_module:
|
|
69
|
+
if self.module is not parent_module:
|
|
77
70
|
function_body.markAsCrossModuleUsed()
|
|
78
71
|
|
|
79
|
-
|
|
72
|
+
self.module.addCrossUsedFunction(function_body)
|
|
80
73
|
|
|
81
74
|
if node.isStatementAssignmentVariable():
|
|
82
75
|
target_var = node.getVariable()
|
|
@@ -93,6 +86,9 @@ class FinalizeMarkups(VisitorNoopMixin):
|
|
|
93
86
|
# TODO: This might be bad.
|
|
94
87
|
assign_source.removeMarkAsInplaceSuspect()
|
|
95
88
|
|
|
89
|
+
if target_var.isModuleVariable():
|
|
90
|
+
pass
|
|
91
|
+
|
|
96
92
|
if python_version < 0x300 and node.isStatementPublishException():
|
|
97
93
|
node.getParentStatementsFrame().markAsFrameExceptionPreserving()
|
|
98
94
|
|
nuitka/freezer/DependsExe.py
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
""" Interface to depends.exe on Windows.
|
|
5
5
|
|
|
6
|
-
We use depends.exe to investigate needed DLLs of Python DLLs.
|
|
6
|
+
We use "depends.exe" to investigate needed DLLs of Python DLLs.
|
|
7
7
|
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
import os
|
|
11
11
|
|
|
12
|
+
# pylint: disable=I0021,import-error,redefined-builtin
|
|
12
13
|
from nuitka.__past__ import WindowsError
|
|
13
14
|
from nuitka.containers.OrderedSets import OrderedSet
|
|
14
15
|
from nuitka.Options import assumeYesForDownloads
|
|
@@ -19,6 +20,7 @@ from nuitka.utils.FileOperations import (
|
|
|
19
20
|
deleteFile,
|
|
20
21
|
getExternalUsePath,
|
|
21
22
|
getFileContentByLine,
|
|
23
|
+
getNormalizedPath,
|
|
22
24
|
getWindowsLongPathName,
|
|
23
25
|
isFilenameBelowPath,
|
|
24
26
|
isFilesystemEncodable,
|
|
@@ -66,6 +68,7 @@ def _attemptToFindNotFoundDLL(dll_filename):
|
|
|
66
68
|
if dll_filename in currently_loaded_dlls:
|
|
67
69
|
return currently_loaded_dlls[dll_filename]
|
|
68
70
|
|
|
71
|
+
# Lets try the Windows system, spell-checker: ignore systemroot
|
|
69
72
|
dll_filename = os.path.join(
|
|
70
73
|
os.environ["SYSTEMROOT"],
|
|
71
74
|
"SysWOW64" if getArchitecture() == "x86_64" else "System32",
|
|
@@ -159,7 +162,7 @@ def _parseDependsExeOutput2(lines):
|
|
|
159
162
|
|
|
160
163
|
assert os.path.isfile(dll_filename), (dll_filename, line)
|
|
161
164
|
|
|
162
|
-
result.add(os.path.normcase(
|
|
165
|
+
result.add(getNormalizedPath(os.path.normcase(dll_filename)))
|
|
163
166
|
|
|
164
167
|
return result
|
|
165
168
|
|
|
@@ -57,7 +57,12 @@ def _detectPythonRpaths():
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
def detectBinaryPathDLLsMacOS(
|
|
60
|
-
original_dir,
|
|
60
|
+
original_dir,
|
|
61
|
+
binary_filename,
|
|
62
|
+
package_name,
|
|
63
|
+
keep_unresolved,
|
|
64
|
+
recursive,
|
|
65
|
+
recursive_dlls=None,
|
|
61
66
|
):
|
|
62
67
|
assert os.path.exists(binary_filename), binary_filename
|
|
63
68
|
|
|
@@ -91,13 +96,25 @@ def detectBinaryPathDLLsMacOS(
|
|
|
91
96
|
if recursive:
|
|
92
97
|
merged_result = OrderedDict(resolved_result)
|
|
93
98
|
|
|
99
|
+
# For recursive DLL detection, cycle may exist, so we keep track of what
|
|
100
|
+
# was seen so far.
|
|
101
|
+
if recursive_dlls is None:
|
|
102
|
+
recursive_dlls = set([binary_filename])
|
|
103
|
+
else:
|
|
104
|
+
recursive_dlls = set(recursive_dlls)
|
|
105
|
+
recursive_dlls.add(binary_filename)
|
|
106
|
+
|
|
94
107
|
for sub_dll_filename in resolved_result:
|
|
108
|
+
if sub_dll_filename in recursive_dlls:
|
|
109
|
+
continue
|
|
110
|
+
|
|
95
111
|
_, sub_result = detectBinaryPathDLLsMacOS(
|
|
96
112
|
original_dir=os.path.dirname(sub_dll_filename),
|
|
97
113
|
binary_filename=sub_dll_filename,
|
|
98
114
|
package_name=package_name,
|
|
99
115
|
keep_unresolved=True,
|
|
100
116
|
recursive=True,
|
|
117
|
+
recursive_dlls=recursive_dlls,
|
|
101
118
|
)
|
|
102
119
|
|
|
103
120
|
merged_result.update(sub_result)
|
|
@@ -43,6 +43,7 @@ def detectBinaryPathDLLsWin32(
|
|
|
43
43
|
original_dir,
|
|
44
44
|
binary_filename,
|
|
45
45
|
package_name,
|
|
46
|
+
use_path,
|
|
46
47
|
use_cache,
|
|
47
48
|
update_cache,
|
|
48
49
|
):
|
|
@@ -55,6 +56,7 @@ def detectBinaryPathDLLsWin32(
|
|
|
55
56
|
original_dir=original_dir,
|
|
56
57
|
binary_filename=binary_filename,
|
|
57
58
|
package_name=package_name,
|
|
59
|
+
use_path=use_path,
|
|
58
60
|
)
|
|
59
61
|
|
|
60
62
|
if use_cache:
|
|
@@ -79,7 +81,9 @@ def detectBinaryPathDLLsWin32(
|
|
|
79
81
|
if isShowProgress():
|
|
80
82
|
inclusion_logger.info("Analyzing dependencies of '%s'." % binary_filename)
|
|
81
83
|
|
|
82
|
-
scan_dirs = _getScanDirectories(
|
|
84
|
+
scan_dirs = _getScanDirectories(
|
|
85
|
+
package_name=package_name, original_dir=original_dir, use_path=use_path
|
|
86
|
+
)
|
|
83
87
|
|
|
84
88
|
result = detectDLLsWithDependencyWalker(
|
|
85
89
|
binary_filename=binary_filename, source_dir=source_dir, scan_dirs=scan_dirs
|
|
@@ -91,7 +95,7 @@ def detectBinaryPathDLLsWin32(
|
|
|
91
95
|
return result
|
|
92
96
|
|
|
93
97
|
|
|
94
|
-
def _getScanDirectories(package_name, original_dir):
|
|
98
|
+
def _getScanDirectories(package_name, original_dir, use_path):
|
|
95
99
|
# TODO: Move PyWin32 specific stuff to yaml dll section
|
|
96
100
|
# pylint: disable=too-many-branches
|
|
97
101
|
|
|
@@ -120,18 +124,23 @@ def _getScanDirectories(package_name, original_dir):
|
|
|
120
124
|
if py_win32_dir is not None:
|
|
121
125
|
scan_dirs.append(py_win32_dir)
|
|
122
126
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
if use_path:
|
|
128
|
+
for path_dir in os.environ["PATH"].split(";"):
|
|
129
|
+
if not os.path.isdir(path_dir):
|
|
130
|
+
continue
|
|
126
131
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
if areSamePaths(path_dir, os.path.join(os.environ["SYSTEMROOT"])):
|
|
133
|
+
continue
|
|
134
|
+
if areSamePaths(
|
|
135
|
+
path_dir, os.path.join(os.environ["SYSTEMROOT"], "System32")
|
|
136
|
+
):
|
|
137
|
+
continue
|
|
138
|
+
if areSamePaths(
|
|
139
|
+
path_dir, os.path.join(os.environ["SYSTEMROOT"], "SysWOW64")
|
|
140
|
+
):
|
|
141
|
+
continue
|
|
133
142
|
|
|
134
|
-
|
|
143
|
+
scan_dirs.append(path_dir)
|
|
135
144
|
|
|
136
145
|
result = []
|
|
137
146
|
|
|
@@ -161,6 +170,7 @@ def _getCacheFilename(
|
|
|
161
170
|
original_dir,
|
|
162
171
|
binary_filename,
|
|
163
172
|
package_name,
|
|
173
|
+
use_path,
|
|
164
174
|
):
|
|
165
175
|
original_filename = os.path.join(original_dir, os.path.basename(binary_filename))
|
|
166
176
|
original_filename = os.path.normcase(original_filename)
|
|
@@ -192,6 +202,10 @@ def _getCacheFilename(
|
|
|
192
202
|
# Take Nuitka version into account as well, ought to catch code changes.
|
|
193
203
|
hash_value.updateFromValues(version_string)
|
|
194
204
|
|
|
205
|
+
# Using PATH or not, should also be considered different.
|
|
206
|
+
if use_path:
|
|
207
|
+
hash_value.updateFromValues(os.getenv("PATH"))
|
|
208
|
+
|
|
195
209
|
cache_dir = os.path.join(getCacheDir("library_dependencies"), dependency_tool)
|
|
196
210
|
makePath(cache_dir)
|
|
197
211
|
|
|
@@ -137,6 +137,12 @@ print("\\n".join(sorted(
|
|
|
137
137
|
"_collections_abc.py",
|
|
138
138
|
"_collections_abc.pyc",
|
|
139
139
|
):
|
|
140
|
+
# Note: This was only useful for 3.13.0, and 3.13.1 already
|
|
141
|
+
# didn't need it anymore. So precise version check for a major
|
|
142
|
+
# version is correct here.
|
|
143
|
+
if python_version == 0x3D0:
|
|
144
|
+
detections.append((module_name, 2, "sourcefile", filename))
|
|
145
|
+
|
|
140
146
|
module_name = ModuleName("_collections_abc")
|
|
141
147
|
|
|
142
148
|
if filename.endswith(".py"):
|
|
@@ -19,6 +19,7 @@ from nuitka.Options import (
|
|
|
19
19
|
getShallIncludeDataFiles,
|
|
20
20
|
getShallIncludeExternallyDataFilePatterns,
|
|
21
21
|
getShallIncludePackageData,
|
|
22
|
+
getShallIncludeRawDirs,
|
|
22
23
|
getShallNotIncludeDataFilePatterns,
|
|
23
24
|
isAcceleratedMode,
|
|
24
25
|
isOnefileMode,
|
|
@@ -26,7 +27,7 @@ from nuitka.Options import (
|
|
|
26
27
|
shallMakeModule,
|
|
27
28
|
)
|
|
28
29
|
from nuitka.OutputDirectories import getStandaloneDirectoryPath
|
|
29
|
-
from nuitka.Tracing import general, options_logger
|
|
30
|
+
from nuitka.Tracing import general, inclusion_logger, options_logger
|
|
30
31
|
from nuitka.utils.FileOperations import (
|
|
31
32
|
areSamePaths,
|
|
32
33
|
containsPathElements,
|
|
@@ -167,11 +168,12 @@ def makeIncludedDataFile(source_path, dest_path, reason, tracer, tags):
|
|
|
167
168
|
# In accelerated mode, data files can be everywhere, but they cannot
|
|
168
169
|
# change place.
|
|
169
170
|
if isAcceleratedMode():
|
|
170
|
-
if "
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
if "copy" in tags:
|
|
172
|
+
if "package_data" not in tags and not areSamePaths(source_path, dest_path):
|
|
173
|
+
tracer.sysexit(
|
|
174
|
+
"Error, cannot change paths for data files in accelerated mode from '%s' to '%s'."
|
|
175
|
+
% (source_path, dest_path)
|
|
176
|
+
)
|
|
175
177
|
else:
|
|
176
178
|
inside = True
|
|
177
179
|
if not isRelativePath(dest_path):
|
|
@@ -334,6 +336,15 @@ def addIncludedDataFile(included_datafile):
|
|
|
334
336
|
):
|
|
335
337
|
included_datafile.tags.add("external")
|
|
336
338
|
|
|
339
|
+
dest_path = getOutputPath(included_datafile.dest_path)
|
|
340
|
+
|
|
341
|
+
if areSamePaths(dest_path, included_datafile.source_path):
|
|
342
|
+
inclusion_logger.sysexit(
|
|
343
|
+
"""\
|
|
344
|
+
Error, when asking to copy files external data, you cannot output to\
|
|
345
|
+
same directory and need to use '--output-dir' option."""
|
|
346
|
+
)
|
|
347
|
+
|
|
337
348
|
_included_data_files.append(included_datafile)
|
|
338
349
|
|
|
339
350
|
|
|
@@ -342,6 +353,8 @@ def getIncludedDataFiles():
|
|
|
342
353
|
|
|
343
354
|
|
|
344
355
|
def _addIncludedDataFilesFromFileOptions():
|
|
356
|
+
# Many different option variants, pylint: disable=too-many-branches
|
|
357
|
+
|
|
345
358
|
for pattern, source_path, dest_path, arg in getShallIncludeDataFiles():
|
|
346
359
|
filenames = resolveShellPatternToFilenames(pattern)
|
|
347
360
|
|
|
@@ -393,6 +406,24 @@ def _addIncludedDataFilesFromFileOptions():
|
|
|
393
406
|
if count == 0:
|
|
394
407
|
options_logger.warning("No data files in directory '%s.'" % source_path)
|
|
395
408
|
|
|
409
|
+
for source_path, dest_path in getShallIncludeRawDirs():
|
|
410
|
+
count = 0
|
|
411
|
+
|
|
412
|
+
for included_datafile in makeIncludedDataDirectory(
|
|
413
|
+
source_path=source_path,
|
|
414
|
+
dest_path=os.path.normpath(dest_path),
|
|
415
|
+
reason="specified raw dir '%s' on command line" % source_path,
|
|
416
|
+
tracer=options_logger,
|
|
417
|
+
tags="user",
|
|
418
|
+
raw=True,
|
|
419
|
+
):
|
|
420
|
+
yield included_datafile
|
|
421
|
+
|
|
422
|
+
count += 1
|
|
423
|
+
|
|
424
|
+
if count == 0:
|
|
425
|
+
options_logger.warning("No files in raw directory '%s.'" % source_path)
|
|
426
|
+
|
|
396
427
|
|
|
397
428
|
def addIncludedDataFilesFromFileOptions():
|
|
398
429
|
"""Early data files, from user options that work with file system."""
|
nuitka/freezer/Onefile.py
CHANGED
|
@@ -244,6 +244,7 @@ def packDistFolderToOnefileBootstrap(onefile_output_filename, dist_dir):
|
|
|
244
244
|
|
|
245
245
|
if isMacOS():
|
|
246
246
|
addMacOSCodeSignature(filenames=[onefile_output_filename])
|
|
247
|
+
assert payload_used_in_build
|
|
247
248
|
|
|
248
249
|
if not payload_used_in_build:
|
|
249
250
|
runOnefileCompressor(
|