Nuitka-winsvc 2.5.6__cp311-cp311-win_amd64.whl → 2.6.5__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.5.6.data → Nuitka_winsvc-2.6.5.data}/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.5.6.data → Nuitka_winsvc-2.6.5.data}/scripts/nuitka.cmd +1 -1
- {Nuitka_winsvc-2.5.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/METADATA +36 -24
- Nuitka_winsvc-2.6.5.dist-info/RECORD +992 -0
- {Nuitka_winsvc-2.5.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +1 -1
- nuitka/BytecodeCaching.py +15 -4
- nuitka/Bytecodes.py +1 -1
- nuitka/CacheCleanup.py +1 -1
- nuitka/Constants.py +1 -1
- nuitka/Errors.py +1 -1
- nuitka/HardImportRegistry.py +1 -1
- nuitka/MainControl.py +93 -94
- nuitka/ModuleRegistry.py +19 -4
- nuitka/OptionParsing.py +86 -17
- nuitka/Options.py +230 -106
- nuitka/OutputDirectories.py +5 -3
- nuitka/PostProcessing.py +76 -27
- nuitka/Progress.py +1 -1
- nuitka/PythonFlavors.py +24 -3
- nuitka/PythonOperators.py +1 -1
- nuitka/PythonVersions.py +8 -4
- nuitka/Serialization.py +1 -1
- nuitka/SourceCodeReferences.py +1 -1
- nuitka/Tracing.py +2 -1
- nuitka/TreeXML.py +1 -1
- nuitka/Variables.py +1 -1
- nuitka/Version.py +2 -2
- nuitka/__init__.py +1 -1
- nuitka/__main__.py +4 -1
- nuitka/__past__.py +1 -1
- nuitka/build/Backend.scons +44 -66
- nuitka/build/CCompilerVersion.scons +2 -1
- nuitka/build/DataComposerInterface.py +2 -1
- nuitka/build/Offsets.scons +644 -0
- nuitka/build/Onefile.scons +5 -13
- nuitka/build/SconsCaching.py +9 -7
- nuitka/build/SconsCompilerSettings.py +57 -35
- nuitka/build/SconsHacks.py +3 -3
- nuitka/build/SconsInterface.py +86 -58
- nuitka/build/SconsProgress.py +12 -5
- nuitka/build/SconsSpawn.py +3 -3
- nuitka/build/SconsUtils.py +20 -1
- nuitka/build/__init__.py +1 -1
- nuitka/build/include/nuitka/allocator.h +3 -1
- nuitka/build/include/nuitka/builtins.h +1 -1
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/checkers.h +1 -1
- nuitka/build/include/nuitka/checksum_tools.h +1 -1
- nuitka/build/include/nuitka/compiled_asyncgen.h +4 -2
- nuitka/build/include/nuitka/compiled_cell.h +1 -1
- nuitka/build/include/nuitka/compiled_coroutine.h +3 -2
- nuitka/build/include/nuitka/compiled_frame.h +6 -13
- nuitka/build/include/nuitka/compiled_function.h +2 -3
- nuitka/build/include/nuitka/compiled_generator.h +3 -2
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/constants.h +5 -1
- nuitka/build/include/nuitka/constants_blob.h +1 -1
- nuitka/build/include/nuitka/debug_settings.h +1 -1
- nuitka/build/include/nuitka/environment_variables.h +1 -1
- nuitka/build/include/nuitka/environment_variables_system.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +1 -1
- nuitka/build/include/nuitka/exceptions.h +2 -2
- nuitka/build/include/nuitka/filesystem_paths.h +4 -1
- nuitka/build/include/nuitka/freelists.h +2 -2
- nuitka/build/include/nuitka/helper/attributes.h +1 -1
- nuitka/build/include/nuitka/helper/boolean.h +1 -1
- nuitka/build/include/nuitka/helper/bytearrays.h +1 -1
- nuitka/build/include/nuitka/helper/bytes.h +1 -1
- nuitka/build/include/nuitka/helper/calling_generated.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_eq.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_ge.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_gt.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_le.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_lt.h +1 -1
- nuitka/build/include/nuitka/helper/comparisons_ne.h +1 -1
- nuitka/build/include/nuitka/helper/complex.h +1 -1
- nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
- nuitka/build/include/nuitka/helper/floats.h +1 -1
- nuitka/build/include/nuitka/helper/import_hard.h +1 -1
- nuitka/build/include/nuitka/helper/indexes.h +1 -1
- nuitka/build/include/nuitka/helper/ints.h +1 -1
- nuitka/build/include/nuitka/helper/iterators.h +1 -1
- nuitka/build/include/nuitka/helper/lists.h +1 -1
- nuitka/build/include/nuitka/helper/lists_generated.h +1 -1
- nuitka/build/include/nuitka/helper/mappings.h +1 -1
- nuitka/build/include/nuitka/helper/operations.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_add.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +1 -1
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +1 -1
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +1 -1
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +1 -1
- nuitka/build/include/nuitka/helper/raising.h +1 -1
- nuitka/build/include/nuitka/helper/rangeobjects.h +1 -1
- nuitka/build/include/nuitka/helper/richcomparisons.h +1 -1
- nuitka/build/include/nuitka/helper/sequences.h +1 -1
- nuitka/build/include/nuitka/helper/sets.h +1 -1
- nuitka/build/include/nuitka/helper/slices.h +1 -1
- nuitka/build/include/nuitka/helper/strings.h +1 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helper/tuples.h +1 -1
- nuitka/build/include/nuitka/helpers.h +1 -43
- nuitka/build/include/nuitka/importing.h +1 -1
- nuitka/build/include/nuitka/jit_sources.h +1 -1
- nuitka/build/include/nuitka/prelude.h +10 -10
- nuitka/build/include/nuitka/printing.h +1 -1
- nuitka/build/include/nuitka/python_pgo.h +1 -1
- nuitka/build/include/nuitka/safe_string_ops.h +1 -1
- nuitka/build/include/nuitka/threading.h +1 -1
- nuitka/build/include/nuitka/tracing.h +1 -1
- nuitka/build/include/nuitka/type_aliases.h +2 -2
- nuitka/build/include/nuitka/unfreezing.h +1 -1
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +80 -75
- nuitka/build/static_src/CompiledCellType.c +2 -1
- nuitka/build/static_src/CompiledCodeHelpers.c +10 -28
- nuitka/build/static_src/CompiledCoroutineType.c +30 -40
- nuitka/build/static_src/CompiledFrameType.c +63 -5
- nuitka/build/static_src/CompiledFunctionType.c +11 -13
- nuitka/build/static_src/CompiledGeneratorType.c +56 -13
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +1 -1
- nuitka/build/static_src/CompiledMethodType.c +2 -1
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +1 -1
- nuitka/build/static_src/HelpersAttributes.c +5 -2
- nuitka/build/static_src/HelpersBuiltin.c +1 -1
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +1 -1
- nuitka/build/static_src/HelpersBytes.c +1 -1
- nuitka/build/static_src/HelpersCalling.c +1 -1
- nuitka/build/static_src/HelpersCallingGenerated.c +6 -16
- nuitka/build/static_src/HelpersChecksumTools.c +1 -1
- nuitka/build/static_src/HelpersClasses.c +1 -1
- nuitka/build/static_src/HelpersComparisonDualEq.c +1 -1
- nuitka/build/static_src/HelpersComparisonDualGe.c +1 -1
- nuitka/build/static_src/HelpersComparisonDualGt.c +1 -1
- nuitka/build/static_src/HelpersComparisonDualLe.c +1 -1
- nuitka/build/static_src/HelpersComparisonDualLt.c +1 -1
- nuitka/build/static_src/HelpersComparisonDualNe.c +1 -1
- nuitka/build/static_src/HelpersComparisonEq.c +1 -1
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +1 -1
- nuitka/build/static_src/HelpersComparisonGt.c +1 -1
- nuitka/build/static_src/HelpersComparisonLe.c +1 -1
- nuitka/build/static_src/HelpersComparisonLt.c +1 -1
- nuitka/build/static_src/HelpersComparisonNe.c +1 -1
- nuitka/build/static_src/HelpersConsole.c +2 -2
- nuitka/build/static_src/HelpersConstantsBlob.c +199 -50
- nuitka/build/static_src/HelpersDeepcopy.c +3 -1
- nuitka/build/static_src/HelpersDictionaries.c +1 -1
- nuitka/build/static_src/HelpersDictionariesGenerated.c +1 -1
- nuitka/build/static_src/HelpersDumpBacktraces.c +1 -1
- nuitka/build/static_src/HelpersEnvironmentVariables.c +1 -1
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +1 -1
- nuitka/build/static_src/HelpersExceptions.c +1 -1
- nuitka/build/static_src/HelpersFiles.c +18 -10
- nuitka/build/static_src/HelpersFilesystemPaths.c +36 -16
- nuitka/build/static_src/HelpersFloats.c +1 -1
- nuitka/build/static_src/HelpersHeapStorage.c +1 -1
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersImportHard.c +1 -1
- nuitka/build/static_src/HelpersJitSources.c +1 -1
- nuitka/build/static_src/HelpersLists.c +2 -1
- nuitka/build/static_src/HelpersListsGenerated.c +1 -1
- nuitka/build/static_src/HelpersMappings.c +1 -1
- nuitka/build/static_src/HelpersMatching.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryMod.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryMult.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryPow.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +1 -1
- nuitka/build/static_src/HelpersOperationBinarySub.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceMod.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceMult.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +1 -1
- nuitka/build/static_src/HelpersOperationInplacePow.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceSub.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +1 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersPythonPgo.c +5 -2
- nuitka/build/static_src/HelpersRaising.c +1 -1
- nuitka/build/static_src/HelpersSafeStrings.c +1 -1
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersSlices.c +1 -1
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +5 -5
- nuitka/build/static_src/InspectPatcher.c +2 -1
- nuitka/build/static_src/MainProgram.c +30 -6
- nuitka/build/static_src/MetaPathBasedLoader.c +19 -11
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +1 -1
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +1 -1
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +17 -4
- nuitka/build/static_src/OnefileBootstrap.c +6 -4
- nuitka/build/static_src/OnefileSplashScreen.cpp +1 -1
- nuitka/code_generation/AsyncgenCodes.py +5 -6
- nuitka/code_generation/AttributeCodes.py +1 -1
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +1 -1
- nuitka/code_generation/BranchCodes.py +1 -1
- nuitka/code_generation/BuiltinCodes.py +15 -5
- nuitka/code_generation/CallCodes.py +1 -1
- nuitka/code_generation/ClassCodes.py +1 -1
- nuitka/code_generation/CodeGeneration.py +23 -17
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +1 -1
- nuitka/code_generation/CodeObjectCodes.py +19 -2
- nuitka/code_generation/ComparisonCodes.py +1 -1
- nuitka/code_generation/ComparisonHelperDefinitions.py +1 -1
- nuitka/code_generation/ConditionalCodes.py +1 -1
- nuitka/code_generation/ConstantCodes.py +1 -1
- nuitka/code_generation/Contexts.py +52 -39
- nuitka/code_generation/CoroutineCodes.py +4 -5
- nuitka/code_generation/CtypesCodes.py +1 -1
- nuitka/code_generation/DictCodes.py +1 -1
- nuitka/code_generation/Emission.py +1 -1
- nuitka/code_generation/ErrorCodes.py +1 -1
- nuitka/code_generation/EvalCodes.py +1 -1
- nuitka/code_generation/ExceptionCodes.py +1 -1
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -1
- nuitka/code_generation/ExpressionCodes.py +1 -1
- nuitka/code_generation/FrameCodes.py +26 -17
- nuitka/code_generation/FunctionCodes.py +9 -15
- nuitka/code_generation/GeneratorCodes.py +9 -10
- nuitka/code_generation/GlobalConstants.py +6 -4
- nuitka/code_generation/GlobalsLocalsCodes.py +1 -1
- nuitka/code_generation/IdCodes.py +1 -1
- nuitka/code_generation/ImportCodes.py +1 -1
- nuitka/code_generation/Indentation.py +1 -1
- nuitka/code_generation/IndexCodes.py +1 -1
- nuitka/code_generation/InjectCCodes.py +1 -1
- nuitka/code_generation/IntegerCodes.py +1 -1
- nuitka/code_generation/IteratorCodes.py +1 -1
- nuitka/code_generation/JitCodes.py +1 -1
- nuitka/code_generation/LabelCodes.py +1 -1
- nuitka/code_generation/LineNumberCodes.py +1 -1
- nuitka/code_generation/ListCodes.py +1 -1
- nuitka/code_generation/LoaderCodes.py +1 -1
- nuitka/code_generation/LocalsDictCodes.py +1 -1
- nuitka/code_generation/LoopCodes.py +1 -1
- nuitka/code_generation/MatchCodes.py +1 -1
- nuitka/code_generation/ModuleCodes.py +31 -4
- nuitka/code_generation/Namify.py +4 -1
- nuitka/code_generation/NetworkxCodes.py +1 -1
- nuitka/code_generation/OperationCodes.py +1 -1
- nuitka/code_generation/PackageResourceCodes.py +4 -10
- nuitka/code_generation/PrintCodes.py +1 -1
- nuitka/code_generation/PythonAPICodes.py +1 -1
- nuitka/code_generation/RaisingCodes.py +1 -1
- nuitka/code_generation/Reports.py +1 -1
- nuitka/code_generation/ReturnCodes.py +1 -1
- nuitka/code_generation/SetCodes.py +1 -1
- nuitka/code_generation/SliceCodes.py +1 -1
- nuitka/code_generation/StringCodes.py +1 -1
- nuitka/code_generation/SubscriptCodes.py +1 -1
- nuitka/code_generation/TensorflowCodes.py +1 -1
- nuitka/code_generation/TryCodes.py +1 -1
- nuitka/code_generation/TupleCodes.py +1 -1
- nuitka/code_generation/TypeAliasCodes.py +4 -3
- nuitka/code_generation/VariableCodes.py +1 -1
- nuitka/code_generation/VariableDeclarations.py +1 -1
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/__init__.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +1 -1
- nuitka/code_generation/c_types/CTypeBooleans.py +1 -1
- nuitka/code_generation/c_types/CTypeCFloats.py +1 -1
- nuitka/code_generation/c_types/CTypeCLongs.py +1 -1
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +1 -1
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +1 -1
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +1 -1
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +1 -1
- nuitka/code_generation/c_types/CTypeVoids.py +1 -1
- nuitka/code_generation/c_types/__init__.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesFrames.py +21 -25
- nuitka/code_generation/templates/CodeTemplatesFunction.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +3 -3
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesLoader.py +26 -3
- nuitka/code_generation/templates/CodeTemplatesModules.py +21 -8
- nuitka/code_generation/templates/CodeTemplatesVariables.py +1 -1
- nuitka/code_generation/templates/TemplateDebugWrapper.py +1 -1
- nuitka/code_generation/templates/__init__.py +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +21 -1
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +1 -1
- 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 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +1 -1
- nuitka/containers/OrderedSetsFallback.py +1 -1
- nuitka/containers/__init__.py +1 -1
- nuitka/distutils/Build.py +1 -1
- nuitka/distutils/DistutilCommands.py +2 -2
- nuitka/distutils/__init__.py +1 -1
- nuitka/finalizations/Finalization.py +1 -1
- nuitka/finalizations/FinalizeMarkups.py +1 -1
- nuitka/finalizations/__init__.py +1 -1
- nuitka/freezer/DependsExe.py +2 -1
- nuitka/freezer/DllDependenciesCommon.py +1 -1
- nuitka/freezer/DllDependenciesMacOS.py +8 -3
- nuitka/freezer/DllDependenciesPosix.py +23 -4
- nuitka/freezer/DllDependenciesWin32.py +112 -25
- nuitka/freezer/ImportDetection.py +1 -1
- nuitka/freezer/IncludedDataFiles.py +2 -2
- nuitka/freezer/IncludedEntryPoints.py +9 -1
- nuitka/freezer/Onefile.py +13 -15
- nuitka/freezer/Standalone.py +16 -4
- nuitka/freezer/__init__.py +1 -1
- nuitka/importing/IgnoreListing.py +1 -1
- nuitka/importing/ImportCache.py +1 -1
- nuitka/importing/ImportResolving.py +1 -1
- nuitka/importing/Importing.py +6 -4
- nuitka/importing/PreloadedPackages.py +1 -1
- nuitka/importing/Recursion.py +37 -12
- nuitka/importing/StandardLibrary.py +1 -1
- nuitka/importing/__init__.py +1 -1
- nuitka/nodes/AsyncgenNodes.py +1 -1
- nuitka/nodes/AttributeLookupNodes.py +1 -1
- nuitka/nodes/AttributeNodes.py +1 -1
- nuitka/nodes/AttributeNodesGenerated.py +1 -1
- nuitka/nodes/BuiltinAllNodes.py +1 -1
- nuitka/nodes/BuiltinAnyNodes.py +1 -1
- nuitka/nodes/BuiltinComplexNodes.py +1 -1
- nuitka/nodes/BuiltinDecodingNodes.py +1 -1
- nuitka/nodes/BuiltinDecoratorNodes.py +1 -1
- nuitka/nodes/BuiltinDictNodes.py +1 -1
- nuitka/nodes/BuiltinFormatNodes.py +1 -1
- nuitka/nodes/BuiltinHashNodes.py +1 -1
- nuitka/nodes/BuiltinInputNodes.py +1 -1
- nuitka/nodes/BuiltinIntegerNodes.py +1 -1
- nuitka/nodes/BuiltinIteratorNodes.py +1 -1
- nuitka/nodes/BuiltinLenNodes.py +1 -1
- nuitka/nodes/BuiltinNextNodes.py +1 -1
- nuitka/nodes/BuiltinOpenNodes.py +1 -1
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +1 -1
- nuitka/nodes/BuiltinRangeNodes.py +1 -1
- nuitka/nodes/BuiltinRefNodes.py +1 -1
- nuitka/nodes/BuiltinSumNodes.py +1 -1
- nuitka/nodes/BuiltinTypeNodes.py +1 -1
- nuitka/nodes/BuiltinVarsNodes.py +1 -1
- nuitka/nodes/BytesNodes.py +1 -1
- nuitka/nodes/CallNodes.py +1 -1
- nuitka/nodes/Checkers.py +1 -1
- nuitka/nodes/ChildrenHavingMixins.py +240 -16
- nuitka/nodes/ClassNodes.py +1 -1
- nuitka/nodes/CodeObjectSpecs.py +4 -4
- nuitka/nodes/ComparisonNodes.py +1 -1
- nuitka/nodes/ConditionalNodes.py +1 -1
- nuitka/nodes/ConstantRefNodes.py +1 -1
- nuitka/nodes/ContainerMakingNodes.py +1 -1
- nuitka/nodes/ContainerOperationNodes.py +1 -1
- nuitka/nodes/CoroutineNodes.py +1 -1
- nuitka/nodes/CtypesNodes.py +1 -1
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +1 -1
- nuitka/nodes/ExecEvalNodes.py +1 -1
- nuitka/nodes/ExpressionBases.py +1 -1
- nuitka/nodes/ExpressionBasesGenerated.py +1 -1
- nuitka/nodes/ExpressionShapeMixins.py +1 -1
- nuitka/nodes/FrameNodes.py +19 -7
- nuitka/nodes/FunctionAttributeNodes.py +1 -1
- nuitka/nodes/FunctionNodes.py +8 -1
- nuitka/nodes/FutureSpecs.py +34 -2
- nuitka/nodes/GeneratorNodes.py +1 -1
- nuitka/nodes/GlobalsLocalsNodes.py +1 -1
- nuitka/nodes/HardImportNodesGenerated.py +140 -56
- nuitka/nodes/ImportHardNodes.py +1 -1
- nuitka/nodes/ImportNodes.py +1 -1
- nuitka/nodes/IndicatorMixins.py +1 -1
- nuitka/nodes/InjectCNodes.py +1 -1
- nuitka/nodes/IterationHandles.py +1 -1
- nuitka/nodes/KeyValuePairNodes.py +1 -1
- nuitka/nodes/ListOperationNodes.py +1 -1
- nuitka/nodes/LocalsDictNodes.py +1 -1
- nuitka/nodes/LocalsScopes.py +1 -1
- nuitka/nodes/LoopNodes.py +1 -1
- nuitka/nodes/MatchNodes.py +1 -1
- nuitka/nodes/ModuleAttributeNodes.py +1 -1
- nuitka/nodes/ModuleNodes.py +23 -9
- nuitka/nodes/NetworkxNodes.py +1 -1
- nuitka/nodes/NodeBases.py +1 -1
- nuitka/nodes/NodeMakingHelpers.py +1 -1
- nuitka/nodes/NodeMetaClasses.py +1 -1
- nuitka/nodes/OperatorNodes.py +1 -1
- nuitka/nodes/OperatorNodesUnary.py +1 -1
- nuitka/nodes/OsSysNodes.py +1 -1
- nuitka/nodes/OutlineNodes.py +1 -1
- nuitka/nodes/PackageMetadataNodes.py +4 -2
- nuitka/nodes/PackageResourceNodes.py +42 -7
- nuitka/nodes/PrintNodes.py +1 -1
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/SideEffectNodes.py +1 -1
- nuitka/nodes/SliceNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +1 -1
- nuitka/nodes/StatementNodes.py +1 -1
- nuitka/nodes/StrNodes.py +1 -1
- nuitka/nodes/StringConcatenationNodes.py +1 -1
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TensorflowNodes.py +1 -1
- nuitka/nodes/TryNodes.py +1 -1
- nuitka/nodes/TypeMatchNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableDelNodes.py +1 -1
- nuitka/nodes/VariableNameNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +1 -1
- nuitka/nodes/VariableReleaseNodes.py +1 -1
- nuitka/nodes/YieldNodes.py +1 -1
- nuitka/nodes/__init__.py +1 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +1 -1
- nuitka/nodes/shapes/ControlFlowDescriptions.py +1 -1
- nuitka/nodes/shapes/IteratorShapes.py +1 -1
- nuitka/nodes/shapes/ShapeMixins.py +1 -1
- nuitka/nodes/shapes/StandardShapes.py +1 -1
- nuitka/nodes/shapes/__init__.py +1 -1
- nuitka/optimizations/BytecodeDemotion.py +1 -1
- nuitka/optimizations/FunctionInlining.py +1 -1
- nuitka/optimizations/Graphs.py +1 -1
- nuitka/optimizations/Optimization.py +1 -1
- nuitka/optimizations/OptimizeBuiltinCalls.py +1 -1
- nuitka/optimizations/Tags.py +1 -1
- nuitka/optimizations/TraceCollections.py +1 -1
- nuitka/optimizations/ValueTraces.py +1 -1
- nuitka/optimizations/__init__.py +1 -1
- nuitka/pgo/PGO.py +1 -1
- nuitka/pgo/__init__.py +1 -1
- nuitka/plugins/PluginBase.py +91 -16
- nuitka/plugins/Plugins.py +58 -15
- nuitka/plugins/YamlPluginBase.py +1 -1
- nuitka/plugins/__init__.py +1 -1
- nuitka/plugins/standard/AntiBloatPlugin.py +138 -66
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +2 -1
- nuitka/plugins/standard/DataFilesPlugin.py +2 -2
- nuitka/plugins/standard/DelvewheelPlugin.py +2 -1
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +1 -1
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +1 -1
- nuitka/plugins/standard/DillPlugin.py +2 -2
- nuitka/plugins/standard/DllFilesPlugin.py +2 -12
- nuitka/plugins/standard/EnumPlugin.py +2 -2
- nuitka/plugins/standard/EventletPlugin.py +2 -1
- nuitka/plugins/standard/GeventPlugin.py +2 -1
- nuitka/plugins/standard/GiPlugin.py +2 -1
- nuitka/plugins/standard/GlfwPlugin.py +2 -1
- nuitka/plugins/standard/ImplicitImports.py +7 -6
- nuitka/plugins/standard/KivyPlugin.py +2 -1
- nuitka/plugins/standard/MatplotlibPlugin.py +2 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -1
- nuitka/plugins/standard/NumpyPlugin.py +2 -1
- nuitka/plugins/standard/OptionsNannyPlugin.py +2 -2
- nuitka/plugins/standard/PbrPlugin.py +2 -2
- nuitka/plugins/standard/PkgResourcesPlugin.py +2 -1
- nuitka/plugins/standard/PlaywrightPlugin.py +10 -15
- nuitka/plugins/standard/PmwPlugin.py +2 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +25 -15
- nuitka/plugins/standard/PywebViewPlugin.py +2 -1
- nuitka/plugins/standard/SpacyPlugin.py +2 -1
- nuitka/plugins/standard/TensorflowPlugin.py +2 -1
- nuitka/plugins/standard/TkinterPlugin.py +15 -2
- nuitka/plugins/standard/TorchPlugin.py +2 -1
- nuitka/plugins/standard/TransformersPlugin.py +2 -2
- nuitka/plugins/standard/TrioPlugin.py +2 -1
- nuitka/plugins/standard/UpxPlugin.py +2 -1
- nuitka/plugins/standard/__init__.py +1 -1
- nuitka/plugins/standard/standard.nuitka-package.config.yml +257 -89
- nuitka/reports/CompilationReportReader.py +5 -1
- nuitka/reports/LicenseReport.rst.j2 +1 -1
- nuitka/reports/Reports.py +30 -3
- nuitka/reports/__init__.py +1 -1
- nuitka/specs/BuiltinBytesOperationSpecs.py +1 -1
- nuitka/specs/BuiltinDictOperationSpecs.py +1 -1
- nuitka/specs/BuiltinListOperationSpecs.py +1 -1
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
- nuitka/specs/BuiltinTypeOperationSpecs.py +1 -1
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +10 -2
- nuitka/specs/ParameterSpecs.py +17 -2
- nuitka/specs/__init__.py +1 -1
- nuitka/tools/Basics.py +1 -1
- nuitka/tools/__init__.py +1 -1
- nuitka/tools/commercial/__init__.py +1 -1
- nuitka/tools/data_composer/DataComposer.py +125 -1
- nuitka/tools/data_composer/__init__.py +1 -1
- nuitka/tools/data_composer/__main__.py +1 -1
- nuitka/tools/environments/CreateEnvironment.py +1 -1
- nuitka/tools/environments/Virtualenv.py +1 -1
- nuitka/tools/environments/__init__.py +1 -1
- nuitka/tools/general/__init__.py +1 -1
- nuitka/tools/general/dll_report/__init__.py +1 -1
- nuitka/tools/general/dll_report/__main__.py +1 -1
- nuitka/tools/general/find_module/FindModuleCode.py +6 -3
- nuitka/tools/general/find_module/__init__.py +1 -1
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/onefile_compressor/__init__.py +1 -1
- nuitka/tools/onefile_compressor/__main__.py +1 -1
- nuitka/tools/podman/Podman.py +1 -1
- nuitka/tools/podman/__init__.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/profiler/__init__.py +1 -1
- nuitka/tools/profiler/__main__.py +1 -1
- nuitka/tools/scanning/DisplayPackageDLLs.py +42 -20
- nuitka/tools/scanning/DisplayPackageData.py +1 -1
- nuitka/tools/scanning/__init__.py +1 -1
- nuitka/tools/specialize/CTypeDescriptions.py +1 -1
- nuitka/tools/specialize/Common.py +1 -1
- nuitka/tools/specialize/SpecializeC.py +1 -1
- nuitka/tools/specialize/SpecializePython.py +7 -3
- nuitka/tools/specialize/__init__.py +1 -1
- nuitka/tools/testing/Common.py +140 -19
- nuitka/tools/testing/Constructs.py +1 -1
- nuitka/tools/testing/OutputComparison.py +5 -4
- nuitka/tools/testing/Pythons.py +1 -1
- nuitka/tools/testing/RuntimeTracing.py +1 -1
- nuitka/tools/testing/SearchModes.py +1 -1
- nuitka/tools/testing/Valgrind.py +1 -1
- nuitka/tools/testing/__init__.py +1 -1
- nuitka/tools/testing/check_reference_counts/__init__.py +1 -1
- nuitka/tools/testing/check_reference_counts/__main__.py +6 -2
- nuitka/tools/testing/compare_with_cpython/__init__.py +1 -1
- nuitka/tools/testing/compare_with_cpython/__main__.py +51 -14
- nuitka/tools/testing/find_sxs_modules/__init__.py +1 -1
- nuitka/tools/testing/find_sxs_modules/__main__.py +1 -1
- nuitka/tools/testing/measure_construct_performance/__init__.py +1 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__init__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1 -1
- nuitka/tools/watch/AutoStage.py +1 -1
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +1 -1
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +143 -0
- nuitka/tools/watch/__init__.py +1 -1
- nuitka/tools/watch/__main__.py +124 -266
- nuitka/tree/Building.py +5 -7
- nuitka/tree/ComplexCallHelperFunctions.py +1 -1
- nuitka/tree/Extractions.py +1 -1
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +1 -1
- nuitka/tree/Operations.py +1 -1
- nuitka/tree/ReformulationAssertStatements.py +1 -1
- nuitka/tree/ReformulationAssignmentStatements.py +3 -3
- nuitka/tree/ReformulationBooleanExpressions.py +1 -1
- nuitka/tree/ReformulationCallExpressions.py +1 -1
- nuitka/tree/ReformulationClasses.py +1 -1
- nuitka/tree/ReformulationClasses3.py +1 -1
- nuitka/tree/ReformulationComparisonExpressions.py +1 -1
- nuitka/tree/ReformulationContractionExpressions.py +3 -1
- nuitka/tree/ReformulationDictionaryCreation.py +3 -3
- nuitka/tree/ReformulationExecStatements.py +1 -1
- nuitka/tree/ReformulationForLoopStatements.py +1 -1
- nuitka/tree/ReformulationFunctionStatements.py +2 -2
- nuitka/tree/ReformulationImportStatements.py +5 -52
- nuitka/tree/ReformulationLambdaExpressions.py +2 -1
- nuitka/tree/ReformulationMatchStatements.py +1 -1
- nuitka/tree/ReformulationMultidist.py +2 -2
- nuitka/tree/ReformulationNamespacePackages.py +28 -6
- nuitka/tree/ReformulationPrintStatements.py +1 -1
- nuitka/tree/ReformulationSequenceCreation.py +1 -1
- nuitka/tree/ReformulationSubscriptExpressions.py +1 -1
- nuitka/tree/ReformulationTryExceptStatements.py +1 -1
- nuitka/tree/ReformulationTryFinallyStatements.py +1 -1
- nuitka/tree/ReformulationWhileLoopStatements.py +1 -1
- nuitka/tree/ReformulationWithStatements.py +1 -1
- nuitka/tree/ReformulationYieldExpressions.py +1 -1
- nuitka/tree/SourceHandling.py +57 -18
- nuitka/tree/SyntaxErrors.py +1 -1
- nuitka/tree/TreeHelpers.py +24 -10
- nuitka/tree/VariableClosure.py +1 -1
- nuitka/tree/__init__.py +1 -1
- nuitka/utils/AppDirs.py +5 -2
- nuitka/utils/CStrings.py +1 -1
- nuitka/utils/CommandLineOptions.py +2 -2
- nuitka/utils/Distributions.py +197 -15
- nuitka/utils/Download.py +14 -6
- nuitka/utils/Execution.py +43 -14
- nuitka/utils/FileOperations.py +43 -10
- nuitka/utils/Hashing.py +1 -1
- nuitka/utils/Images.py +8 -2
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/InlineCopies.py +1 -1
- nuitka/utils/InstalledPythons.py +1 -1
- nuitka/utils/InstanceCounters.py +1 -1
- nuitka/utils/Jinja2.py +1 -1
- nuitka/utils/Json.py +2 -2
- nuitka/utils/MacOSApp.py +4 -3
- nuitka/utils/MemoryUsage.py +1 -1
- nuitka/utils/ModuleNames.py +1 -1
- nuitka/utils/PackageResources.py +1 -1
- nuitka/utils/ReExecute.py +1 -1
- nuitka/utils/Rest.py +1 -1
- nuitka/utils/SharedLibraries.py +52 -7
- nuitka/utils/Shebang.py +1 -1
- nuitka/utils/Signing.py +2 -4
- nuitka/utils/SlotMetaClasses.py +1 -1
- nuitka/utils/StaticLibraries.py +29 -1
- nuitka/utils/ThreadedExecutor.py +1 -1
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +1 -1
- nuitka/utils/WindowsFileUsage.py +1 -1
- nuitka/utils/WindowsResources.py +3 -1
- nuitka/utils/Yaml.py +1 -1
- nuitka/utils/__init__.py +1 -1
- Nuitka_winsvc-2.5.6.dist-info/RECORD +0 -978
- {Nuitka_winsvc-2.5.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.5.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.5.6.dist-info → Nuitka_winsvc-2.6.5.dist-info}/top_level.txt +0 -0
nuitka/plugins/PluginBase.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
"""
|
|
@@ -150,7 +150,7 @@ def _getEvaluationContext():
|
|
|
150
150
|
"android32": isAndroidBasedLinux() and sys.maxsize < 2**32,
|
|
151
151
|
"android64": isAndroidBasedLinux() and sys.maxsize >= 2**64 - 1,
|
|
152
152
|
"anaconda": isAnacondaPython(),
|
|
153
|
-
"is_conda_package":
|
|
153
|
+
"is_conda_package": _isCondaPackage,
|
|
154
154
|
"debian_python": isDebianPackagePython(),
|
|
155
155
|
"nuitka_python": isNuitkaPython(),
|
|
156
156
|
"standalone": isStandaloneMode(),
|
|
@@ -266,6 +266,12 @@ def _getDistributionNameFromPackageName(package_name):
|
|
|
266
266
|
return getDistributionName(distribution)
|
|
267
267
|
|
|
268
268
|
|
|
269
|
+
def _isCondaPackage(package_name):
|
|
270
|
+
distribution_name = _getDistributionNameFromPackageName(package_name)
|
|
271
|
+
|
|
272
|
+
return isDistributionCondaPackage(distribution_name)
|
|
273
|
+
|
|
274
|
+
|
|
269
275
|
def _getPackageVersion(distribution_name):
|
|
270
276
|
if distribution_name not in _package_versions:
|
|
271
277
|
try:
|
|
@@ -446,6 +452,21 @@ class NuitkaPluginBase(getMetaClassBase("Plugin", require_slots=False)):
|
|
|
446
452
|
"""Is this a detection plugin, i.e. one which is only there to inform."""
|
|
447
453
|
return hasattr(cls, "detector_for")
|
|
448
454
|
|
|
455
|
+
@classmethod
|
|
456
|
+
def hasCategory(cls, category):
|
|
457
|
+
return category in cls.getCategories()
|
|
458
|
+
|
|
459
|
+
@classmethod
|
|
460
|
+
def getCategories(cls):
|
|
461
|
+
plugin_category = getattr(cls, "plugin_category", None)
|
|
462
|
+
|
|
463
|
+
if plugin_category is None:
|
|
464
|
+
result = ()
|
|
465
|
+
else:
|
|
466
|
+
result = plugin_category.split(",")
|
|
467
|
+
|
|
468
|
+
return OrderedSet(sorted(result))
|
|
469
|
+
|
|
449
470
|
@classmethod
|
|
450
471
|
def addPluginCommandLineOptions(cls, group):
|
|
451
472
|
# Call group.add_option() here.
|
|
@@ -1280,7 +1301,8 @@ import sys
|
|
|
1280
1301
|
|
|
1281
1302
|
try:
|
|
1282
1303
|
%(setup_codes)s
|
|
1283
|
-
except ImportError:
|
|
1304
|
+
except ImportError as e:
|
|
1305
|
+
sys.stderr.write("\n%%s" %% repr(e))
|
|
1284
1306
|
sys.exit(38)
|
|
1285
1307
|
try:
|
|
1286
1308
|
%(query_codes)s
|
|
@@ -1302,6 +1324,11 @@ except Exception as e:
|
|
|
1302
1324
|
feedback = check_output([sys.executable, "-c", cmd], env=env)
|
|
1303
1325
|
except NuitkaCalledProcessError as e:
|
|
1304
1326
|
if e.returncode == 38:
|
|
1327
|
+
self.warning(
|
|
1328
|
+
"Import error (not installed?) during compile time command execution: %s"
|
|
1329
|
+
% e.stderr.splitlines()[-1]
|
|
1330
|
+
)
|
|
1331
|
+
|
|
1305
1332
|
return None
|
|
1306
1333
|
|
|
1307
1334
|
if Options.is_debug:
|
|
@@ -1414,7 +1441,8 @@ except Exception as e:
|
|
|
1414
1441
|
):
|
|
1415
1442
|
if self.isValueForEvaluation(expression):
|
|
1416
1443
|
return self.evaluateExpression(
|
|
1417
|
-
|
|
1444
|
+
config_module_name=full_name,
|
|
1445
|
+
module_name=full_name,
|
|
1418
1446
|
expression=expression,
|
|
1419
1447
|
config_name=config_name,
|
|
1420
1448
|
extra_context=extra_context,
|
|
@@ -1435,6 +1463,8 @@ except Exception as e:
|
|
|
1435
1463
|
if declarations and self.evaluateCondition(
|
|
1436
1464
|
full_name=full_name,
|
|
1437
1465
|
condition=constant_config.get("when", "True"),
|
|
1466
|
+
allow_constants=False,
|
|
1467
|
+
allow_variables=False,
|
|
1438
1468
|
):
|
|
1439
1469
|
for constant_name, constant_value in declarations.items():
|
|
1440
1470
|
constants[constant_name] = self.evaluateExpressionOrConstant(
|
|
@@ -1471,6 +1501,8 @@ except Exception as e:
|
|
|
1471
1501
|
if self.evaluateCondition(
|
|
1472
1502
|
full_name=full_name,
|
|
1473
1503
|
condition=variable_config.get("when", "True"),
|
|
1504
|
+
allow_constants=True,
|
|
1505
|
+
allow_variables=False,
|
|
1474
1506
|
):
|
|
1475
1507
|
setup_codes.extend(
|
|
1476
1508
|
"%s=%r" % (constant_name, constant_value)
|
|
@@ -1513,19 +1545,28 @@ except Exception as e:
|
|
|
1513
1545
|
return _module_config_variables[full_name]
|
|
1514
1546
|
|
|
1515
1547
|
def evaluateExpression(
|
|
1516
|
-
self,
|
|
1548
|
+
self,
|
|
1549
|
+
config_module_name,
|
|
1550
|
+
module_name,
|
|
1551
|
+
expression,
|
|
1552
|
+
config_name,
|
|
1553
|
+
extra_context,
|
|
1554
|
+
single_value,
|
|
1517
1555
|
):
|
|
1518
1556
|
context = _makeEvaluationContext(
|
|
1519
|
-
logger=self, full_name=
|
|
1557
|
+
logger=self, full_name=config_module_name, config_name=config_name
|
|
1520
1558
|
)
|
|
1521
1559
|
|
|
1522
1560
|
def get_variable(variable_name):
|
|
1523
1561
|
assert type(variable_name) is str, variable_name
|
|
1524
1562
|
|
|
1525
|
-
result = self.getExpressionVariables(full_name=
|
|
1563
|
+
result = self.getExpressionVariables(full_name=config_module_name)[
|
|
1564
|
+
variable_name
|
|
1565
|
+
]
|
|
1526
1566
|
|
|
1527
1567
|
addModuleInfluencingVariable(
|
|
1528
|
-
module_name=
|
|
1568
|
+
module_name=module_name,
|
|
1569
|
+
config_module_name=config_module_name,
|
|
1529
1570
|
plugin_name=self.plugin_name,
|
|
1530
1571
|
variable_name=variable_name,
|
|
1531
1572
|
control_tags=context.used_tags,
|
|
@@ -1537,7 +1578,9 @@ except Exception as e:
|
|
|
1537
1578
|
def get_constant(constant_name):
|
|
1538
1579
|
assert type(constant_name) is str, constant_name
|
|
1539
1580
|
|
|
1540
|
-
result = self.getExpressionConstants(full_name=
|
|
1581
|
+
result = self.getExpressionConstants(full_name=config_module_name)[
|
|
1582
|
+
constant_name
|
|
1583
|
+
]
|
|
1541
1584
|
|
|
1542
1585
|
# TODO: Record the constant value in report.
|
|
1543
1586
|
|
|
@@ -1547,13 +1590,13 @@ except Exception as e:
|
|
|
1547
1590
|
context["get_constant"] = get_constant
|
|
1548
1591
|
|
|
1549
1592
|
def get_parameter(parameter_name, default):
|
|
1550
|
-
result = Options.getModuleParameter(
|
|
1593
|
+
result = Options.getModuleParameter(config_module_name, parameter_name)
|
|
1551
1594
|
|
|
1552
1595
|
if result is None:
|
|
1553
1596
|
result = default
|
|
1554
1597
|
|
|
1555
1598
|
self.addModuleInfluencingParameter(
|
|
1556
|
-
module_name=
|
|
1599
|
+
module_name=config_module_name,
|
|
1557
1600
|
parameter_name=parameter_name,
|
|
1558
1601
|
condition_tags_used=context.used_tags,
|
|
1559
1602
|
result=result,
|
|
@@ -1582,16 +1625,16 @@ except Exception as e:
|
|
|
1582
1625
|
if type(result) not in (str, unicode):
|
|
1583
1626
|
if single_value:
|
|
1584
1627
|
self._checkStrResult(
|
|
1585
|
-
value=result, expression=expression, full_name=
|
|
1628
|
+
value=result, expression=expression, full_name=config_module_name
|
|
1586
1629
|
)
|
|
1587
1630
|
else:
|
|
1588
1631
|
self._checkSequenceResult(
|
|
1589
|
-
value=result, expression=expression, full_name=
|
|
1632
|
+
value=result, expression=expression, full_name=config_module_name
|
|
1590
1633
|
)
|
|
1591
1634
|
|
|
1592
1635
|
for v in result:
|
|
1593
1636
|
self._checkStrResult(
|
|
1594
|
-
value=v, expression=expression, full_name=
|
|
1637
|
+
value=v, expression=expression, full_name=config_module_name
|
|
1595
1638
|
)
|
|
1596
1639
|
|
|
1597
1640
|
# Make it immutable in case it's a list.
|
|
@@ -1603,7 +1646,7 @@ except Exception as e:
|
|
|
1603
1646
|
if type(value) not in (str, unicode):
|
|
1604
1647
|
self.sysexit(
|
|
1605
1648
|
"""\
|
|
1606
|
-
Error, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result but '%s'"""
|
|
1649
|
+
Error, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result, but '%s'"""
|
|
1607
1650
|
% (expression, full_name, type(value))
|
|
1608
1651
|
)
|
|
1609
1652
|
|
|
@@ -1615,7 +1658,9 @@ Error, expression '%s' for module '%s' did not evaluate to 'tuple[str]' or 'list
|
|
|
1615
1658
|
% (expression, full_name)
|
|
1616
1659
|
)
|
|
1617
1660
|
|
|
1618
|
-
def evaluateCondition(
|
|
1661
|
+
def evaluateCondition(
|
|
1662
|
+
self, full_name, condition, allow_constants=True, allow_variables=True
|
|
1663
|
+
):
|
|
1619
1664
|
# Note: Caching makes no sense yet, this should all be very fast and
|
|
1620
1665
|
# cache themselves. TODO: Allow plugins to contribute their own control
|
|
1621
1666
|
# tag values during creation and during certain actions.
|
|
@@ -1629,6 +1674,36 @@ Error, expression '%s' for module '%s' did not evaluate to 'tuple[str]' or 'list
|
|
|
1629
1674
|
logger=self, full_name=full_name, config_name="'when' configuration"
|
|
1630
1675
|
)
|
|
1631
1676
|
|
|
1677
|
+
def get_variable(variable_name):
|
|
1678
|
+
assert type(variable_name) is str, variable_name
|
|
1679
|
+
|
|
1680
|
+
result = self.getExpressionVariables(full_name=full_name)[variable_name]
|
|
1681
|
+
|
|
1682
|
+
addModuleInfluencingVariable(
|
|
1683
|
+
module_name=full_name,
|
|
1684
|
+
config_module_name=full_name,
|
|
1685
|
+
plugin_name=self.plugin_name,
|
|
1686
|
+
variable_name=variable_name,
|
|
1687
|
+
control_tags=context.used_tags,
|
|
1688
|
+
result=result,
|
|
1689
|
+
)
|
|
1690
|
+
|
|
1691
|
+
return result
|
|
1692
|
+
|
|
1693
|
+
def get_constant(constant_name):
|
|
1694
|
+
assert type(constant_name) is str, constant_name
|
|
1695
|
+
|
|
1696
|
+
result = self.getExpressionConstants(full_name=full_name)[constant_name]
|
|
1697
|
+
|
|
1698
|
+
# TODO: Record the constant value in report.
|
|
1699
|
+
|
|
1700
|
+
return result
|
|
1701
|
+
|
|
1702
|
+
if allow_constants:
|
|
1703
|
+
context["get_constant"] = get_constant
|
|
1704
|
+
if allow_variables:
|
|
1705
|
+
context["get_variable"] = get_variable
|
|
1706
|
+
|
|
1632
1707
|
def get_parameter(parameter_name, default):
|
|
1633
1708
|
result = Options.getModuleParameter(full_name, parameter_name)
|
|
1634
1709
|
|
nuitka/plugins/Plugins.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
"""
|
|
@@ -51,7 +51,7 @@ from .PluginBase import NuitkaPluginBase, control_tags
|
|
|
51
51
|
# Maps plugin name to plugin instances.
|
|
52
52
|
active_plugins = OrderedDict()
|
|
53
53
|
plugin_name2plugin_classes = {}
|
|
54
|
-
plugin_options =
|
|
54
|
+
plugin_options = OrderedDict()
|
|
55
55
|
plugin_values = {}
|
|
56
56
|
user_plugins = OrderedSet()
|
|
57
57
|
|
|
@@ -414,7 +414,7 @@ class Plugins(object):
|
|
|
414
414
|
if not checkModuleName(v):
|
|
415
415
|
plugin.sysexit(
|
|
416
416
|
"Plugin '%s' returned an invalid module name, not %r (for module '%s')"
|
|
417
|
-
% (plugin, v, module.getFullName())
|
|
417
|
+
% (plugin.plugin_name, v, module.getFullName())
|
|
418
418
|
)
|
|
419
419
|
|
|
420
420
|
yield ModuleName(v)
|
|
@@ -603,7 +603,7 @@ class Plugins(object):
|
|
|
603
603
|
def onOnefileFinished(filename):
|
|
604
604
|
"""Let plugins post-process the onefile executable in onefile mode"""
|
|
605
605
|
for plugin in getActivePlugins():
|
|
606
|
-
plugin.
|
|
606
|
+
plugin.onOnefileFinished(filename)
|
|
607
607
|
|
|
608
608
|
@staticmethod
|
|
609
609
|
def onBootstrapBinary(filename):
|
|
@@ -1680,17 +1680,37 @@ def loadPlugins():
|
|
|
1680
1680
|
loadStandardPluginClasses()
|
|
1681
1681
|
|
|
1682
1682
|
|
|
1683
|
-
|
|
1683
|
+
# TODO: Use in more places.
|
|
1684
|
+
def _keyPluginForSort(plugin_class):
|
|
1685
|
+
return plugin_class.getCategories(), plugin_class.plugin_name
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
def _keyPluginForSort2(item):
|
|
1689
|
+
_plugin_name, (plugin_class, _plugin_detector) = item
|
|
1690
|
+
|
|
1691
|
+
return _keyPluginForSort(plugin_class)
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
def addStandardPluginCommandLineOptions(parser, plugin_help_mode):
|
|
1684
1695
|
loadPlugins()
|
|
1685
1696
|
|
|
1686
1697
|
for _plugin_name, (plugin_class, _plugin_detector) in sorted(
|
|
1687
|
-
plugin_name2plugin_classes.items()
|
|
1698
|
+
plugin_name2plugin_classes.items(), key=_keyPluginForSort2
|
|
1688
1699
|
):
|
|
1689
1700
|
if plugin_class.isAlwaysEnabled():
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1701
|
+
if not plugin_help_mode or not plugin_class.hasCategory("package-support"):
|
|
1702
|
+
_addPluginCommandLineOptions(
|
|
1703
|
+
parser=parser,
|
|
1704
|
+
plugin_class=plugin_class,
|
|
1705
|
+
plugin_help_mode=plugin_help_mode,
|
|
1706
|
+
)
|
|
1707
|
+
else:
|
|
1708
|
+
if plugin_help_mode:
|
|
1709
|
+
_addPluginCommandLineOptions(
|
|
1710
|
+
parser=parser,
|
|
1711
|
+
plugin_class=plugin_class,
|
|
1712
|
+
plugin_help_mode=plugin_help_mode,
|
|
1713
|
+
)
|
|
1694
1714
|
|
|
1695
1715
|
|
|
1696
1716
|
def activatePlugins():
|
|
@@ -1772,11 +1792,27 @@ def activatePlugins():
|
|
|
1772
1792
|
_addActivePlugin(plugin_detector, args=False)
|
|
1773
1793
|
|
|
1774
1794
|
|
|
1775
|
-
def _addPluginCommandLineOptions(parser, plugin_class):
|
|
1795
|
+
def _addPluginCommandLineOptions(parser, plugin_class, plugin_help_mode):
|
|
1776
1796
|
plugin_name = plugin_class.plugin_name
|
|
1777
1797
|
|
|
1778
1798
|
if plugin_name not in plugin_options:
|
|
1779
|
-
|
|
1799
|
+
plugin_display_name = repr(plugin_name)
|
|
1800
|
+
|
|
1801
|
+
if plugin_help_mode:
|
|
1802
|
+
# Ignore duplicate per design givers.
|
|
1803
|
+
if plugin_name in ("pyside2", "pyqt6", "pyqt5"):
|
|
1804
|
+
return
|
|
1805
|
+
|
|
1806
|
+
if plugin_name == "pyside6":
|
|
1807
|
+
plugin_display_name = (
|
|
1808
|
+
"'pyside6' (same for 'pyside2', 'pyqt6', 'pyqt5' plugins)"
|
|
1809
|
+
)
|
|
1810
|
+
|
|
1811
|
+
option_group = OptionGroup(
|
|
1812
|
+
parser,
|
|
1813
|
+
"Plugin options of %s (categories: %s)"
|
|
1814
|
+
% (plugin_display_name, ", ".join(plugin_class.getCategories())),
|
|
1815
|
+
)
|
|
1780
1816
|
try:
|
|
1781
1817
|
plugin_class.addPluginCommandLineOptions(option_group)
|
|
1782
1818
|
except OptionConflictError as e:
|
|
@@ -1799,7 +1835,7 @@ def _addPluginCommandLineOptions(parser, plugin_class):
|
|
|
1799
1835
|
plugin_options[plugin_name] = ()
|
|
1800
1836
|
|
|
1801
1837
|
|
|
1802
|
-
def addPluginCommandLineOptions(parser, plugin_names):
|
|
1838
|
+
def addPluginCommandLineOptions(parser, plugin_names, plugin_help_mode):
|
|
1803
1839
|
"""Add option group for the plugin to the parser.
|
|
1804
1840
|
|
|
1805
1841
|
Notes:
|
|
@@ -1813,12 +1849,19 @@ def addPluginCommandLineOptions(parser, plugin_names):
|
|
|
1813
1849
|
"""
|
|
1814
1850
|
for plugin_name in plugin_names:
|
|
1815
1851
|
plugin_class = getPluginClass(plugin_name)
|
|
1816
|
-
_addPluginCommandLineOptions(
|
|
1852
|
+
_addPluginCommandLineOptions(
|
|
1853
|
+
parser=parser, plugin_class=plugin_class, plugin_help_mode=plugin_help_mode
|
|
1854
|
+
)
|
|
1817
1855
|
|
|
1818
1856
|
|
|
1819
1857
|
def addUserPluginCommandLineOptions(parser, filename):
|
|
1820
1858
|
plugin_class = loadUserPlugin(filename)
|
|
1821
|
-
_addPluginCommandLineOptions(
|
|
1859
|
+
_addPluginCommandLineOptions(
|
|
1860
|
+
parser=parser,
|
|
1861
|
+
plugin_class=plugin_class,
|
|
1862
|
+
# List those user plugins always.
|
|
1863
|
+
plugin_help_mode=True,
|
|
1864
|
+
)
|
|
1822
1865
|
|
|
1823
1866
|
user_plugins.add(plugin_class)
|
|
1824
1867
|
|
nuitka/plugins/YamlPluginBase.py
CHANGED
nuitka/plugins/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
""" Standard plug-in to avoid bloat at compile time.
|
|
@@ -31,6 +31,7 @@ class NuitkaPluginAntiBloat(NuitkaYamlPluginBase):
|
|
|
31
31
|
plugin_desc = (
|
|
32
32
|
"Patch stupid imports out of widely used library modules source codes."
|
|
33
33
|
)
|
|
34
|
+
plugin_category = "core"
|
|
34
35
|
|
|
35
36
|
@staticmethod
|
|
36
37
|
def isAlwaysEnabled():
|
|
@@ -396,42 +397,69 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
|
|
|
396
397
|
|
|
397
398
|
return dict(self.context_codes[context_code])
|
|
398
399
|
|
|
399
|
-
def
|
|
400
|
-
|
|
400
|
+
def _onModuleSourceCodeReplacement(
|
|
401
|
+
self,
|
|
402
|
+
config_module_name,
|
|
403
|
+
module_name,
|
|
404
|
+
source_code,
|
|
405
|
+
config_name,
|
|
406
|
+
extra_context,
|
|
407
|
+
replace_code,
|
|
408
|
+
replace_src,
|
|
409
|
+
):
|
|
410
|
+
if replace_code:
|
|
411
|
+
replace_dst = self.evaluateExpression(
|
|
412
|
+
config_module_name=config_module_name,
|
|
413
|
+
module_name=module_name,
|
|
414
|
+
expression=replace_code,
|
|
415
|
+
config_name="module '%s' config '%s'"
|
|
416
|
+
% (config_module_name, config_name),
|
|
417
|
+
extra_context=extra_context,
|
|
418
|
+
single_value=True,
|
|
419
|
+
)
|
|
420
|
+
else:
|
|
421
|
+
replace_dst = ""
|
|
422
|
+
|
|
423
|
+
return source_code, source_code.replace(replace_src, replace_dst)
|
|
401
424
|
|
|
425
|
+
def _onModuleSourceCode(
|
|
426
|
+
self,
|
|
427
|
+
config_module_name,
|
|
428
|
+
module_name,
|
|
429
|
+
config_prefix,
|
|
430
|
+
anti_bloat_config,
|
|
431
|
+
source_code,
|
|
432
|
+
):
|
|
433
|
+
# Complex dealing with many cases, pylint: disable=too-many-branches,too-many-locals
|
|
402
434
|
description = anti_bloat_config.get("description", "description not given")
|
|
403
435
|
|
|
404
436
|
# To allow detection if it did anything.
|
|
405
437
|
change_count = 0
|
|
406
438
|
|
|
407
439
|
for replace_src, replace_code in (
|
|
408
|
-
anti_bloat_config.get("replacements") or {}
|
|
440
|
+
anti_bloat_config.get(config_prefix + "replacements") or {}
|
|
409
441
|
).items():
|
|
410
442
|
# Avoid the eval, if the replace doesn't hit.
|
|
411
443
|
if replace_src not in source_code:
|
|
412
444
|
continue
|
|
413
445
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
replace_dst = ""
|
|
426
|
-
|
|
427
|
-
old = source_code
|
|
428
|
-
source_code = source_code.replace(replace_src, replace_dst)
|
|
446
|
+
old, source_code = self._onModuleSourceCodeReplacement(
|
|
447
|
+
config_module_name=config_module_name,
|
|
448
|
+
module_name=module_name,
|
|
449
|
+
source_code=source_code,
|
|
450
|
+
config_name=config_prefix + "replacements",
|
|
451
|
+
extra_context=self._getContextCode(
|
|
452
|
+
module_name=module_name, anti_bloat_config=anti_bloat_config
|
|
453
|
+
),
|
|
454
|
+
replace_src=replace_src,
|
|
455
|
+
replace_code=replace_code,
|
|
456
|
+
)
|
|
429
457
|
|
|
430
458
|
if old != source_code:
|
|
431
459
|
change_count += 1
|
|
432
460
|
|
|
433
461
|
for replace_src, replace_dst in (
|
|
434
|
-
anti_bloat_config.get("replacements_plain") or {}
|
|
462
|
+
anti_bloat_config.get(config_prefix + "replacements_plain") or {}
|
|
435
463
|
).items():
|
|
436
464
|
old = source_code
|
|
437
465
|
source_code = source_code.replace(replace_src, replace_dst)
|
|
@@ -440,7 +468,7 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
|
|
|
440
468
|
change_count += 1
|
|
441
469
|
|
|
442
470
|
for replace_src, replace_dst in (
|
|
443
|
-
anti_bloat_config.get("replacements_re") or {}
|
|
471
|
+
anti_bloat_config.get(config_prefix + "replacements_re") or {}
|
|
444
472
|
).items():
|
|
445
473
|
old = source_code
|
|
446
474
|
source_code = re.sub(replace_src, replace_dst, source_code, re.S)
|
|
@@ -450,31 +478,49 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
|
|
|
450
478
|
elif isExperimental("display-anti-bloat-mismatches"):
|
|
451
479
|
self.info("No match in %s no match %r" % (module_name, replace_src))
|
|
452
480
|
|
|
453
|
-
|
|
454
|
-
if
|
|
455
|
-
append_code = "
|
|
481
|
+
# These have no global variants.
|
|
482
|
+
if config_prefix == "":
|
|
483
|
+
append_code = anti_bloat_config.get("append_result", "")
|
|
484
|
+
if type(append_code) in (tuple, list):
|
|
485
|
+
append_code = "\n".join(append_code)
|
|
456
486
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
487
|
+
if append_code:
|
|
488
|
+
append_result = self.evaluateExpression(
|
|
489
|
+
config_module_name=module_name,
|
|
490
|
+
module_name=module_name,
|
|
491
|
+
expression=append_code,
|
|
492
|
+
config_name="module '%s' config 'append_code'" % module_name,
|
|
493
|
+
extra_context=self._getContextCode(
|
|
494
|
+
module_name=module_name, anti_bloat_config=anti_bloat_config
|
|
495
|
+
),
|
|
496
|
+
single_value=True,
|
|
497
|
+
)
|
|
467
498
|
|
|
468
|
-
|
|
469
|
-
|
|
499
|
+
source_code += "\n" + append_result
|
|
500
|
+
change_count += 1
|
|
501
|
+
|
|
502
|
+
append_plain = anti_bloat_config.get("append_plain", "")
|
|
503
|
+
if type(append_plain) in (tuple, list):
|
|
504
|
+
append_plain = "\n".join(append_plain)
|
|
470
505
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
506
|
+
if append_plain:
|
|
507
|
+
source_code += "\n" + append_plain
|
|
508
|
+
change_count += 1
|
|
474
509
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
510
|
+
module_code = anti_bloat_config.get("module_code", None)
|
|
511
|
+
|
|
512
|
+
if module_code is not None:
|
|
513
|
+
# Cannot be mixed.
|
|
514
|
+
assert not change_count
|
|
515
|
+
|
|
516
|
+
if self.show_changes:
|
|
517
|
+
self.info(
|
|
518
|
+
"Handling module '%s' with full replacement : %s."
|
|
519
|
+
% (module_name.asString(), description)
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
source_code = module_code
|
|
523
|
+
change_count = 1
|
|
478
524
|
|
|
479
525
|
if change_count > 0 and self.show_changes:
|
|
480
526
|
self.info(
|
|
@@ -482,31 +528,39 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
|
|
|
482
528
|
% (module_name.asString(), change_count, description)
|
|
483
529
|
)
|
|
484
530
|
|
|
485
|
-
module_code = anti_bloat_config.get("module_code", None)
|
|
486
|
-
|
|
487
|
-
if module_code is not None:
|
|
488
|
-
assert not change_count
|
|
489
|
-
|
|
490
|
-
if self.show_changes:
|
|
491
|
-
self.info(
|
|
492
|
-
"Handling module '%s' with full replacement : %s."
|
|
493
|
-
% (module_name.asString(), description)
|
|
494
|
-
)
|
|
495
|
-
|
|
496
|
-
source_code = module_code
|
|
497
|
-
|
|
498
531
|
return source_code
|
|
499
532
|
|
|
500
533
|
def onModuleSourceCode(self, module_name, source_filename, source_code):
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
534
|
+
config_module_name = module_name
|
|
535
|
+
while True:
|
|
536
|
+
for anti_bloat_config in self.config.get(
|
|
537
|
+
config_module_name, section="anti-bloat"
|
|
504
538
|
):
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
539
|
+
if self.evaluateCondition(
|
|
540
|
+
full_name=config_module_name,
|
|
541
|
+
condition=anti_bloat_config.get("when", "True"),
|
|
542
|
+
):
|
|
543
|
+
if config_module_name == module_name:
|
|
544
|
+
source_code = self._onModuleSourceCode(
|
|
545
|
+
config_module_name=config_module_name,
|
|
546
|
+
module_name=module_name,
|
|
547
|
+
anti_bloat_config=anti_bloat_config,
|
|
548
|
+
config_prefix="",
|
|
549
|
+
source_code=source_code,
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
source_code = self._onModuleSourceCode(
|
|
553
|
+
config_module_name=config_module_name,
|
|
554
|
+
module_name=module_name,
|
|
555
|
+
anti_bloat_config=anti_bloat_config,
|
|
556
|
+
config_prefix="global_",
|
|
557
|
+
source_code=source_code,
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
config_module_name = config_module_name.getPackageName()
|
|
561
|
+
|
|
562
|
+
if not config_module_name:
|
|
563
|
+
break
|
|
510
564
|
|
|
511
565
|
return source_code
|
|
512
566
|
|
|
@@ -525,7 +579,8 @@ Error, cannot exec module '%s', context code '%s' due to: %s"""
|
|
|
525
579
|
return False
|
|
526
580
|
|
|
527
581
|
replacement = self.evaluateExpression(
|
|
528
|
-
|
|
582
|
+
config_module_name=module_name,
|
|
583
|
+
module_name=module_name,
|
|
529
584
|
expression=replace_code,
|
|
530
585
|
config_name="module '%s' config 'change_function' of '%s'"
|
|
531
586
|
% (module_name, function_name),
|
|
@@ -593,7 +648,8 @@ class %(class_name)s:
|
|
|
593
648
|
return False
|
|
594
649
|
|
|
595
650
|
replacement = self.evaluateExpression(
|
|
596
|
-
|
|
651
|
+
config_module_name=module_name,
|
|
652
|
+
module_name=module_name,
|
|
597
653
|
expression=replace_code,
|
|
598
654
|
config_name="module '%s' config 'change_class' of '%s'"
|
|
599
655
|
% (module_name, class_name),
|
|
@@ -708,6 +764,22 @@ class %(class_name)s:
|
|
|
708
764
|
):
|
|
709
765
|
self.no_follows[no_follow_pattern] = (config_of_module_name, description)
|
|
710
766
|
|
|
767
|
+
def _needsWarning(self, key):
|
|
768
|
+
if key in self.warnings_given:
|
|
769
|
+
return False
|
|
770
|
+
|
|
771
|
+
(
|
|
772
|
+
module_name,
|
|
773
|
+
using_module_name,
|
|
774
|
+
line_number,
|
|
775
|
+
) = key
|
|
776
|
+
|
|
777
|
+
for parent_package in module_name.getParentPackageNames():
|
|
778
|
+
if (parent_package, using_module_name, line_number) in self.warnings_given:
|
|
779
|
+
return False
|
|
780
|
+
|
|
781
|
+
return True
|
|
782
|
+
|
|
711
783
|
def onModuleRecursion(
|
|
712
784
|
self,
|
|
713
785
|
module_name,
|
|
@@ -775,7 +847,7 @@ class %(class_name)s:
|
|
|
775
847
|
source_ref.getLineNumber(),
|
|
776
848
|
)
|
|
777
849
|
|
|
778
|
-
if
|
|
850
|
+
if self._needsWarning(key):
|
|
779
851
|
if handled_module_name == intended_module_name:
|
|
780
852
|
handled_module_name_desc = "'%s'" % handled_module_name
|
|
781
853
|
else:
|