Nuitka-winsvc 1.8__cp311-cp311-win_amd64.whl → 2.5.1__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- Nuitka_winsvc-1.8.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.5.1.data/scripts/nuitka-run.cmd +9 -9
- Nuitka_winsvc-1.8.data/scripts/nuitka.bat → Nuitka_winsvc-2.5.1.data/scripts/nuitka.cmd +15 -15
- {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/METADATA +5 -3
- Nuitka_winsvc-2.5.1.dist-info/RECORD +977 -0
- {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +49 -17
- nuitka/BytecodeCaching.py +24 -20
- nuitka/Bytecodes.py +23 -19
- nuitka/CacheCleanup.py +28 -23
- nuitka/Constants.py +19 -17
- nuitka/Errors.py +23 -17
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +209 -116
- nuitka/ModuleRegistry.py +83 -20
- nuitka/OptionParsing.py +467 -221
- nuitka/Options.py +701 -225
- nuitka/OutputDirectories.py +47 -23
- nuitka/PostProcessing.py +133 -79
- nuitka/Progress.py +73 -24
- nuitka/PythonFlavors.py +141 -32
- nuitka/PythonOperators.py +18 -17
- nuitka/PythonVersions.py +107 -19
- nuitka/Serialization.py +70 -55
- nuitka/SourceCodeReferences.py +19 -17
- nuitka/Tracing.py +176 -70
- nuitka/TreeXML.py +31 -26
- nuitka/Variables.py +39 -41
- nuitka/Version.py +22 -8
- nuitka/__init__.py +5 -4
- nuitka/__main__.py +95 -29
- nuitka/__past__.py +44 -34
- nuitka/build/Backend.scons +243 -141
- nuitka/build/CCompilerVersion.scons +45 -31
- nuitka/build/DataComposerInterface.py +20 -17
- nuitka/build/Onefile.scons +56 -54
- nuitka/build/SconsCaching.py +105 -92
- nuitka/build/SconsCompilerSettings.py +167 -68
- nuitka/build/SconsHacks.py +25 -19
- nuitka/build/SconsInterface.py +155 -54
- nuitka/build/SconsProgress.py +19 -18
- nuitka/build/SconsSpawn.py +62 -33
- nuitka/build/SconsUtils.py +152 -55
- nuitka/build/__init__.py +5 -4
- nuitka/build/include/nuitka/allocator.h +228 -22
- nuitka/build/include/nuitka/builtins.h +17 -17
- nuitka/build/include/nuitka/calling.h +24 -24
- nuitka/build/include/nuitka/checkers.h +17 -18
- nuitka/build/include/nuitka/checksum_tools.h +14 -19
- nuitka/build/include/nuitka/compiled_asyncgen.h +28 -25
- nuitka/build/include/nuitka/compiled_cell.h +33 -18
- nuitka/build/include/nuitka/compiled_coroutine.h +18 -18
- nuitka/build/include/nuitka/compiled_frame.h +93 -54
- nuitka/build/include/nuitka/compiled_function.h +42 -20
- nuitka/build/include/nuitka/compiled_generator.h +24 -18
- nuitka/build/include/nuitka/compiled_method.h +17 -18
- nuitka/build/include/nuitka/constants.h +35 -18
- nuitka/build/include/nuitka/constants_blob.h +17 -17
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/environment_variables.h +30 -0
- nuitka/build/include/nuitka/environment_variables_system.h +45 -0
- nuitka/build/include/nuitka/exception_groups.h +23 -26
- nuitka/build/include/nuitka/exceptions.h +717 -171
- nuitka/build/include/nuitka/filesystem_paths.h +26 -20
- nuitka/build/include/nuitka/freelists.h +38 -18
- nuitka/build/include/nuitka/helper/attributes.h +24 -22
- nuitka/build/include/nuitka/helper/boolean.h +17 -17
- nuitka/build/include/nuitka/helper/bytearrays.h +17 -17
- nuitka/build/include/nuitka/helper/bytes.h +14 -15
- nuitka/build/include/nuitka/helper/calling_generated.h +69 -69
- 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/comparisons_eq.h +17 -17
- nuitka/build/include/nuitka/helper/comparisons_ge.h +17 -17
- nuitka/build/include/nuitka/helper/comparisons_gt.h +17 -17
- nuitka/build/include/nuitka/helper/comparisons_le.h +17 -17
- nuitka/build/include/nuitka/helper/comparisons_lt.h +17 -17
- nuitka/build/include/nuitka/helper/comparisons_ne.h +17 -17
- nuitka/build/include/nuitka/helper/complex.h +17 -17
- nuitka/build/include/nuitka/helper/dictionaries.h +89 -51
- nuitka/build/include/nuitka/helper/floats.h +17 -18
- nuitka/build/include/nuitka/helper/import_hard.h +25 -17
- nuitka/build/include/nuitka/helper/indexes.h +17 -18
- nuitka/build/include/nuitka/helper/ints.h +115 -54
- nuitka/build/include/nuitka/helper/iterators.h +99 -51
- nuitka/build/include/nuitka/helper/lists.h +26 -24
- nuitka/build/include/nuitka/helper/lists_generated.h +22 -22
- nuitka/build/include/nuitka/helper/mappings.h +17 -18
- nuitka/build/include/nuitka/helper/operations.h +20 -17
- nuitka/build/include/nuitka/helper/operations_binary_add.h +23 -17
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +17 -17
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +23 -17
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +17 -17
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +20 -17
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +17 -17
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +20 -17
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +17 -17
- nuitka/build/include/nuitka/helper/raising.h +68 -37
- nuitka/build/include/nuitka/helper/rangeobjects.h +17 -17
- nuitka/build/include/nuitka/helper/richcomparisons.h +21 -14
- nuitka/build/include/nuitka/helper/sequences.h +19 -13
- nuitka/build/include/nuitka/helper/sets.h +11 -12
- nuitka/build/include/nuitka/helper/slices.h +31 -25
- nuitka/build/include/nuitka/helper/strings.h +16 -17
- nuitka/build/include/nuitka/helper/subscripts.h +18 -201
- nuitka/build/include/nuitka/helper/tuples.h +64 -52
- nuitka/build/include/nuitka/helpers.h +50 -22
- nuitka/build/include/nuitka/importing.h +28 -21
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +163 -71
- nuitka/build/include/nuitka/printing.h +29 -22
- nuitka/build/include/nuitka/python_pgo.h +19 -18
- nuitka/build/include/nuitka/safe_string_ops.h +20 -18
- nuitka/build/include/nuitka/threading.h +45 -32
- nuitka/build/include/nuitka/tracing.h +28 -18
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +29 -23
- nuitka/build/inline_copy/bin/scons.py +14 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +6 -6
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
- nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -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/inline_copy/tqdm/tqdm/__init__.py +2 -2
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
- nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -8
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +221 -221
- nuitka/build/static_src/CompiledCellType.c +69 -44
- nuitka/build/static_src/CompiledCodeHelpers.c +276 -159
- nuitka/build/static_src/CompiledCoroutineType.c +229 -226
- nuitka/build/static_src/CompiledFrameType.c +323 -138
- nuitka/build/static_src/CompiledFunctionType.c +547 -231
- nuitka/build/static_src/CompiledGeneratorType.c +416 -290
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +593 -228
- nuitka/build/static_src/CompiledMethodType.c +91 -82
- nuitka/build/static_src/HelpersAllocator.c +352 -45
- nuitka/build/static_src/HelpersAttributes.c +30 -72
- nuitka/build/static_src/HelpersBuiltin.c +65 -46
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +17 -17
- nuitka/build/static_src/HelpersBytes.c +19 -20
- nuitka/build/static_src/HelpersCalling.c +40 -37
- nuitka/build/static_src/HelpersCallingGenerated.c +1061 -242
- nuitka/build/static_src/HelpersChecksumTools.c +35 -21
- nuitka/build/static_src/HelpersClasses.c +17 -17
- 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 +536 -496
- nuitka/build/static_src/HelpersComparisonEqUtils.c +22 -19
- nuitka/build/static_src/HelpersComparisonGe.c +531 -501
- nuitka/build/static_src/HelpersComparisonGt.c +530 -500
- nuitka/build/static_src/HelpersComparisonLe.c +531 -501
- nuitka/build/static_src/HelpersComparisonLt.c +530 -500
- nuitka/build/static_src/HelpersComparisonNe.c +538 -496
- nuitka/build/static_src/HelpersConsole.c +122 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +550 -521
- nuitka/build/static_src/HelpersDeepcopy.c +33 -33
- nuitka/build/static_src/HelpersDictionaries.c +232 -63
- nuitka/build/static_src/HelpersDictionariesGenerated.c +130 -127
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +93 -0
- nuitka/build/static_src/HelpersExceptions.c +147 -62
- nuitka/build/static_src/HelpersFiles.c +116 -22
- nuitka/build/static_src/HelpersFilesystemPaths.c +292 -181
- nuitka/build/static_src/HelpersFloats.c +37 -31
- nuitka/build/static_src/HelpersHeapStorage.c +21 -17
- nuitka/build/static_src/HelpersImport.c +61 -29
- nuitka/build/static_src/HelpersImportHard.c +74 -61
- nuitka/build/static_src/HelpersJitSources.c +46 -0
- nuitka/build/static_src/HelpersLists.c +237 -58
- nuitka/build/static_src/HelpersListsGenerated.c +41 -41
- nuitka/build/static_src/HelpersMappings.c +17 -17
- nuitka/build/static_src/HelpersMatching.c +137 -51
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +397 -152
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +102 -52
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +55 -55
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +55 -55
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +55 -55
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +49 -43
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +17 -17
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +55 -49
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +20 -21
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +83 -83
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +25 -24
- nuitka/build/static_src/HelpersOperationBinaryMod.c +129 -117
- nuitka/build/static_src/HelpersOperationBinaryMult.c +98 -82
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +33 -30
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +55 -49
- nuitka/build/static_src/HelpersOperationBinaryPow.c +68 -68
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +12 -12
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +51 -51
- nuitka/build/static_src/HelpersOperationBinarySub.c +309 -88
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +49 -43
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +333 -163
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +24 -22
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +58 -58
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +58 -58
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +58 -58
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +73 -68
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +64 -64
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +38 -37
- nuitka/build/static_src/HelpersOperationInplaceMod.c +145 -140
- nuitka/build/static_src/HelpersOperationInplaceMult.c +89 -84
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +73 -68
- nuitka/build/static_src/HelpersOperationInplacePow.c +82 -82
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +48 -48
- nuitka/build/static_src/HelpersOperationInplaceSub.c +275 -122
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +68 -63
- nuitka/build/static_src/HelpersProfiling.c +25 -24
- nuitka/build/static_src/HelpersPythonPgo.c +22 -22
- nuitka/build/static_src/HelpersRaising.c +296 -283
- nuitka/build/static_src/HelpersSafeStrings.c +34 -22
- nuitka/build/static_src/HelpersSequences.c +18 -19
- nuitka/build/static_src/HelpersSlices.c +29 -23
- nuitka/build/static_src/HelpersStrings.c +235 -38
- nuitka/build/static_src/HelpersTuples.c +46 -34
- nuitka/build/static_src/HelpersTypes.c +166 -25
- nuitka/build/static_src/InspectPatcher.c +108 -27
- nuitka/build/static_src/MainProgram.c +464 -280
- nuitka/build/static_src/MetaPathBasedLoader.c +381 -257
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +39 -26
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +17 -18
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +227 -29
- nuitka/build/static_src/OnefileBootstrap.c +281 -164
- nuitka/build/static_src/OnefileSplashScreen.cpp +51 -27
- nuitka/code_generation/AsyncgenCodes.py +21 -23
- nuitka/code_generation/AttributeCodes.py +31 -27
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +290 -184
- nuitka/code_generation/BranchCodes.py +19 -17
- nuitka/code_generation/BuiltinCodes.py +29 -18
- nuitka/code_generation/CallCodes.py +35 -33
- nuitka/code_generation/ClassCodes.py +19 -17
- nuitka/code_generation/CodeGeneration.py +61 -28
- nuitka/code_generation/CodeHelperSelection.py +20 -18
- nuitka/code_generation/CodeHelpers.py +28 -21
- nuitka/code_generation/CodeObjectCodes.py +36 -26
- nuitka/code_generation/ComparisonCodes.py +51 -22
- nuitka/code_generation/ComparisonHelperDefinitions.py +42 -25
- nuitka/code_generation/ConditionalCodes.py +19 -17
- nuitka/code_generation/ConstantCodes.py +82 -28
- nuitka/code_generation/Contexts.py +180 -42
- nuitka/code_generation/CoroutineCodes.py +21 -23
- nuitka/code_generation/CtypesCodes.py +19 -17
- nuitka/code_generation/DictCodes.py +28 -26
- nuitka/code_generation/Emission.py +21 -18
- nuitka/code_generation/ErrorCodes.py +57 -79
- nuitka/code_generation/EvalCodes.py +24 -20
- nuitka/code_generation/ExceptionCodes.py +182 -104
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +45 -27
- nuitka/code_generation/ExpressionCodes.py +19 -17
- nuitka/code_generation/FrameCodes.py +28 -31
- nuitka/code_generation/FunctionCodes.py +26 -27
- nuitka/code_generation/GeneratorCodes.py +25 -26
- nuitka/code_generation/GlobalConstants.py +51 -25
- nuitka/code_generation/GlobalsLocalsCodes.py +23 -21
- nuitka/code_generation/IdCodes.py +19 -17
- nuitka/code_generation/ImportCodes.py +90 -50
- nuitka/code_generation/Indentation.py +23 -22
- nuitka/code_generation/IndexCodes.py +19 -17
- nuitka/code_generation/InjectCCodes.py +14 -12
- nuitka/code_generation/IntegerCodes.py +19 -17
- nuitka/code_generation/IteratorCodes.py +86 -71
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +19 -17
- nuitka/code_generation/LineNumberCodes.py +20 -20
- nuitka/code_generation/ListCodes.py +32 -36
- nuitka/code_generation/LoaderCodes.py +22 -17
- nuitka/code_generation/LocalsDictCodes.py +56 -32
- nuitka/code_generation/LoopCodes.py +19 -17
- nuitka/code_generation/MatchCodes.py +42 -22
- nuitka/code_generation/ModuleCodes.py +71 -29
- nuitka/code_generation/Namify.py +27 -23
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +80 -51
- nuitka/code_generation/PackageResourceCodes.py +96 -23
- nuitka/code_generation/PrintCodes.py +19 -17
- nuitka/code_generation/PythonAPICodes.py +19 -17
- nuitka/code_generation/RaisingCodes.py +183 -107
- nuitka/code_generation/Reports.py +32 -22
- nuitka/code_generation/ReturnCodes.py +20 -32
- nuitka/code_generation/SetCodes.py +19 -17
- nuitka/code_generation/SliceCodes.py +22 -20
- nuitka/code_generation/StringCodes.py +19 -17
- nuitka/code_generation/SubscriptCodes.py +24 -30
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +31 -41
- nuitka/code_generation/TupleCodes.py +20 -18
- nuitka/code_generation/TypeAliasCodes.py +119 -0
- nuitka/code_generation/VariableCodes.py +118 -55
- nuitka/code_generation/VariableDeclarations.py +28 -25
- nuitka/code_generation/YieldCodes.py +23 -21
- nuitka/code_generation/__init__.py +5 -4
- nuitka/code_generation/c_types/CTypeBases.py +29 -19
- nuitka/code_generation/c_types/CTypeBooleans.py +19 -17
- nuitka/code_generation/c_types/CTypeCFloats.py +19 -17
- nuitka/code_generation/c_types/CTypeCLongs.py +19 -18
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +22 -17
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +22 -21
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +89 -43
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +20 -18
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +43 -31
- nuitka/code_generation/c_types/CTypeVoids.py +20 -17
- nuitka/code_generation/c_types/__init__.py +5 -4
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +20 -19
- nuitka/code_generation/templates/CodeTemplatesConstants.py +143 -39
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +20 -19
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +33 -33
- nuitka/code_generation/templates/CodeTemplatesFrames.py +36 -27
- nuitka/code_generation/templates/CodeTemplatesFunction.py +20 -19
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +21 -19
- nuitka/code_generation/templates/CodeTemplatesIterators.py +19 -53
- nuitka/code_generation/templates/CodeTemplatesLoader.py +25 -19
- nuitka/code_generation/templates/CodeTemplatesModules.py +278 -169
- nuitka/code_generation/templates/CodeTemplatesVariables.py +115 -27
- nuitka/code_generation/templates/TemplateDebugWrapper.py +19 -18
- nuitka/code_generation/templates/__init__.py +5 -4
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +19 -19
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +21 -21
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +79 -28
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +22 -22
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +19 -19
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +19 -19
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +74 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +19 -20
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +19 -19
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +6 -6
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +23 -23
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +35 -35
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +37 -37
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +18 -18
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +50 -38
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +27 -27
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +37 -37
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +35 -31
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +20 -20
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +28 -28
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +48 -48
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +21 -18
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +27 -25
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +17 -17
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +21 -18
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +17 -17
- nuitka/containers/Namedtuples.py +25 -18
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/containers/OrderedSetsFallback.py +19 -17
- nuitka/containers/__init__.py +5 -4
- nuitka/distutils/Build.py +33 -18
- nuitka/distutils/DistutilCommands.py +84 -33
- nuitka/distutils/__init__.py +5 -4
- nuitka/finalizations/Finalization.py +21 -18
- nuitka/finalizations/FinalizeMarkups.py +31 -55
- nuitka/finalizations/__init__.py +5 -4
- nuitka/freezer/DependsExe.py +60 -30
- nuitka/freezer/DllDependenciesCommon.py +47 -20
- nuitka/freezer/DllDependenciesMacOS.py +165 -58
- nuitka/freezer/DllDependenciesPosix.py +29 -19
- nuitka/freezer/DllDependenciesWin32.py +55 -33
- nuitka/freezer/ImportDetection.py +23 -17
- nuitka/freezer/IncludedDataFiles.py +142 -48
- nuitka/freezer/IncludedEntryPoints.py +104 -39
- nuitka/freezer/Onefile.py +32 -22
- nuitka/freezer/Standalone.py +166 -53
- nuitka/freezer/__init__.py +5 -4
- nuitka/importing/IgnoreListing.py +19 -17
- nuitka/importing/ImportCache.py +24 -21
- nuitka/importing/ImportResolving.py +103 -95
- nuitka/importing/Importing.py +319 -98
- nuitka/importing/PreloadedPackages.py +21 -18
- nuitka/importing/Recursion.py +142 -47
- nuitka/importing/StandardLibrary.py +96 -80
- nuitka/importing/__init__.py +5 -4
- nuitka/nodes/AsyncgenNodes.py +22 -23
- nuitka/nodes/AttributeLookupNodes.py +19 -17
- nuitka/nodes/AttributeNodes.py +19 -17
- nuitka/nodes/AttributeNodesGenerated.py +49 -24
- nuitka/nodes/BuiltinAllNodes.py +19 -17
- nuitka/nodes/BuiltinAnyNodes.py +19 -17
- nuitka/nodes/BuiltinComplexNodes.py +20 -17
- nuitka/nodes/BuiltinDecodingNodes.py +19 -17
- nuitka/nodes/BuiltinDecoratorNodes.py +19 -17
- nuitka/nodes/BuiltinDictNodes.py +19 -17
- nuitka/nodes/BuiltinFormatNodes.py +20 -17
- nuitka/nodes/BuiltinHashNodes.py +19 -17
- nuitka/nodes/BuiltinInputNodes.py +19 -17
- nuitka/nodes/BuiltinIntegerNodes.py +19 -17
- nuitka/nodes/BuiltinIteratorNodes.py +25 -21
- nuitka/nodes/BuiltinLenNodes.py +19 -17
- nuitka/nodes/BuiltinNextNodes.py +19 -17
- nuitka/nodes/BuiltinOpenNodes.py +52 -18
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +40 -23
- nuitka/nodes/BuiltinRangeNodes.py +21 -19
- nuitka/nodes/BuiltinRefNodes.py +73 -40
- nuitka/nodes/BuiltinSumNodes.py +20 -18
- nuitka/nodes/BuiltinTypeNodes.py +19 -17
- nuitka/nodes/BuiltinVarsNodes.py +19 -18
- nuitka/nodes/BytesNodes.py +19 -17
- nuitka/nodes/CallNodes.py +19 -17
- nuitka/nodes/Checkers.py +19 -17
- nuitka/nodes/ChildrenHavingMixins.py +1624 -283
- nuitka/nodes/ClassNodes.py +49 -29
- nuitka/nodes/CodeObjectSpecs.py +29 -18
- nuitka/nodes/ComparisonNodes.py +19 -17
- nuitka/nodes/ConditionalNodes.py +24 -25
- nuitka/nodes/ConstantRefNodes.py +57 -17
- nuitka/nodes/ContainerMakingNodes.py +19 -17
- nuitka/nodes/ContainerOperationNodes.py +19 -17
- nuitka/nodes/CoroutineNodes.py +22 -23
- nuitka/nodes/CtypesNodes.py +19 -18
- nuitka/nodes/DictionaryNodes.py +19 -18
- nuitka/nodes/ExceptionNodes.py +131 -43
- nuitka/nodes/ExecEvalNodes.py +19 -17
- nuitka/nodes/ExpressionBases.py +34 -26
- nuitka/nodes/ExpressionBasesGenerated.py +341 -35
- nuitka/nodes/ExpressionShapeMixins.py +19 -17
- nuitka/nodes/FrameNodes.py +41 -28
- nuitka/nodes/FunctionAttributeNodes.py +19 -17
- nuitka/nodes/FunctionNodes.py +84 -38
- nuitka/nodes/FutureSpecs.py +35 -20
- nuitka/nodes/GeneratorNodes.py +24 -25
- nuitka/nodes/GlobalsLocalsNodes.py +22 -17
- nuitka/nodes/HardImportNodesGenerated.py +746 -148
- nuitka/nodes/ImportHardNodes.py +46 -38
- nuitka/nodes/ImportNodes.py +438 -448
- nuitka/nodes/IndicatorMixins.py +19 -17
- nuitka/nodes/InjectCNodes.py +19 -18
- nuitka/nodes/IterationHandles.py +55 -34
- nuitka/nodes/KeyValuePairNodes.py +19 -17
- nuitka/nodes/ListOperationNodes.py +33 -21
- nuitka/nodes/LocalsDictNodes.py +19 -17
- nuitka/nodes/LocalsScopes.py +41 -41
- nuitka/nodes/LoopNodes.py +28 -17
- nuitka/nodes/MatchNodes.py +37 -24
- nuitka/nodes/ModuleAttributeNodes.py +18 -35
- nuitka/nodes/ModuleNodes.py +90 -31
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +73 -44
- nuitka/nodes/NodeMakingHelpers.py +92 -69
- nuitka/nodes/NodeMetaClasses.py +45 -28
- nuitka/nodes/OperatorNodes.py +28 -26
- nuitka/nodes/OperatorNodesUnary.py +148 -20
- nuitka/nodes/OsSysNodes.py +97 -18
- nuitka/nodes/OutlineNodes.py +24 -22
- nuitka/nodes/PackageMetadataNodes.py +37 -27
- nuitka/nodes/PackageResourceNodes.py +29 -23
- nuitka/nodes/PrintNodes.py +19 -17
- nuitka/nodes/ReturnNodes.py +20 -18
- nuitka/nodes/SideEffectNodes.py +19 -17
- nuitka/nodes/SliceNodes.py +20 -18
- nuitka/nodes/StatementBasesGenerated.py +125 -79
- nuitka/nodes/StatementNodes.py +27 -24
- nuitka/nodes/StrNodes.py +19 -17
- nuitka/nodes/StringConcatenationNodes.py +20 -17
- nuitka/nodes/SubscriptNodes.py +27 -25
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +19 -17
- nuitka/nodes/TypeMatchNodes.py +19 -17
- nuitka/nodes/TypeNodes.py +68 -18
- nuitka/nodes/VariableAssignNodes.py +122 -64
- nuitka/nodes/VariableDelNodes.py +19 -17
- nuitka/nodes/VariableNameNodes.py +19 -17
- nuitka/nodes/VariableRefNodes.py +63 -26
- nuitka/nodes/VariableReleaseNodes.py +19 -17
- nuitka/nodes/YieldNodes.py +21 -19
- nuitka/nodes/__init__.py +5 -4
- nuitka/nodes/shapes/BuiltinTypeShapes.py +169 -46
- nuitka/nodes/shapes/ControlFlowDescriptions.py +19 -17
- nuitka/nodes/shapes/ShapeMixins.py +57 -17
- nuitka/nodes/shapes/StandardShapes.py +80 -21
- nuitka/nodes/shapes/__init__.py +5 -4
- nuitka/optimizations/BytecodeDemotion.py +21 -18
- nuitka/optimizations/FunctionInlining.py +22 -23
- nuitka/optimizations/Graphs.py +19 -17
- nuitka/optimizations/Optimization.py +39 -35
- nuitka/optimizations/OptimizeBuiltinCalls.py +31 -27
- nuitka/optimizations/Tags.py +19 -18
- nuitka/optimizations/TraceCollections.py +67 -24
- nuitka/optimizations/ValueTraces.py +92 -25
- nuitka/optimizations/__init__.py +5 -4
- nuitka/pgo/PGO.py +33 -23
- nuitka/pgo/__init__.py +5 -4
- nuitka/plugins/PluginBase.py +655 -112
- nuitka/plugins/Plugins.py +247 -61
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +5 -4
- nuitka/plugins/standard/AntiBloatPlugin.py +374 -135
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +20 -19
- nuitka/plugins/standard/DataFilesPlugin.py +65 -29
- nuitka/plugins/standard/DelvewheelPlugin.py +32 -24
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +256 -0
- nuitka/plugins/standard/DillPlugin.py +42 -134
- nuitka/plugins/standard/DllFilesPlugin.py +125 -42
- nuitka/plugins/standard/EnumPlugin.py +19 -17
- nuitka/plugins/standard/EventletPlugin.py +19 -17
- nuitka/plugins/standard/GeventPlugin.py +19 -17
- nuitka/plugins/standard/GiPlugin.py +44 -28
- nuitka/plugins/standard/GlfwPlugin.py +20 -17
- nuitka/plugins/standard/ImplicitImports.py +403 -54
- nuitka/plugins/standard/KivyPlugin.py +24 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +99 -42
- nuitka/plugins/standard/MultiprocessingPlugin.py +35 -39
- nuitka/plugins/standard/NumpyPlugin.py +19 -17
- nuitka/plugins/standard/OptionsNannyPlugin.py +48 -76
- nuitka/plugins/standard/PbrPlugin.py +21 -19
- nuitka/plugins/standard/PkgResourcesPlugin.py +34 -23
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PmwPlugin.py +30 -27
- nuitka/plugins/standard/PySidePyQtPlugin.py +82 -80
- nuitka/plugins/standard/PywebViewPlugin.py +19 -17
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/TensorflowPlugin.py +20 -17
- nuitka/plugins/standard/TkinterPlugin.py +102 -108
- nuitka/plugins/standard/TorchPlugin.py +20 -17
- nuitka/plugins/standard/TransformersPlugin.py +90 -231
- nuitka/plugins/standard/TrioPlugin.py +18 -15
- nuitka/plugins/standard/UpxPlugin.py +21 -19
- nuitka/plugins/standard/__init__.py +5 -4
- nuitka/plugins/standard/standard.nuitka-package.config.yml +3925 -1293
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +14 -14
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +154 -66
- nuitka/reports/CompilationReportReader.py +79 -0
- nuitka/reports/LicenseReport.rst.j2 +21 -21
- nuitka/reports/Reports.py +363 -76
- nuitka/reports/__init__.py +5 -4
- nuitka/specs/BuiltinBytesOperationSpecs.py +18 -17
- nuitka/specs/BuiltinDictOperationSpecs.py +18 -17
- nuitka/specs/BuiltinListOperationSpecs.py +18 -17
- nuitka/specs/BuiltinParameterSpecs.py +35 -21
- nuitka/specs/BuiltinStrOperationSpecs.py +19 -18
- nuitka/specs/BuiltinTypeOperationSpecs.py +18 -18
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +18 -17
- nuitka/specs/HardImportSpecs.py +74 -22
- nuitka/specs/ParameterSpecs.py +60 -45
- nuitka/specs/__init__.py +5 -4
- nuitka/tools/Basics.py +20 -18
- nuitka/tools/__init__.py +5 -4
- nuitka/tools/commercial/__init__.py +7 -6
- nuitka/tools/data_composer/DataComposer.py +78 -62
- nuitka/tools/data_composer/__init__.py +5 -4
- nuitka/tools/data_composer/__main__.py +18 -17
- nuitka/tools/environments/CreateEnvironment.py +20 -17
- nuitka/tools/environments/Virtualenv.py +60 -32
- nuitka/tools/environments/__init__.py +5 -4
- nuitka/tools/general/__init__.py +5 -4
- nuitka/tools/general/dll_report/__init__.py +5 -4
- nuitka/tools/general/dll_report/__main__.py +29 -22
- nuitka/tools/general/find_module/FindModuleCode.py +35 -22
- nuitka/tools/general/find_module/__init__.py +5 -4
- nuitka/tools/onefile_compressor/OnefileCompressor.py +213 -131
- nuitka/tools/onefile_compressor/__init__.py +5 -4
- nuitka/tools/onefile_compressor/__main__.py +18 -17
- nuitka/tools/podman/Podman.py +19 -17
- nuitka/tools/podman/__init__.py +5 -4
- nuitka/tools/podman/__main__.py +35 -19
- nuitka/tools/profiler/__init__.py +5 -4
- nuitka/tools/profiler/__main__.py +18 -17
- nuitka/tools/scanning/DisplayPackageDLLs.py +47 -22
- nuitka/tools/scanning/DisplayPackageData.py +31 -19
- nuitka/tools/scanning/__init__.py +5 -4
- nuitka/tools/specialize/CTypeDescriptions.py +251 -80
- nuitka/tools/specialize/Common.py +18 -17
- nuitka/tools/specialize/SpecializeC.py +248 -82
- nuitka/tools/specialize/SpecializePython.py +108 -45
- nuitka/tools/specialize/__init__.py +5 -4
- nuitka/tools/testing/Common.py +175 -114
- nuitka/tools/testing/Constructs.py +19 -17
- nuitka/tools/testing/OutputComparison.py +54 -18
- nuitka/tools/testing/Pythons.py +19 -18
- nuitka/tools/testing/RuntimeTracing.py +20 -19
- nuitka/tools/testing/SearchModes.py +26 -20
- nuitka/tools/testing/Valgrind.py +19 -17
- nuitka/tools/testing/__init__.py +5 -4
- nuitka/tools/testing/check_reference_counts/__init__.py +5 -4
- nuitka/tools/testing/check_reference_counts/__main__.py +18 -18
- nuitka/tools/testing/compare_with_cpython/__init__.py +5 -4
- nuitka/tools/testing/compare_with_cpython/__main__.py +39 -30
- nuitka/tools/testing/find_sxs_modules/__init__.py +5 -4
- nuitka/tools/testing/find_sxs_modules/__main__.py +17 -17
- nuitka/tools/testing/measure_construct_performance/__init__.py +5 -4
- nuitka/tools/testing/measure_construct_performance/__main__.py +23 -33
- nuitka/tools/testing/run_nuitka_tests/__init__.py +5 -4
- nuitka/tools/testing/run_nuitka_tests/__main__.py +134 -51
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/__init__.py +5 -4
- nuitka/tools/watch/__main__.py +322 -91
- nuitka/tree/Building.py +184 -182
- nuitka/tree/ComplexCallHelperFunctions.py +84 -58
- nuitka/tree/Extractions.py +19 -17
- nuitka/tree/InternalModule.py +29 -20
- nuitka/tree/Operations.py +19 -17
- nuitka/tree/ReformulationAssertStatements.py +51 -31
- nuitka/tree/ReformulationAssignmentStatements.py +96 -91
- nuitka/tree/ReformulationBooleanExpressions.py +19 -17
- nuitka/tree/ReformulationCallExpressions.py +20 -18
- nuitka/tree/ReformulationClasses.py +45 -39
- nuitka/tree/ReformulationClasses3.py +239 -116
- nuitka/tree/ReformulationComparisonExpressions.py +29 -35
- nuitka/tree/ReformulationContractionExpressions.py +58 -55
- nuitka/tree/ReformulationDictionaryCreation.py +41 -35
- nuitka/tree/ReformulationExecStatements.py +42 -39
- nuitka/tree/ReformulationForLoopStatements.py +30 -34
- nuitka/tree/ReformulationFunctionStatements.py +59 -55
- nuitka/tree/ReformulationImportStatements.py +34 -29
- nuitka/tree/ReformulationLambdaExpressions.py +23 -24
- nuitka/tree/ReformulationMatchStatements.py +246 -92
- nuitka/tree/ReformulationMultidist.py +22 -18
- nuitka/tree/ReformulationNamespacePackages.py +55 -46
- nuitka/tree/ReformulationPrintStatements.py +23 -24
- nuitka/tree/ReformulationSequenceCreation.py +50 -49
- nuitka/tree/ReformulationSubscriptExpressions.py +19 -17
- nuitka/tree/ReformulationTryExceptStatements.py +19 -17
- nuitka/tree/ReformulationTryFinallyStatements.py +34 -17
- nuitka/tree/ReformulationWhileLoopStatements.py +19 -17
- nuitka/tree/ReformulationWithStatements.py +39 -41
- nuitka/tree/ReformulationYieldExpressions.py +44 -24
- nuitka/tree/SourceHandling.py +76 -31
- nuitka/tree/SyntaxErrors.py +19 -17
- nuitka/tree/TreeHelpers.py +33 -20
- nuitka/tree/VariableClosure.py +35 -39
- nuitka/tree/__init__.py +5 -4
- nuitka/utils/AppDirs.py +41 -20
- nuitka/utils/CStrings.py +66 -21
- nuitka/utils/CommandLineOptions.py +111 -22
- nuitka/utils/Distributions.py +445 -54
- nuitka/utils/Download.py +89 -57
- nuitka/utils/Execution.py +102 -58
- nuitka/utils/FileOperations.py +357 -128
- nuitka/utils/Hashing.py +55 -33
- nuitka/utils/Images.py +26 -19
- nuitka/utils/Importing.py +119 -37
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +85 -75
- nuitka/utils/InstanceCounters.py +20 -17
- nuitka/utils/Jinja2.py +30 -22
- nuitka/utils/Json.py +21 -19
- nuitka/utils/MacOSApp.py +26 -18
- nuitka/utils/MemoryUsage.py +20 -18
- nuitka/utils/ModuleNames.py +42 -26
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +50 -28
- nuitka/utils/Rest.py +20 -17
- nuitka/utils/SharedLibraries.py +161 -75
- nuitka/utils/Shebang.py +20 -17
- nuitka/utils/Signing.py +63 -18
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +83 -56
- nuitka/utils/ThreadedExecutor.py +18 -17
- nuitka/utils/Timing.py +22 -20
- nuitka/utils/Utils.py +132 -25
- nuitka/utils/WindowsFileUsage.py +22 -20
- nuitka/utils/WindowsResources.py +25 -18
- nuitka/utils/Yaml.py +62 -24
- nuitka/utils/__init__.py +5 -4
- Nuitka_winsvc-1.8.dist-info/RECORD +0 -905
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
- nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
- {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-1.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/top_level.txt +0 -0
nuitka/Options.py
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
# Copyright
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# integrates with CPython, but also works on its own.
|
|
5
|
-
#
|
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
# you may not use this file except in compliance with the License.
|
|
8
|
-
# You may obtain a copy of the License at
|
|
9
|
-
#
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
#
|
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
# See the License for the specific language governing permissions and
|
|
16
|
-
# limitations under the License.
|
|
17
|
-
#
|
|
1
|
+
# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
|
|
18
4
|
""" Options module
|
|
19
5
|
|
|
20
6
|
This exposes the choices made by the user. Defaults will be applied here, and
|
|
@@ -34,13 +20,25 @@ import sys
|
|
|
34
20
|
|
|
35
21
|
from nuitka import Progress, Tracing
|
|
36
22
|
from nuitka.containers.OrderedDicts import OrderedDict
|
|
37
|
-
from nuitka.containers.OrderedSets import
|
|
38
|
-
|
|
23
|
+
from nuitka.containers.OrderedSets import (
|
|
24
|
+
OrderedSet,
|
|
25
|
+
recommended_orderedset_package_name,
|
|
26
|
+
)
|
|
27
|
+
from nuitka.importing.StandardLibrary import isStandardLibraryPath
|
|
28
|
+
from nuitka.OptionParsing import (
|
|
29
|
+
parseOptions,
|
|
30
|
+
run_time_variable_names,
|
|
31
|
+
runSpecialCommandsFromOptions,
|
|
32
|
+
)
|
|
39
33
|
from nuitka.PythonFlavors import (
|
|
40
34
|
getPythonFlavorName,
|
|
41
35
|
isAnacondaPython,
|
|
42
36
|
isApplePython,
|
|
37
|
+
isArchPackagePython,
|
|
38
|
+
isCPythonOfficialPackage,
|
|
43
39
|
isDebianPackagePython,
|
|
40
|
+
isHomebrewPython,
|
|
41
|
+
isManyLinuxPython,
|
|
44
42
|
isMSYS2MingwPython,
|
|
45
43
|
isNuitkaPython,
|
|
46
44
|
isPyenvPython,
|
|
@@ -48,24 +46,31 @@ from nuitka.PythonFlavors import (
|
|
|
48
46
|
isUninstalledPython,
|
|
49
47
|
)
|
|
50
48
|
from nuitka.PythonVersions import (
|
|
49
|
+
getLaunchingSystemPrefixPath,
|
|
51
50
|
getNotYetSupportedPythonVersions,
|
|
52
51
|
getSupportedPythonVersions,
|
|
53
52
|
isDebugPython,
|
|
53
|
+
isPythonWithGil,
|
|
54
54
|
python_version,
|
|
55
55
|
python_version_str,
|
|
56
56
|
)
|
|
57
57
|
from nuitka.utils.Execution import getExecutablePath
|
|
58
58
|
from nuitka.utils.FileOperations import (
|
|
59
|
+
getNormalizedPath,
|
|
60
|
+
isLegalPath,
|
|
59
61
|
isPathExecutable,
|
|
60
62
|
openTextFile,
|
|
61
63
|
resolveShellPatternToFilenames,
|
|
62
64
|
)
|
|
63
65
|
from nuitka.utils.Images import checkIconUsage
|
|
66
|
+
from nuitka.utils.Importing import getInlineCopyFolder
|
|
64
67
|
from nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath
|
|
65
68
|
from nuitka.utils.Utils import (
|
|
66
69
|
getArchitecture,
|
|
67
70
|
getCPUCoreCount,
|
|
71
|
+
getLaunchingNuitkaProcessEnvironmentValue,
|
|
68
72
|
getLinuxDistribution,
|
|
73
|
+
getMacOSRelease,
|
|
69
74
|
getOS,
|
|
70
75
|
getWindowsRelease,
|
|
71
76
|
hasOnefileSupportedOS,
|
|
@@ -88,75 +93,137 @@ is_nuitka_run = None
|
|
|
88
93
|
is_debug = None
|
|
89
94
|
is_non_debug = None
|
|
90
95
|
is_full_compat = None
|
|
91
|
-
|
|
96
|
+
report_missing_code_helpers = None
|
|
97
|
+
report_missing_trust = None
|
|
92
98
|
is_verbose = None
|
|
93
99
|
|
|
94
100
|
|
|
101
|
+
def _convertOldStylePathSpecQuotes(value):
|
|
102
|
+
quote = None
|
|
103
|
+
|
|
104
|
+
result = ""
|
|
105
|
+
for c in value:
|
|
106
|
+
if c == "%":
|
|
107
|
+
if quote is None:
|
|
108
|
+
quote = "{"
|
|
109
|
+
result += quote
|
|
110
|
+
elif quote == "{":
|
|
111
|
+
result += "}"
|
|
112
|
+
quote = None
|
|
113
|
+
else:
|
|
114
|
+
result += c
|
|
115
|
+
|
|
116
|
+
return result
|
|
117
|
+
|
|
118
|
+
|
|
95
119
|
def checkPathSpec(value, arg_name, allow_disable):
|
|
96
120
|
# There are never enough checks here, pylint: disable=too-many-branches
|
|
121
|
+
old = value
|
|
122
|
+
value = _convertOldStylePathSpecQuotes(value)
|
|
123
|
+
if old != value:
|
|
124
|
+
Tracing.options_logger.warning(
|
|
125
|
+
"Adapted '%s' option value from legacy quoting style to '%s' -> '%s'"
|
|
126
|
+
% (arg_name, old, value)
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# This changes the '/' to '\' on Windows at least.
|
|
130
|
+
value = getNormalizedPath(value)
|
|
131
|
+
|
|
132
|
+
if "\n" in value or "\r" in value:
|
|
133
|
+
Tracing.options_logger.sysexit(
|
|
134
|
+
"Using a new line in value '%s=%r' value is not allowed."
|
|
135
|
+
% (arg_name, value)
|
|
136
|
+
)
|
|
97
137
|
|
|
98
|
-
if "
|
|
138
|
+
if "{NONE}" in value:
|
|
99
139
|
if not allow_disable:
|
|
100
140
|
Tracing.options_logger.sysexit(
|
|
101
|
-
"Using value '
|
|
141
|
+
"Using value '{NONE}' in '%s=%s' value is not allowed."
|
|
102
142
|
% (arg_name, value)
|
|
103
143
|
)
|
|
104
144
|
|
|
105
|
-
if value != "
|
|
145
|
+
if value != "{NONE}":
|
|
106
146
|
Tracing.options_logger.sysexit(
|
|
107
|
-
"Using value '
|
|
147
|
+
"Using value '{NONE}' in '%s=%s' value does not allow anything else used too."
|
|
108
148
|
% (arg_name, value)
|
|
109
149
|
)
|
|
110
150
|
|
|
111
|
-
if "
|
|
151
|
+
if "{NULL}" in value:
|
|
112
152
|
if not allow_disable:
|
|
113
153
|
Tracing.options_logger.sysexit(
|
|
114
|
-
"Using value '
|
|
154
|
+
"Using value '{NULL}' in '%s=%s' value is not allowed."
|
|
115
155
|
% (arg_name, value)
|
|
116
156
|
)
|
|
117
157
|
|
|
118
|
-
if value != "
|
|
158
|
+
if value != "{NULL}":
|
|
119
159
|
Tracing.options_logger.sysexit(
|
|
120
|
-
"Using value '
|
|
160
|
+
"Using value '{NULL}' in '%s=%s' value does not allow anything else used too."
|
|
121
161
|
% (arg_name, value)
|
|
122
162
|
)
|
|
123
163
|
|
|
124
|
-
if "
|
|
164
|
+
if "{COMPANY}" in value and not getCompanyName():
|
|
125
165
|
Tracing.options_logger.sysexit(
|
|
126
|
-
"Using value '
|
|
166
|
+
"Using value '{COMPANY}' in '%s=%s' value without being specified."
|
|
127
167
|
% (arg_name, value)
|
|
128
168
|
)
|
|
129
169
|
|
|
130
|
-
if "
|
|
170
|
+
if "{PRODUCT}" in value and not getProductName():
|
|
131
171
|
Tracing.options_logger.sysexit(
|
|
132
|
-
"Using value '
|
|
172
|
+
"Using value '{PRODUCT}' in '%s=%s' value without being specified."
|
|
133
173
|
% (arg_name, value)
|
|
134
174
|
)
|
|
135
175
|
|
|
136
|
-
if "
|
|
176
|
+
if "{VERSION}" in value and not (getFileVersionTuple() or getProductVersionTuple()):
|
|
137
177
|
Tracing.options_logger.sysexit(
|
|
138
|
-
"Using value '
|
|
178
|
+
"Using value '{VERSION}' in '%s=%s' value without being specified."
|
|
139
179
|
% (arg_name, value)
|
|
140
180
|
)
|
|
141
181
|
|
|
142
|
-
if value.count("
|
|
143
|
-
Tracing.options_logger.
|
|
144
|
-
"""Unmatched '
|
|
145
|
-
not do what you want it to do."""
|
|
182
|
+
if value.count("{") != value.count("}"):
|
|
183
|
+
Tracing.options_logger.sysexit(
|
|
184
|
+
"""Unmatched '{}' is wrong for '%s=%s' and may \
|
|
185
|
+
definitely not do what you want it to do."""
|
|
146
186
|
% (arg_name, value)
|
|
147
187
|
)
|
|
148
188
|
|
|
189
|
+
# Catch nested or illegal variable names.
|
|
190
|
+
var_name = None
|
|
191
|
+
for c in value:
|
|
192
|
+
if c in "{":
|
|
193
|
+
if var_name is not None:
|
|
194
|
+
Tracing.options_logger.sysexit(
|
|
195
|
+
"""Nested '{' is wrong for '%s=%s'.""" % (arg_name, value)
|
|
196
|
+
)
|
|
197
|
+
var_name = ""
|
|
198
|
+
elif c == "}":
|
|
199
|
+
if var_name is None:
|
|
200
|
+
Tracing.options_logger.sysexit(
|
|
201
|
+
"""Stray '}' is wrong for '%s=%s'.""" % (arg_name, value)
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
if var_name not in run_time_variable_names:
|
|
205
|
+
Tracing.onefile_logger.sysexit(
|
|
206
|
+
"Found unknown variable name '%s' in for '%s=%s'."
|
|
207
|
+
"" % (var_name, arg_name, value)
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
var_name = None
|
|
211
|
+
else:
|
|
212
|
+
if var_name is not None:
|
|
213
|
+
var_name += c
|
|
214
|
+
|
|
149
215
|
for candidate in (
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
216
|
+
"{PROGRAM}",
|
|
217
|
+
"{PROGRAM_BASE}",
|
|
218
|
+
"{CACHE_DIR}",
|
|
219
|
+
"{HOME}",
|
|
220
|
+
"{TEMP}",
|
|
155
221
|
):
|
|
156
222
|
if candidate in value[1:]:
|
|
157
223
|
Tracing.options_logger.sysexit(
|
|
158
|
-
"""
|
|
159
|
-
|
|
224
|
+
"""\
|
|
225
|
+
Absolute run time paths of '%s' can only be at the start of \
|
|
226
|
+
'%s=%s', using it in the middle of it is not allowed."""
|
|
160
227
|
% (candidate, arg_name, value)
|
|
161
228
|
)
|
|
162
229
|
|
|
@@ -167,9 +234,27 @@ start of '%s=%s', using that alone is not allowed."""
|
|
|
167
234
|
% (candidate, arg_name, value)
|
|
168
235
|
)
|
|
169
236
|
|
|
237
|
+
if value.startswith(candidate):
|
|
238
|
+
if value[len(candidate)] != os.path.sep:
|
|
239
|
+
Tracing.options_logger.sysexit(
|
|
240
|
+
"""Cannot use general system folder %s, without a path \
|
|
241
|
+
separator '%s=%s', just appending to these is not allowed, needs to be \
|
|
242
|
+
below them."""
|
|
243
|
+
% (candidate, arg_name, value)
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
is_legal, reason = isLegalPath(value)
|
|
247
|
+
if not is_legal:
|
|
248
|
+
Tracing.options_logger.sysexit(
|
|
249
|
+
"""Cannot use illegal paths '%s=%s', due to %s."""
|
|
250
|
+
% (arg_name, value, reason)
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
return value
|
|
254
|
+
|
|
170
255
|
|
|
171
256
|
def _checkOnefileTargetSpec():
|
|
172
|
-
checkPathSpec(
|
|
257
|
+
options.onefile_tempdir_spec = checkPathSpec(
|
|
173
258
|
options.onefile_tempdir_spec,
|
|
174
259
|
arg_name="--onefile-tempdir-spec",
|
|
175
260
|
allow_disable=False,
|
|
@@ -183,7 +268,7 @@ you cannot unpack the onefile payload into the same directory as the binary,
|
|
|
183
268
|
as that would overwrite it and cause locking issues as well."""
|
|
184
269
|
)
|
|
185
270
|
|
|
186
|
-
if options.onefile_tempdir_spec.count("
|
|
271
|
+
if options.onefile_tempdir_spec.count("{") == 0:
|
|
187
272
|
Tracing.options_logger.warning(
|
|
188
273
|
"""Not using any variables for '--onefile-tempdir-spec' should only be \
|
|
189
274
|
done if your program absolutely needs to be in the same path always: '%s'"""
|
|
@@ -192,16 +277,20 @@ done if your program absolutely needs to be in the same path always: '%s'"""
|
|
|
192
277
|
|
|
193
278
|
if os.path.isabs(options.onefile_tempdir_spec):
|
|
194
279
|
Tracing.options_logger.warning(
|
|
195
|
-
"""
|
|
196
|
-
|
|
280
|
+
"""\
|
|
281
|
+
Using an absolute path should be avoided unless you are targeting a \
|
|
282
|
+
very well known environment: anchoring it with e.g. '{TEMP}', \
|
|
283
|
+
'{CACHE_DIR}' is recommended: You seemingly gave the value '%s'"""
|
|
197
284
|
% options.onefile_tempdir_spec
|
|
198
285
|
)
|
|
199
286
|
elif not options.onefile_tempdir_spec.startswith(
|
|
200
|
-
("
|
|
287
|
+
("{TEMP}", "{HOME}", "{CACHE_DIR}")
|
|
201
288
|
):
|
|
202
289
|
Tracing.options_logger.warning(
|
|
203
|
-
"""
|
|
204
|
-
|
|
290
|
+
"""\
|
|
291
|
+
Using a relative to the onefile executable should be avoided \
|
|
292
|
+
unless you are targeting a very well known environment, anchoring \
|
|
293
|
+
it with e.g. '{TEMP}', '{CACHE_DIR}' is recommended: '%s'"""
|
|
205
294
|
% options.onefile_tempdir_spec
|
|
206
295
|
)
|
|
207
296
|
|
|
@@ -213,6 +302,8 @@ def _getVersionInformationValues():
|
|
|
213
302
|
yield "Commercial: %s" % getCommercialVersion()
|
|
214
303
|
yield "Python: %s" % sys.version.split("\n", 1)[0]
|
|
215
304
|
yield "Flavor: %s" % getPythonFlavorName()
|
|
305
|
+
if python_version >= 0x3D0:
|
|
306
|
+
yield "GIL: %s" % ("yes" if isPythonWithGil() else "no")
|
|
216
307
|
yield "Executable: %s" % sys.executable
|
|
217
308
|
yield "OS: %s" % getOS()
|
|
218
309
|
yield "Arch: %s" % getArchitecture()
|
|
@@ -232,6 +323,9 @@ def _getVersionInformationValues():
|
|
|
232
323
|
if isWin32OrPosixWindows():
|
|
233
324
|
yield "WindowsRelease: %s" % getWindowsRelease()
|
|
234
325
|
|
|
326
|
+
if isMacOS():
|
|
327
|
+
yield "macOSRelease: %s" % getMacOSRelease()
|
|
328
|
+
|
|
235
329
|
|
|
236
330
|
def printVersionInformation():
|
|
237
331
|
print("\n".join(_getVersionInformationValues()))
|
|
@@ -252,6 +346,38 @@ def printVersionInformation():
|
|
|
252
346
|
)
|
|
253
347
|
|
|
254
348
|
|
|
349
|
+
def _warnOnefileOnlyOption(option_name):
|
|
350
|
+
if not options.is_onefile:
|
|
351
|
+
Tracing.options_logger.warning(
|
|
352
|
+
"""\
|
|
353
|
+
Using onefile specific option '%s' has no effect \
|
|
354
|
+
when '--onefile' is not specified."""
|
|
355
|
+
% option_name
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
def _checkDataDirOptionValue(data_dir, option_name):
|
|
360
|
+
if "=" not in data_dir:
|
|
361
|
+
Tracing.options_logger.sysexit(
|
|
362
|
+
"Error, malformed '%s' value '%s' description, must specify a relative target path with '=' separating it."
|
|
363
|
+
% (option_name, data_dir)
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
src, dst = data_dir.split("=", 1)
|
|
367
|
+
|
|
368
|
+
if os.path.isabs(dst):
|
|
369
|
+
Tracing.options_logger.sysexit(
|
|
370
|
+
"Error, malformed '%s' value, must specify relative target path for data dir, not '%s' as in '%s'."
|
|
371
|
+
% (option_name, dst, data_dir)
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
if not os.path.isdir(src):
|
|
375
|
+
Tracing.options_logger.sysexit(
|
|
376
|
+
"Error, malformed '%s' value, must specify existing source data directory, not '%s' as in '%s'."
|
|
377
|
+
% (option_name, dst, data_dir)
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
|
|
255
381
|
def parseArgs():
|
|
256
382
|
"""Parse the command line arguments
|
|
257
383
|
|
|
@@ -260,7 +386,7 @@ def parseArgs():
|
|
|
260
386
|
# singleton with many cases checking the options right away.
|
|
261
387
|
# pylint: disable=global-statement,too-many-branches,too-many-locals,too-many-statements
|
|
262
388
|
global is_nuitka_run, options, positional_args, extra_args, is_debug, is_non_debug
|
|
263
|
-
global is_full_compat,
|
|
389
|
+
global is_full_compat, report_missing_code_helpers, report_missing_trust, is_verbose
|
|
264
390
|
|
|
265
391
|
if os.name == "nt":
|
|
266
392
|
# Windows store Python's don't allow looking at the python, catch that.
|
|
@@ -271,7 +397,7 @@ def parseArgs():
|
|
|
271
397
|
Tracing.general.sysexit(
|
|
272
398
|
"""\
|
|
273
399
|
Error, the Python from Windows app store is not supported.""",
|
|
274
|
-
mnemonic="unsupported-python",
|
|
400
|
+
mnemonic="unsupported-windows-app-store-python",
|
|
275
401
|
)
|
|
276
402
|
|
|
277
403
|
is_nuitka_run, options, positional_args, extra_args = parseOptions(
|
|
@@ -293,10 +419,10 @@ Error, the Python from Windows app store is not supported.""",
|
|
|
293
419
|
if getattr(options, "disable_dll_dependency_cache", False):
|
|
294
420
|
options.disabled_caches.append("dll-dependencies")
|
|
295
421
|
|
|
296
|
-
|
|
297
|
-
|
|
422
|
+
report_missing_code_helpers = options.report_missing_code_helpers
|
|
423
|
+
report_missing_trust = options.report_missing_trust
|
|
298
424
|
|
|
299
|
-
if options.quiet or int(os.
|
|
425
|
+
if options.quiet or int(os.getenv("NUITKA_QUIET", "0")):
|
|
300
426
|
Tracing.setQuiet()
|
|
301
427
|
|
|
302
428
|
def _quoteArg(arg):
|
|
@@ -310,17 +436,26 @@ Error, the Python from Windows app store is not supported.""",
|
|
|
310
436
|
else:
|
|
311
437
|
return arg
|
|
312
438
|
|
|
439
|
+
# This will not return if a non-compiling command is given.
|
|
440
|
+
runSpecialCommandsFromOptions(options)
|
|
441
|
+
|
|
313
442
|
if not options.version:
|
|
314
443
|
Tracing.options_logger.info(
|
|
315
444
|
"Used command line options: %s"
|
|
316
445
|
% " ".join(_quoteArg(arg) for arg in sys.argv[1:])
|
|
317
446
|
)
|
|
318
447
|
|
|
319
|
-
if
|
|
448
|
+
if (
|
|
449
|
+
getLaunchingNuitkaProcessEnvironmentValue("NUITKA_RE_EXECUTION")
|
|
450
|
+
and not isAllowedToReexecute()
|
|
451
|
+
):
|
|
320
452
|
Tracing.general.sysexit(
|
|
321
453
|
"Error, not allowed to re-execute, but that has happened."
|
|
322
454
|
)
|
|
323
455
|
|
|
456
|
+
# Force to persist this one early.
|
|
457
|
+
getLaunchingSystemPrefixPath()
|
|
458
|
+
|
|
324
459
|
if options.progress_bar:
|
|
325
460
|
Progress.enableProgressBar()
|
|
326
461
|
|
|
@@ -358,11 +493,52 @@ Error, the Python from Windows app store is not supported.""",
|
|
|
358
493
|
|
|
359
494
|
Tracing.progress_logger.is_quiet = not options.show_progress
|
|
360
495
|
|
|
496
|
+
if options.compilation_mode is not None:
|
|
497
|
+
if options.is_onefile or options.is_standalone or options.module_mode:
|
|
498
|
+
Tracing.options_logger.sysexit(
|
|
499
|
+
"Cannot use both '--mode=' and deprecated options that specify mode."
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
if options.compilation_mode == "onefile":
|
|
503
|
+
options.is_onefile = True
|
|
504
|
+
elif options.compilation_mode == "standalone":
|
|
505
|
+
options.is_standalone = True
|
|
506
|
+
elif options.compilation_mode == "module":
|
|
507
|
+
options.module_mode = True
|
|
508
|
+
|
|
361
509
|
# Onefile implies standalone build.
|
|
362
510
|
if options.is_onefile:
|
|
363
511
|
options.is_standalone = True
|
|
364
512
|
|
|
365
|
-
#
|
|
513
|
+
# macOS bundle implies standalone build.
|
|
514
|
+
if shallCreateAppBundle():
|
|
515
|
+
options.is_standalone = True
|
|
516
|
+
|
|
517
|
+
if isMacOS():
|
|
518
|
+
macos_target_arch = getMacOSTargetArch()
|
|
519
|
+
|
|
520
|
+
if macos_target_arch == "universal":
|
|
521
|
+
Tracing.options_logger.sysexit(
|
|
522
|
+
"Cannot create universal macOS binaries (yet), please pick an arch and create two binaries."
|
|
523
|
+
)
|
|
524
|
+
|
|
525
|
+
if (options.macos_target_arch or "native") != "native":
|
|
526
|
+
from nuitka.utils.SharedLibraries import (
|
|
527
|
+
hasUniversalOrMatchingMacOSArchitecture,
|
|
528
|
+
)
|
|
529
|
+
|
|
530
|
+
if not hasUniversalOrMatchingMacOSArchitecture(
|
|
531
|
+
os.path.realpath(sys.executable)
|
|
532
|
+
):
|
|
533
|
+
Tracing.options_logger.sysexit(
|
|
534
|
+
"""\
|
|
535
|
+
Cannot cross compile to other arch, using non-universal Python binaries \
|
|
536
|
+
for macOS. Please install the "universal" Python package as offered on \
|
|
537
|
+
the Python download page."""
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
# Standalone implies no_site build unless overridden, therefore put it
|
|
541
|
+
# at start of flags, so "site" can override it.
|
|
366
542
|
if options.is_standalone:
|
|
367
543
|
options.python_flags.insert(0, "no_site")
|
|
368
544
|
|
|
@@ -370,12 +546,7 @@ Error, the Python from Windows app store is not supported.""",
|
|
|
370
546
|
if options.onefile_tempdir_spec:
|
|
371
547
|
_checkOnefileTargetSpec()
|
|
372
548
|
|
|
373
|
-
|
|
374
|
-
Tracing.options_logger.warning(
|
|
375
|
-
"""\
|
|
376
|
-
Using onefile specific option '--onefile-windows-splash-screen-image' has no effect \
|
|
377
|
-
when '--onefile' is not specified."""
|
|
378
|
-
)
|
|
549
|
+
_warnOnefileOnlyOption("--onefile-tempdir-spec")
|
|
379
550
|
|
|
380
551
|
# Check onefile splash image
|
|
381
552
|
if options.splash_screen_image:
|
|
@@ -385,34 +556,27 @@ when '--onefile' is not specified."""
|
|
|
385
556
|
% options.splash_screen_image
|
|
386
557
|
)
|
|
387
558
|
|
|
388
|
-
|
|
389
|
-
Tracing.options_logger.warning(
|
|
390
|
-
"""\
|
|
391
|
-
Using onefile specific option '--onefile-windows-splash-screen-image' has no effect \
|
|
392
|
-
when '--onefile' is not specified."""
|
|
393
|
-
)
|
|
559
|
+
_warnOnefileOnlyOption("--onefile-windows-splash-screen-image")
|
|
394
560
|
|
|
395
561
|
if options.onefile_child_grace_time is not None:
|
|
396
562
|
if not options.onefile_child_grace_time.isdigit():
|
|
397
563
|
Tracing.options_logger.sysexit(
|
|
398
564
|
"""\
|
|
399
|
-
Error, value given for '--onefile-child-grace-time' must be integer."""
|
|
565
|
+
Error, the value given for '--onefile-child-grace-time' must be integer."""
|
|
400
566
|
)
|
|
401
567
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
when '--onefile-child-grace-time' is not specified."""
|
|
407
|
-
)
|
|
568
|
+
_warnOnefileOnlyOption("--onefile-child-grace-time")
|
|
569
|
+
|
|
570
|
+
if getShallIncludeExternallyDataFilePatterns():
|
|
571
|
+
_warnOnefileOnlyOption("--include-onefile-external-data")
|
|
408
572
|
|
|
409
573
|
if options.force_stdout_spec:
|
|
410
|
-
checkPathSpec(
|
|
574
|
+
options.force_stdout_spec = checkPathSpec(
|
|
411
575
|
options.force_stdout_spec, "--force-stdout-spec", allow_disable=True
|
|
412
576
|
)
|
|
413
577
|
|
|
414
578
|
if options.force_stderr_spec:
|
|
415
|
-
checkPathSpec(
|
|
579
|
+
options.force_stderr_spec = checkPathSpec(
|
|
416
580
|
options.force_stderr_spec, "--force-stderr-spec", allow_disable=True
|
|
417
581
|
)
|
|
418
582
|
|
|
@@ -504,18 +668,18 @@ it before using it: '%s' (from --output-filename='%s')."""
|
|
|
504
668
|
)
|
|
505
669
|
|
|
506
670
|
if isLinux():
|
|
507
|
-
if len(
|
|
671
|
+
if len(getLinuxIconPaths()) > 1:
|
|
508
672
|
Tracing.options_logger.sysexit(
|
|
509
673
|
"Error, can only use one icon file on Linux."
|
|
510
674
|
)
|
|
511
675
|
|
|
512
676
|
if isMacOS():
|
|
513
|
-
if len(
|
|
677
|
+
if len(getMacOSIconPaths()) > 1:
|
|
514
678
|
Tracing.options_logger.sysexit(
|
|
515
679
|
"Error, can only use one icon file on macOS."
|
|
516
680
|
)
|
|
517
681
|
|
|
518
|
-
for icon_path in
|
|
682
|
+
for icon_path in getWindowsIconPaths():
|
|
519
683
|
if "#" in icon_path and isWin32Windows():
|
|
520
684
|
icon_path, icon_index = icon_path.rsplit("#", 1)
|
|
521
685
|
|
|
@@ -525,13 +689,6 @@ it before using it: '%s' (from --output-filename='%s')."""
|
|
|
525
689
|
% (icon_path + "#" + icon_index)
|
|
526
690
|
)
|
|
527
691
|
|
|
528
|
-
if not os.path.exists(icon_path):
|
|
529
|
-
Tracing.options_logger.sysexit(
|
|
530
|
-
"Error, icon path '%s' does not exist." % icon_path
|
|
531
|
-
)
|
|
532
|
-
|
|
533
|
-
checkIconUsage(logger=Tracing.options_logger, icon_path=icon_path)
|
|
534
|
-
|
|
535
692
|
if getWindowsIconExecutablePath():
|
|
536
693
|
Tracing.options_logger.sysexit(
|
|
537
694
|
"Error, can only use icons from template executable or from icon files, but not both."
|
|
@@ -543,13 +700,8 @@ it before using it: '%s' (from --output-filename='%s')."""
|
|
|
543
700
|
"Error, icon path executable '%s' does not exist." % icon_exe_path
|
|
544
701
|
)
|
|
545
702
|
|
|
546
|
-
if isMacOS() and not shallCreateAppBundle() and shallDisableConsoleWindow():
|
|
547
|
-
Tracing.options_logger.sysexit(
|
|
548
|
-
"Error, cannot disable console unless also using '--macos-create-app-bundle'."
|
|
549
|
-
)
|
|
550
|
-
|
|
551
703
|
try:
|
|
552
|
-
file_version =
|
|
704
|
+
file_version = getFileVersionTuple()
|
|
553
705
|
# Catch all the things, don't want any interface, pylint: disable=broad-except
|
|
554
706
|
except Exception:
|
|
555
707
|
Tracing.options_logger.sysexit(
|
|
@@ -557,7 +709,7 @@ it before using it: '%s' (from --output-filename='%s')."""
|
|
|
557
709
|
)
|
|
558
710
|
|
|
559
711
|
try:
|
|
560
|
-
product_version =
|
|
712
|
+
product_version = getProductVersionTuple()
|
|
561
713
|
# Catch all the things, don't want any interface, pylint: disable=broad-except
|
|
562
714
|
except Exception:
|
|
563
715
|
Tracing.options_logger.sysexit(
|
|
@@ -639,18 +791,20 @@ it before using it: '%s' (from --output-filename='%s')."""
|
|
|
639
791
|
|
|
640
792
|
if data_file_desc.count("=") == 1:
|
|
641
793
|
src, dst = data_file_desc.split("=", 1)
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
if len(filenames) > 1 and not dst.endswith(("/", os.path.sep)):
|
|
646
|
-
Tracing.options_logger.sysexit(
|
|
647
|
-
"Error, pattern '%s' matches more than one file, but target has no trailing slash, not a directory."
|
|
648
|
-
% src
|
|
649
|
-
)
|
|
794
|
+
src = os.path.expanduser(src)
|
|
795
|
+
src_pattern = src
|
|
650
796
|
else:
|
|
651
797
|
src, dst, pattern = data_file_desc.split("=", 2)
|
|
798
|
+
src = os.path.expanduser(src)
|
|
799
|
+
src_pattern = os.path.join(src, pattern)
|
|
652
800
|
|
|
653
|
-
|
|
801
|
+
filenames = resolveShellPatternToFilenames(src_pattern)
|
|
802
|
+
|
|
803
|
+
if len(filenames) > 1 and not dst.endswith(("/", os.path.sep)):
|
|
804
|
+
Tracing.options_logger.sysexit(
|
|
805
|
+
"Error, pattern '%s' matches more than one file, but target has no trailing slash, not a directory."
|
|
806
|
+
% src
|
|
807
|
+
)
|
|
654
808
|
|
|
655
809
|
if not filenames:
|
|
656
810
|
Tracing.options_logger.sysexit(
|
|
@@ -664,29 +818,31 @@ it before using it: '%s' (from --output-filename='%s')."""
|
|
|
664
818
|
)
|
|
665
819
|
|
|
666
820
|
for data_dir in options.data_dirs:
|
|
667
|
-
|
|
668
|
-
Tracing.options_logger.sysexit(
|
|
669
|
-
"Error, malformed data dir description, must specify relative target path with '=' separating it."
|
|
670
|
-
)
|
|
821
|
+
_checkDataDirOptionValue(data_dir=data_dir, option_name="--include-data-dir")
|
|
671
822
|
|
|
672
|
-
|
|
823
|
+
for data_dir in options.raw_dirs:
|
|
824
|
+
_checkDataDirOptionValue(data_dir=data_dir, option_name="--include-raw-dir")
|
|
673
825
|
|
|
674
|
-
|
|
826
|
+
for pattern in getShallFollowExtraFilePatterns():
|
|
827
|
+
if os.path.isdir(pattern):
|
|
675
828
|
Tracing.options_logger.sysexit(
|
|
676
|
-
"Error,
|
|
677
|
-
%
|
|
829
|
+
"Error, pattern '%s' given to '--include-plugin-files' cannot be a directory name."
|
|
830
|
+
% pattern
|
|
678
831
|
)
|
|
679
832
|
|
|
680
|
-
|
|
833
|
+
for directory_name in getShallFollowExtra():
|
|
834
|
+
if not os.path.isdir(directory_name):
|
|
681
835
|
Tracing.options_logger.sysexit(
|
|
682
|
-
"Error,
|
|
683
|
-
%
|
|
836
|
+
"Error, value '%s' given to '--include-plugin-directory' must be a directory name."
|
|
837
|
+
% directory_name
|
|
684
838
|
)
|
|
685
839
|
|
|
686
|
-
|
|
687
|
-
if os.path.isdir(pattern):
|
|
840
|
+
if isStandardLibraryPath(directory_name):
|
|
688
841
|
Tracing.options_logger.sysexit(
|
|
689
|
-
"
|
|
842
|
+
"""\
|
|
843
|
+
Error, directory '%s' given to '--include-plugin-directory' must not be a \
|
|
844
|
+
standard library path. Use '--include-module' or '--include-package' \
|
|
845
|
+
options instead."""
|
|
690
846
|
% pattern
|
|
691
847
|
)
|
|
692
848
|
|
|
@@ -717,11 +873,14 @@ download. With that, your program will work on macOS 10.9 or higher."""
|
|
|
717
873
|
"Error, Apple Python 2.7 from macOS is not usable as per Apple decision, use e.g. CPython 2.7 instead."
|
|
718
874
|
)
|
|
719
875
|
|
|
720
|
-
if isStandaloneMode() and isLinux()
|
|
721
|
-
|
|
722
|
-
|
|
876
|
+
if isStandaloneMode() and isLinux():
|
|
877
|
+
# Cyclic dependency
|
|
878
|
+
from nuitka.utils.SharedLibraries import (
|
|
879
|
+
checkPatchElfPresenceAndUsability,
|
|
723
880
|
)
|
|
724
881
|
|
|
882
|
+
checkPatchElfPresenceAndUsability(Tracing.options_logger)
|
|
883
|
+
|
|
725
884
|
pgo_executable = getPgoExecutable()
|
|
726
885
|
if pgo_executable and not isPathExecutable(pgo_executable):
|
|
727
886
|
Tracing.options_logger.sysexit(
|
|
@@ -740,6 +899,14 @@ Error, onefile mode on Termux requires 'termux-elf-cleaner' to be installed, \
|
|
|
740
899
|
use 'pkg install termux-elf-cleaner' to use it."""
|
|
741
900
|
)
|
|
742
901
|
|
|
902
|
+
for user_yaml_filename in getUserProvidedYamlFiles():
|
|
903
|
+
if not os.path.exists(user_yaml_filename):
|
|
904
|
+
Tracing.options_logger.sysexit(
|
|
905
|
+
"""\
|
|
906
|
+
Error, cannot find user provider yaml file '%s'."""
|
|
907
|
+
% user_yaml_filename
|
|
908
|
+
)
|
|
909
|
+
|
|
743
910
|
# This triggers checks inside that code
|
|
744
911
|
getCompilationReportUserData()
|
|
745
912
|
|
|
@@ -752,6 +919,20 @@ def commentArgs():
|
|
|
752
919
|
"""
|
|
753
920
|
# A ton of cases to consider, pylint: disable=too-many-branches,too-many-statements
|
|
754
921
|
|
|
922
|
+
# Check files to exist or be suitable first before giving other warnings.
|
|
923
|
+
for filename in getMainEntryPointFilenames():
|
|
924
|
+
if not os.path.exists(filename):
|
|
925
|
+
Tracing.general.sysexit("Error, file '%s' is not found." % filename)
|
|
926
|
+
|
|
927
|
+
if (
|
|
928
|
+
shallMakeModule()
|
|
929
|
+
and os.path.normcase(os.path.basename(filename)) == "__init__.py"
|
|
930
|
+
):
|
|
931
|
+
Tracing.general.sysexit(
|
|
932
|
+
"""\
|
|
933
|
+
Error, to compile a package, specify its directory but, not the '__init__.py'."""
|
|
934
|
+
)
|
|
935
|
+
|
|
755
936
|
# Inform the user about potential issues with the running version. e.g. unsupported
|
|
756
937
|
# version.
|
|
757
938
|
if python_version_str not in getSupportedPythonVersions():
|
|
@@ -770,8 +951,28 @@ version '%s' instead or newer Nuitka."""
|
|
|
770
951
|
)
|
|
771
952
|
)
|
|
772
953
|
|
|
954
|
+
# spell-checker: ignore releaselevel
|
|
955
|
+
if sys.version_info.releaselevel not in ("final", "candidate"):
|
|
956
|
+
if python_version_str not in getNotYetSupportedPythonVersions():
|
|
957
|
+
Tracing.general.sysexit(
|
|
958
|
+
"""\
|
|
959
|
+
Non-final versions '%s' '%s' are not supported by Nuitka, use the \
|
|
960
|
+
final version instead."""
|
|
961
|
+
% (python_version_str, sys.version_info.releaselevel)
|
|
962
|
+
)
|
|
963
|
+
|
|
773
964
|
if python_version_str in getNotYetSupportedPythonVersions():
|
|
774
|
-
if
|
|
965
|
+
if sys.version_info.releaselevel != "final" and not isExperimental(
|
|
966
|
+
"python" + python_version_str
|
|
967
|
+
):
|
|
968
|
+
Tracing.general.warning(
|
|
969
|
+
"""\
|
|
970
|
+
The Python version '%s' '%s' is only experimentally supported by \
|
|
971
|
+
and recommended only for use in Nuitka development and testing."""
|
|
972
|
+
% (python_version_str, sys.version_info.releaselevel)
|
|
973
|
+
)
|
|
974
|
+
|
|
975
|
+
elif not isExperimental("python" + python_version_str):
|
|
775
976
|
Tracing.general.sysexit(
|
|
776
977
|
"""\
|
|
777
978
|
The Python version '%s' is not supported by Nuitka '%s', but an upcoming \
|
|
@@ -783,6 +984,13 @@ release will add it. In the mean time use '%s' instead."""
|
|
|
783
984
|
)
|
|
784
985
|
)
|
|
785
986
|
|
|
987
|
+
if not isPythonWithGil():
|
|
988
|
+
Tracing.general.warning(
|
|
989
|
+
"""\
|
|
990
|
+
The Python without GIL is only experimentally supported by \
|
|
991
|
+
and recommended only for use in Nuitka development and testing."""
|
|
992
|
+
)
|
|
993
|
+
|
|
786
994
|
default_reference_mode = (
|
|
787
995
|
"runtime" if shallMakeModule() or isStandaloneMode() else "original"
|
|
788
996
|
)
|
|
@@ -848,6 +1056,14 @@ release will add it. In the mean time use '%s' instead."""
|
|
|
848
1056
|
% getMsvcVersion()
|
|
849
1057
|
)
|
|
850
1058
|
|
|
1059
|
+
try:
|
|
1060
|
+
getJobLimit()
|
|
1061
|
+
except ValueError:
|
|
1062
|
+
Tracing.options_logger.sysexit(
|
|
1063
|
+
"For '--jobs' value, use integer values only, not, but not '%s'."
|
|
1064
|
+
% options.jobs
|
|
1065
|
+
)
|
|
1066
|
+
|
|
851
1067
|
if isOnefileMode():
|
|
852
1068
|
standalone_mode = "onefile"
|
|
853
1069
|
elif isStandaloneMode():
|
|
@@ -893,7 +1109,8 @@ to work. You need to instead selectively add them with \
|
|
|
893
1109
|
)
|
|
894
1110
|
|
|
895
1111
|
if (
|
|
896
|
-
not
|
|
1112
|
+
not shallCreatePythonPgoInput()
|
|
1113
|
+
and not standalone_mode
|
|
897
1114
|
and options.follow_all is None
|
|
898
1115
|
and not options.follow_modules
|
|
899
1116
|
and not options.follow_stdlib
|
|
@@ -921,7 +1138,7 @@ make sure that is intended."""
|
|
|
921
1138
|
options.static_libpython = "no"
|
|
922
1139
|
|
|
923
1140
|
if (
|
|
924
|
-
not
|
|
1141
|
+
not isCPgoMode()
|
|
925
1142
|
and not isPythonPgoMode()
|
|
926
1143
|
and (getPgoArgs() or getPgoExecutable())
|
|
927
1144
|
):
|
|
@@ -929,15 +1146,19 @@ make sure that is intended."""
|
|
|
929
1146
|
"Providing PGO arguments without enabling PGO mode has no effect."
|
|
930
1147
|
)
|
|
931
1148
|
|
|
932
|
-
if
|
|
1149
|
+
if isCPgoMode():
|
|
933
1150
|
if isStandaloneMode():
|
|
934
1151
|
Tracing.optimization_logger.warning(
|
|
935
|
-
"
|
|
1152
|
+
"""\
|
|
1153
|
+
Using C level PGO with standalone/onefile mode is not \
|
|
1154
|
+
currently working. Expect errors."""
|
|
936
1155
|
)
|
|
937
1156
|
|
|
938
1157
|
if shallMakeModule():
|
|
939
1158
|
Tracing.optimization_logger.warning(
|
|
940
|
-
"
|
|
1159
|
+
"""\
|
|
1160
|
+
Using C level PGO with module mode is not currently \
|
|
1161
|
+
working. Expect errors."""
|
|
941
1162
|
)
|
|
942
1163
|
|
|
943
1164
|
if (
|
|
@@ -945,6 +1166,7 @@ make sure that is intended."""
|
|
|
945
1166
|
and not shallMakeModule()
|
|
946
1167
|
and not shallUseStaticLibPython()
|
|
947
1168
|
and getSystemStaticLibPythonPath() is not None
|
|
1169
|
+
and not shallUsePythonDebug()
|
|
948
1170
|
):
|
|
949
1171
|
Tracing.options_logger.info(
|
|
950
1172
|
"""Detected static libpython to exist, consider '--static-libpython=yes' for better performance, \
|
|
@@ -957,11 +1179,6 @@ but errors may happen."""
|
|
|
957
1179
|
"The '--debugger' option has no effect outside of '--debug' without '--run' option."
|
|
958
1180
|
)
|
|
959
1181
|
|
|
960
|
-
if not shallClearPythonPathEnvironment():
|
|
961
|
-
Tracing.options_logger.warning(
|
|
962
|
-
"The '--execute-with-pythonpath' option has no effect without '--run' option."
|
|
963
|
-
)
|
|
964
|
-
|
|
965
1182
|
# Check if the fallback is used, except for Python2 on Windows, where we cannot
|
|
966
1183
|
# have it.
|
|
967
1184
|
if hasattr(OrderedSet, "is_fallback") and not (
|
|
@@ -972,7 +1189,7 @@ but errors may happen."""
|
|
|
972
1189
|
"""\
|
|
973
1190
|
Using very slow fallback for ordered sets, please install '%s' \
|
|
974
1191
|
PyPI package for best Python compile time performance."""
|
|
975
|
-
%
|
|
1192
|
+
% recommended_orderedset_package_name
|
|
976
1193
|
)
|
|
977
1194
|
|
|
978
1195
|
if shallUsePythonDebug() and not isDebugPython():
|
|
@@ -983,15 +1200,10 @@ and not with the non-debug version.
|
|
|
983
1200
|
"""
|
|
984
1201
|
)
|
|
985
1202
|
|
|
986
|
-
if (
|
|
987
|
-
isMacOS()
|
|
988
|
-
and shallCreateAppBundle()
|
|
989
|
-
and shallDisableConsoleWindow()
|
|
990
|
-
and not getIconPaths()
|
|
991
|
-
):
|
|
1203
|
+
if isMacOS() and shallCreateAppBundle() and not getMacOSIconPaths():
|
|
992
1204
|
Tracing.general.warning(
|
|
993
1205
|
"""\
|
|
994
|
-
For
|
|
1206
|
+
For application bundles, you ought to specify an icon with '--macos-app-icon'.", \
|
|
995
1207
|
otherwise a dock icon may not be present."""
|
|
996
1208
|
)
|
|
997
1209
|
|
|
@@ -1007,23 +1219,10 @@ notarization capable signature, the default identify 'ad-hoc' is not going \
|
|
|
1007
1219
|
to work."""
|
|
1008
1220
|
)
|
|
1009
1221
|
|
|
1010
|
-
for filename in getMainEntryPointFilenames():
|
|
1011
|
-
if not os.path.exists(filename):
|
|
1012
|
-
Tracing.general.sysexit("Error, file '%s' is not found." % filename)
|
|
1013
|
-
|
|
1014
|
-
if (
|
|
1015
|
-
shallMakeModule()
|
|
1016
|
-
and os.path.normcase(os.path.basename(filename)) == "__init__.py"
|
|
1017
|
-
):
|
|
1018
|
-
Tracing.general.sysexit(
|
|
1019
|
-
"""\
|
|
1020
|
-
Error, to compile a package, specify its directory but, not the '__init__.py'."""
|
|
1021
|
-
)
|
|
1022
|
-
|
|
1023
1222
|
if (
|
|
1024
1223
|
isWin32Windows()
|
|
1025
1224
|
and 0x340 <= python_version < 0x380
|
|
1026
|
-
and
|
|
1225
|
+
and getWindowsConsoleMode() != "disable"
|
|
1027
1226
|
):
|
|
1028
1227
|
Tracing.general.warning(
|
|
1029
1228
|
"""\
|
|
@@ -1036,6 +1235,49 @@ console window for deployment.
|
|
|
1036
1235
|
mnemonic="old-python-windows-console",
|
|
1037
1236
|
)
|
|
1038
1237
|
|
|
1238
|
+
if shallMakeModule() and (getForcedStderrPath() or getForcedStdoutPath()):
|
|
1239
|
+
Tracing.general.warning(
|
|
1240
|
+
"""\
|
|
1241
|
+
Extension modules do not control process outputs, therefore the \
|
|
1242
|
+
options '--force-stdout-spec' and '--force-stderr-spec' have no \
|
|
1243
|
+
impact and should not be specified."""
|
|
1244
|
+
)
|
|
1245
|
+
|
|
1246
|
+
if shallMakeModule() and options.console_mode is not None:
|
|
1247
|
+
Tracing.general.warning(
|
|
1248
|
+
"""\
|
|
1249
|
+
Extension modules are not binaries, and therefore the option \
|
|
1250
|
+
'--windows-console-mode' does not have an impact and should \
|
|
1251
|
+
not be specified."""
|
|
1252
|
+
)
|
|
1253
|
+
|
|
1254
|
+
if options.disable_console in (True, False):
|
|
1255
|
+
if isWin32Windows():
|
|
1256
|
+
Tracing.general.warning(
|
|
1257
|
+
"""\
|
|
1258
|
+
The old console option '%s' should not be given anymore, use '%s' \
|
|
1259
|
+
instead. It also has the extra mode 'attach' to consider."""
|
|
1260
|
+
% (
|
|
1261
|
+
(
|
|
1262
|
+
"--disable-console"
|
|
1263
|
+
if options.disable_console
|
|
1264
|
+
else "--enable-console"
|
|
1265
|
+
),
|
|
1266
|
+
"--windows-console-mode=%s"
|
|
1267
|
+
% ("disable" if options.disable_console else "force"),
|
|
1268
|
+
)
|
|
1269
|
+
)
|
|
1270
|
+
else:
|
|
1271
|
+
Tracing.general.warning(
|
|
1272
|
+
"""The old console option '%s' should not be given anymore, and doesn't
|
|
1273
|
+
have any effect anymore on non-Windows."""
|
|
1274
|
+
% (
|
|
1275
|
+
"--disable-console"
|
|
1276
|
+
if options.disable_console
|
|
1277
|
+
else "--enable-console"
|
|
1278
|
+
)
|
|
1279
|
+
)
|
|
1280
|
+
|
|
1039
1281
|
|
|
1040
1282
|
def isVerbose():
|
|
1041
1283
|
""":returns: bool derived from ``--verbose``"""
|
|
@@ -1049,7 +1291,7 @@ def shallTraceExecution():
|
|
|
1049
1291
|
|
|
1050
1292
|
def shallExecuteImmediately():
|
|
1051
1293
|
""":returns: bool derived from ``--run``"""
|
|
1052
|
-
return options.immediate_execution
|
|
1294
|
+
return options is not None and options.immediate_execution
|
|
1053
1295
|
|
|
1054
1296
|
|
|
1055
1297
|
def shallRunInDebugger():
|
|
@@ -1095,7 +1337,7 @@ def getModuleNameMode():
|
|
|
1095
1337
|
|
|
1096
1338
|
def shallMakeModule():
|
|
1097
1339
|
""":returns: bool derived from ``--module``"""
|
|
1098
|
-
return options.module_mode
|
|
1340
|
+
return options is not None and options.module_mode
|
|
1099
1341
|
|
|
1100
1342
|
|
|
1101
1343
|
def shallCreatePyiFile():
|
|
@@ -1103,6 +1345,11 @@ def shallCreatePyiFile():
|
|
|
1103
1345
|
return options.pyi_file
|
|
1104
1346
|
|
|
1105
1347
|
|
|
1348
|
+
def shallCreatePyiFileContainStubs():
|
|
1349
|
+
"""*bool* = **not** ``--no-pyi-stubs``"""
|
|
1350
|
+
return options.pyi_stubs
|
|
1351
|
+
|
|
1352
|
+
|
|
1106
1353
|
def isAllowedToReexecute():
|
|
1107
1354
|
"""*bool* = **not** ``--must-not-re-execute``"""
|
|
1108
1355
|
return options.allow_reexecute
|
|
@@ -1120,6 +1367,9 @@ def shallFollowNoImports():
|
|
|
1120
1367
|
|
|
1121
1368
|
def shallFollowAllImports():
|
|
1122
1369
|
""":returns: bool derived from ``--follow-imports``"""
|
|
1370
|
+
if shallCreatePythonPgoInput() and options.is_standalone:
|
|
1371
|
+
return True
|
|
1372
|
+
|
|
1123
1373
|
return options.is_standalone or options.follow_all is True
|
|
1124
1374
|
|
|
1125
1375
|
|
|
@@ -1133,7 +1383,7 @@ def getShallFollowInNoCase():
|
|
|
1133
1383
|
|
|
1134
1384
|
|
|
1135
1385
|
def getShallFollowModules():
|
|
1136
|
-
"""*list*, items of ``--follow-import-to=``"""
|
|
1386
|
+
"""*list*, items of ``--follow-import-to=`` amended with what ``--include-module`` and ``--include-package`` got"""
|
|
1137
1387
|
return sum(
|
|
1138
1388
|
[
|
|
1139
1389
|
_splitShellPattern(x)
|
|
@@ -1198,11 +1448,15 @@ def getShallIncludeDataFiles():
|
|
|
1198
1448
|
src, dest = data_file_desc.split("=", 1)
|
|
1199
1449
|
|
|
1200
1450
|
for pattern in _splitShellPattern(src):
|
|
1451
|
+
pattern = os.path.expanduser(pattern)
|
|
1452
|
+
|
|
1201
1453
|
yield pattern, None, dest, data_file_desc
|
|
1202
1454
|
else:
|
|
1203
1455
|
src, dest, pattern = data_file_desc.split("=", 2)
|
|
1204
1456
|
|
|
1205
1457
|
for pattern in _splitShellPattern(pattern):
|
|
1458
|
+
pattern = os.path.expanduser(pattern)
|
|
1459
|
+
|
|
1206
1460
|
yield os.path.join(src, pattern), src, dest, data_file_desc
|
|
1207
1461
|
|
|
1208
1462
|
|
|
@@ -1214,12 +1468,26 @@ def getShallIncludeDataDirs():
|
|
|
1214
1468
|
yield src, dest
|
|
1215
1469
|
|
|
1216
1470
|
|
|
1471
|
+
def getShallIncludeRawDirs():
|
|
1472
|
+
"""*list*, items of ``--include-raw-dir=``"""
|
|
1473
|
+
for data_file in options.raw_dirs:
|
|
1474
|
+
src, dest = data_file.split("=", 1)
|
|
1475
|
+
|
|
1476
|
+
yield src, dest
|
|
1477
|
+
|
|
1478
|
+
|
|
1217
1479
|
def getShallNotIncludeDataFilePatterns():
|
|
1218
1480
|
"""*list*, items of ``--noinclude-data-files=``"""
|
|
1219
1481
|
|
|
1220
1482
|
return options.data_files_inhibited
|
|
1221
1483
|
|
|
1222
1484
|
|
|
1485
|
+
def getShallIncludeExternallyDataFilePatterns():
|
|
1486
|
+
"""*list*, items of ``--include-onefile-external-data=``"""
|
|
1487
|
+
|
|
1488
|
+
return options.data_files_external
|
|
1489
|
+
|
|
1490
|
+
|
|
1223
1491
|
def getShallNotIncludeDllFilePatterns():
|
|
1224
1492
|
"""*list*, items of ``--noinclude-dlls=``"""
|
|
1225
1493
|
|
|
@@ -1315,9 +1583,15 @@ def getMainEntryPointFilenames():
|
|
|
1315
1583
|
if len(options.mains) == 1:
|
|
1316
1584
|
assert not positional_args
|
|
1317
1585
|
|
|
1318
|
-
|
|
1586
|
+
result = tuple(options.mains)
|
|
1319
1587
|
else:
|
|
1320
|
-
|
|
1588
|
+
result = (positional_args[0],)
|
|
1589
|
+
|
|
1590
|
+
return tuple(getNormalizedPath(r) for r in result)
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
def isMultidistMode():
|
|
1594
|
+
return options is not None and options.mains and len(options.mains) > 1
|
|
1321
1595
|
|
|
1322
1596
|
|
|
1323
1597
|
def shallOptimizeStringExec():
|
|
@@ -1325,16 +1599,11 @@ def shallOptimizeStringExec():
|
|
|
1325
1599
|
return False
|
|
1326
1600
|
|
|
1327
1601
|
|
|
1328
|
-
def shallClearPythonPathEnvironment():
|
|
1329
|
-
"""*bool* = **not** ``--execute-with-pythonpath``"""
|
|
1330
|
-
return not options.keep_pythonpath
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
1602
|
_shall_use_static_lib_python = None
|
|
1334
1603
|
|
|
1335
1604
|
|
|
1336
1605
|
def _shallUseStaticLibPython():
|
|
1337
|
-
# return driven, pylint: disable=too-many-return-statements
|
|
1606
|
+
# many cases and return driven, pylint: disable=too-many-branches,too-many-return-statements
|
|
1338
1607
|
|
|
1339
1608
|
if shallMakeModule():
|
|
1340
1609
|
return False, "not used in module mode"
|
|
@@ -1342,7 +1611,10 @@ def _shallUseStaticLibPython():
|
|
|
1342
1611
|
if options.static_libpython == "auto":
|
|
1343
1612
|
# Nuitka-Python is good to to static linking.
|
|
1344
1613
|
if isNuitkaPython():
|
|
1345
|
-
return True, "Nuitka-Python is broken."
|
|
1614
|
+
return True, "Nuitka-Python is unexpectedly broken."
|
|
1615
|
+
|
|
1616
|
+
if isHomebrewPython():
|
|
1617
|
+
return True, "Homebrew Python is unexpectedly broken."
|
|
1346
1618
|
|
|
1347
1619
|
# Debian packages with are usable if the OS is new enough
|
|
1348
1620
|
from nuitka.utils.StaticLibraries import (
|
|
@@ -1355,6 +1627,14 @@ def _shallUseStaticLibPython():
|
|
|
1355
1627
|
and isDebianSuitableForStaticLinking()
|
|
1356
1628
|
and not shallUsePythonDebug()
|
|
1357
1629
|
):
|
|
1630
|
+
if python_version >= 0x3C0 and not os.path.exists(
|
|
1631
|
+
getInlineCopyFolder("python_hacl")
|
|
1632
|
+
):
|
|
1633
|
+
return (
|
|
1634
|
+
False,
|
|
1635
|
+
"Nuitka on Debian-Python needs inline copy of hacl not included.",
|
|
1636
|
+
)
|
|
1637
|
+
|
|
1358
1638
|
return True, "Nuitka on Debian-Python needs package '%s' installed." % (
|
|
1359
1639
|
"python2-dev" if str is bytes else "python3-dev"
|
|
1360
1640
|
)
|
|
@@ -1364,14 +1644,38 @@ def _shallUseStaticLibPython():
|
|
|
1364
1644
|
|
|
1365
1645
|
# For Anaconda default to trying static lib python library, which
|
|
1366
1646
|
# normally is just not available or if it is even unusable.
|
|
1367
|
-
if isAnacondaPython()
|
|
1647
|
+
if isAnacondaPython():
|
|
1648
|
+
if isMacOS():
|
|
1649
|
+
# TODO: Maybe some linker options can make it happen.
|
|
1650
|
+
return (
|
|
1651
|
+
False,
|
|
1652
|
+
"Anaconda on macOS exports not all symbols when using it.",
|
|
1653
|
+
)
|
|
1654
|
+
elif not isWin32Windows():
|
|
1655
|
+
return (
|
|
1656
|
+
True,
|
|
1657
|
+
"""\
|
|
1658
|
+
Nuitka on Anaconda needs package for static libpython installed. \
|
|
1659
|
+
Execute 'conda install libpython-static'.""",
|
|
1660
|
+
)
|
|
1661
|
+
|
|
1662
|
+
if isPyenvPython():
|
|
1663
|
+
return True, "Nuitka on pyenv should not use '--enable-shared'."
|
|
1664
|
+
|
|
1665
|
+
if isManyLinuxPython():
|
|
1368
1666
|
return (
|
|
1369
1667
|
True,
|
|
1370
|
-
"
|
|
1668
|
+
"""\
|
|
1669
|
+
Nuitka on 'manylinux' has no shared libraries. Use container with \
|
|
1670
|
+
the command 'RUN cd /opt/_internal && tar xf static-libs-for-embedding-only.tar.xz' \
|
|
1671
|
+
added to provide the static link library.""",
|
|
1371
1672
|
)
|
|
1372
1673
|
|
|
1373
|
-
if
|
|
1374
|
-
return True,
|
|
1674
|
+
if isMacOS() and isCPythonOfficialPackage():
|
|
1675
|
+
return True, None
|
|
1676
|
+
|
|
1677
|
+
if isArchPackagePython():
|
|
1678
|
+
return True, None
|
|
1375
1679
|
|
|
1376
1680
|
return options.static_libpython == "yes", None
|
|
1377
1681
|
|
|
@@ -1438,17 +1742,25 @@ def isShowScons():
|
|
|
1438
1742
|
|
|
1439
1743
|
def getJobLimit():
|
|
1440
1744
|
"""*int*, value of ``--jobs`` / "-j" or number of CPU kernels"""
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1745
|
+
jobs = options.jobs
|
|
1746
|
+
|
|
1747
|
+
# Low memory has a default of 1.
|
|
1748
|
+
if jobs is None and isLowMemory():
|
|
1749
|
+
return 1
|
|
1446
1750
|
|
|
1447
|
-
|
|
1751
|
+
if jobs is None:
|
|
1752
|
+
result = getCPUCoreCount()
|
|
1753
|
+
else:
|
|
1754
|
+
result = int(jobs)
|
|
1755
|
+
|
|
1756
|
+
if result <= 0:
|
|
1757
|
+
result = max(1, getCPUCoreCount() + result)
|
|
1758
|
+
|
|
1759
|
+
return result
|
|
1448
1760
|
|
|
1449
1761
|
|
|
1450
1762
|
def getLtoMode():
|
|
1451
|
-
""":returns: bool derived from ``--lto``
|
|
1763
|
+
""":returns: bool derived from ``--lto``"""
|
|
1452
1764
|
return options.lto
|
|
1453
1765
|
|
|
1454
1766
|
|
|
@@ -1507,16 +1819,18 @@ def shallDisableBytecodeCacheUsage():
|
|
|
1507
1819
|
return shallDisableCacheUsage("bytecode")
|
|
1508
1820
|
|
|
1509
1821
|
|
|
1510
|
-
def
|
|
1511
|
-
""":returns:
|
|
1512
|
-
return
|
|
1513
|
-
|
|
1822
|
+
def shallDisableCompressionCacheUsage():
|
|
1823
|
+
""":returns: bool derived from ``--disable-cache=compression``"""
|
|
1824
|
+
return shallDisableCacheUsage("compression")
|
|
1514
1825
|
|
|
1515
|
-
def mayDisableConsoleWindow():
|
|
1516
|
-
""":returns: bool derived from platform support of disabling the console,"""
|
|
1517
1826
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1827
|
+
def getWindowsConsoleMode():
|
|
1828
|
+
""":returns: str from ``--windows-console-mode``"""
|
|
1829
|
+
if options.disable_console is True:
|
|
1830
|
+
return "disable"
|
|
1831
|
+
if options.disable_console is False:
|
|
1832
|
+
return "force"
|
|
1833
|
+
return options.console_mode or "force"
|
|
1520
1834
|
|
|
1521
1835
|
|
|
1522
1836
|
def _isFullCompat():
|
|
@@ -1577,10 +1891,6 @@ def enableExperimental(indication):
|
|
|
1577
1891
|
_experimental.add(indication)
|
|
1578
1892
|
|
|
1579
1893
|
|
|
1580
|
-
def disableExperimental(indication):
|
|
1581
|
-
_experimental.remove(indication)
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
1894
|
def getExperimentalIndications():
|
|
1585
1895
|
"""*tuple*, items of ``--experimental=``"""
|
|
1586
1896
|
if hasattr(options, "experimental"):
|
|
@@ -1589,6 +1899,23 @@ def getExperimentalIndications():
|
|
|
1589
1899
|
return ()
|
|
1590
1900
|
|
|
1591
1901
|
|
|
1902
|
+
def getDebugModeIndications():
|
|
1903
|
+
result = []
|
|
1904
|
+
|
|
1905
|
+
for debug_option_value_name in ("debug_immortal",):
|
|
1906
|
+
if debug_option_value_name == "debug_immortal" and python_version < 0x3C0:
|
|
1907
|
+
continue
|
|
1908
|
+
|
|
1909
|
+
if _isDebug():
|
|
1910
|
+
if getattr(options, debug_option_value_name) is not False:
|
|
1911
|
+
result.append(debug_option_value_name)
|
|
1912
|
+
else:
|
|
1913
|
+
if getattr(options, debug_option_value_name) is True:
|
|
1914
|
+
result.append(debug_option_value_name)
|
|
1915
|
+
|
|
1916
|
+
return result
|
|
1917
|
+
|
|
1918
|
+
|
|
1592
1919
|
def shallExplainImports():
|
|
1593
1920
|
""":returns: bool derived from ``--explain-imports``"""
|
|
1594
1921
|
return options is not None and options.explain_imports
|
|
@@ -1596,12 +1923,18 @@ def shallExplainImports():
|
|
|
1596
1923
|
|
|
1597
1924
|
def isStandaloneMode():
|
|
1598
1925
|
""":returns: bool derived from ``--standalone``"""
|
|
1599
|
-
|
|
1926
|
+
if shallCreatePythonPgoInput():
|
|
1927
|
+
return False
|
|
1928
|
+
|
|
1929
|
+
return bool(options.is_standalone or options.list_package_dlls)
|
|
1600
1930
|
|
|
1601
1931
|
|
|
1602
1932
|
def isOnefileMode():
|
|
1603
1933
|
""":returns: bool derived from ``--onefile``"""
|
|
1604
|
-
|
|
1934
|
+
if shallCreatePythonPgoInput():
|
|
1935
|
+
return False
|
|
1936
|
+
|
|
1937
|
+
return bool(options.is_onefile)
|
|
1605
1938
|
|
|
1606
1939
|
|
|
1607
1940
|
def isAcceleratedMode():
|
|
@@ -1616,13 +1949,16 @@ def isOnefileTempDirMode():
|
|
|
1616
1949
|
Using cached onefile execution when the spec doesn't contain
|
|
1617
1950
|
volatile things.
|
|
1618
1951
|
"""
|
|
1952
|
+
if shallCreatePythonPgoInput():
|
|
1953
|
+
return False
|
|
1954
|
+
|
|
1619
1955
|
spec = getOnefileTempDirSpec()
|
|
1620
1956
|
|
|
1621
1957
|
for candidate in (
|
|
1622
|
-
"
|
|
1623
|
-
"
|
|
1624
|
-
"
|
|
1625
|
-
"
|
|
1958
|
+
"{PID}",
|
|
1959
|
+
"{TIME}",
|
|
1960
|
+
"{PROGRAM}",
|
|
1961
|
+
"{PROGRAM_BASE}",
|
|
1626
1962
|
):
|
|
1627
1963
|
if candidate in spec:
|
|
1628
1964
|
return True
|
|
@@ -1630,8 +1966,11 @@ def isOnefileTempDirMode():
|
|
|
1630
1966
|
return False
|
|
1631
1967
|
|
|
1632
1968
|
|
|
1633
|
-
def
|
|
1634
|
-
""":returns: bool derived from ``--pgo``"""
|
|
1969
|
+
def isCPgoMode():
|
|
1970
|
+
""":returns: bool derived from ``--pgo-c``"""
|
|
1971
|
+
if shallCreatePythonPgoInput():
|
|
1972
|
+
return False
|
|
1973
|
+
|
|
1635
1974
|
return options.is_c_pgo
|
|
1636
1975
|
|
|
1637
1976
|
|
|
@@ -1645,7 +1984,7 @@ def getPythonPgoInput():
|
|
|
1645
1984
|
return options.python_pgo_input
|
|
1646
1985
|
|
|
1647
1986
|
|
|
1648
|
-
def
|
|
1987
|
+
def shallCreatePythonPgoInput():
|
|
1649
1988
|
return isPythonPgoMode() and getPythonPgoInput() is None
|
|
1650
1989
|
|
|
1651
1990
|
|
|
@@ -1659,9 +1998,7 @@ def getPgoExecutable():
|
|
|
1659
1998
|
|
|
1660
1999
|
if options.pgo_executable and os.path.exists(options.pgo_executable):
|
|
1661
2000
|
if not os.path.isabs(options.pgo_executable):
|
|
1662
|
-
options.pgo_executable = os.path.
|
|
1663
|
-
os.path.join(".", options.pgo_executable)
|
|
1664
|
-
)
|
|
2001
|
+
options.pgo_executable = os.path.join(".", options.pgo_executable)
|
|
1665
2002
|
|
|
1666
2003
|
return options.pgo_executable
|
|
1667
2004
|
|
|
@@ -1674,11 +2011,10 @@ def getPythonPgoUnseenModulePolicy():
|
|
|
1674
2011
|
def getOnefileTempDirSpec():
|
|
1675
2012
|
"""*str* = ``--onefile-tempdir-spec``"""
|
|
1676
2013
|
result = (
|
|
1677
|
-
options.onefile_tempdir_spec or "
|
|
2014
|
+
options.onefile_tempdir_spec or "{TEMP}" + os.path.sep + "onefile_{PID}_{TIME}"
|
|
1678
2015
|
)
|
|
1679
2016
|
|
|
1680
|
-
|
|
1681
|
-
return os.path.normpath(result)
|
|
2017
|
+
return result
|
|
1682
2018
|
|
|
1683
2019
|
|
|
1684
2020
|
def getOnefileChildGraceTime():
|
|
@@ -1695,10 +2031,31 @@ def shallNotCompressOnefile():
|
|
|
1695
2031
|
return options.onefile_no_compression
|
|
1696
2032
|
|
|
1697
2033
|
|
|
1698
|
-
def
|
|
1699
|
-
"""*
|
|
2034
|
+
def shallOnefileAsArchive():
|
|
2035
|
+
"""*bool* = ``--onefile-as-archive``"""
|
|
2036
|
+
return options.onefile_as_archive
|
|
2037
|
+
|
|
2038
|
+
|
|
2039
|
+
def _checkIconPaths(icon_paths):
|
|
2040
|
+
for icon_path in icon_paths:
|
|
2041
|
+
if not os.path.exists(icon_path):
|
|
2042
|
+
Tracing.options_logger.sysexit(
|
|
2043
|
+
"Error, icon path '%s' does not exist." % icon_path
|
|
2044
|
+
)
|
|
2045
|
+
|
|
2046
|
+
checkIconUsage(logger=Tracing.options_logger, icon_path=icon_path)
|
|
1700
2047
|
|
|
1701
|
-
|
|
2048
|
+
return icon_paths
|
|
2049
|
+
|
|
2050
|
+
|
|
2051
|
+
def getWindowsIconPaths():
|
|
2052
|
+
"""*list of str*, values of ``--windows-icon-from-ico``"""
|
|
2053
|
+
return _checkIconPaths(options.windows_icon_path)
|
|
2054
|
+
|
|
2055
|
+
|
|
2056
|
+
def getLinuxIconPaths():
|
|
2057
|
+
"""*list of str*, values of ``--linux-icon``"""
|
|
2058
|
+
result = options.linux_icon_path
|
|
1702
2059
|
|
|
1703
2060
|
# Check if Linux icon requirement is met.
|
|
1704
2061
|
if isLinux() and not result and isOnefileMode():
|
|
@@ -1714,7 +2071,12 @@ def getIconPaths():
|
|
|
1714
2071
|
result.append(icon)
|
|
1715
2072
|
break
|
|
1716
2073
|
|
|
1717
|
-
return result
|
|
2074
|
+
return _checkIconPaths(result)
|
|
2075
|
+
|
|
2076
|
+
|
|
2077
|
+
def getMacOSIconPaths():
|
|
2078
|
+
"""*list of str*, values of ``--macos-app-icon``"""
|
|
2079
|
+
return _checkIconPaths(options.macos_icon_path)
|
|
1718
2080
|
|
|
1719
2081
|
|
|
1720
2082
|
def getWindowsIconExecutablePath():
|
|
@@ -1732,6 +2094,28 @@ def shallAskForWindowsUIAccessRights():
|
|
|
1732
2094
|
return options.windows_uac_uiaccess
|
|
1733
2095
|
|
|
1734
2096
|
|
|
2097
|
+
def getLegalCopyright():
|
|
2098
|
+
"""*str* name of the product to use derived from ``--copyright``"""
|
|
2099
|
+
return options.legal_copyright
|
|
2100
|
+
|
|
2101
|
+
|
|
2102
|
+
def getLegalTrademarks():
|
|
2103
|
+
"""*str* name of the product to use derived from ``--trademarks``"""
|
|
2104
|
+
return options.legal_trademarks
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
def getLegalInformation():
|
|
2108
|
+
result = options.legal_copyright
|
|
2109
|
+
|
|
2110
|
+
if options.legal_trademarks:
|
|
2111
|
+
if result is not None:
|
|
2112
|
+
result += "\nTrademark information:" + options.legal_trademarks
|
|
2113
|
+
else:
|
|
2114
|
+
result = options.legal_trademarks
|
|
2115
|
+
|
|
2116
|
+
return result
|
|
2117
|
+
|
|
2118
|
+
|
|
1735
2119
|
def isWindowsServiceMode():
|
|
1736
2120
|
"""*bool*, value of ``--windows-service``"""
|
|
1737
2121
|
return options.windows_service
|
|
@@ -1800,27 +2184,47 @@ def _parseVersionNumber(value):
|
|
|
1800
2184
|
|
|
1801
2185
|
|
|
1802
2186
|
def getProductVersion():
|
|
2187
|
+
""":returns: str, derived from ``--product-version``"""
|
|
2188
|
+
return options.product_version
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
def getProductVersionTuple():
|
|
1803
2192
|
""":returns: tuple of 4 ints or None, derived from ``--product-version``"""
|
|
1804
2193
|
return _parseVersionNumber(options.product_version)
|
|
1805
2194
|
|
|
1806
2195
|
|
|
1807
2196
|
def getFileVersion():
|
|
2197
|
+
""":returns str, derived from ``--file-version``"""
|
|
2198
|
+
return options.file_version
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
def getFileVersionTuple():
|
|
1808
2202
|
""":returns tuple of 4 ints or None, derived from ``--file-version``"""
|
|
1809
2203
|
return _parseVersionNumber(options.file_version)
|
|
1810
2204
|
|
|
1811
2205
|
|
|
2206
|
+
def getProductFileVersion():
|
|
2207
|
+
if options.product_version:
|
|
2208
|
+
if options.file_version:
|
|
2209
|
+
return "%s-%s" % (options.product_version, options.file_version)
|
|
2210
|
+
else:
|
|
2211
|
+
return options.product_version
|
|
2212
|
+
else:
|
|
2213
|
+
return options.file_version
|
|
2214
|
+
|
|
2215
|
+
|
|
1812
2216
|
def getWindowsSplashScreen():
|
|
1813
2217
|
""":returns: bool derived from ``--onefile-windows-splash-screen-image``"""
|
|
1814
2218
|
return options.splash_screen_image
|
|
1815
2219
|
|
|
1816
2220
|
|
|
1817
2221
|
def getCompanyName():
|
|
1818
|
-
"""*str* name of the company to use"""
|
|
2222
|
+
"""*str* name of the company to use derived from ``--company-name``"""
|
|
1819
2223
|
return options.company_name
|
|
1820
2224
|
|
|
1821
2225
|
|
|
1822
2226
|
def getProductName():
|
|
1823
|
-
"""*str* name of the product to use"""
|
|
2227
|
+
"""*str* name of the product to use derived from ``--product-name``"""
|
|
1824
2228
|
return options.product_name
|
|
1825
2229
|
|
|
1826
2230
|
|
|
@@ -1836,6 +2240,9 @@ def getMacOSTargetArch():
|
|
|
1836
2240
|
|
|
1837
2241
|
def shallCreateAppBundle():
|
|
1838
2242
|
"""*bool* shall create an application bundle, derived from ``--macos-create-app-bundle`` value"""
|
|
2243
|
+
if shallCreatePythonPgoInput():
|
|
2244
|
+
return False
|
|
2245
|
+
|
|
1839
2246
|
return options.macos_create_bundle and isMacOS()
|
|
1840
2247
|
|
|
1841
2248
|
|
|
@@ -1931,6 +2338,8 @@ def _getPythonFlags():
|
|
|
1931
2338
|
_python_flags.add("package_mode")
|
|
1932
2339
|
elif part in ("-I", "isolated"):
|
|
1933
2340
|
_python_flags.add("isolated")
|
|
2341
|
+
elif part in ("-B", "dontwritebytecode"):
|
|
2342
|
+
_python_flags.add("dontwritebytecode")
|
|
1934
2343
|
else:
|
|
1935
2344
|
Tracing.options_logger.sysexit(
|
|
1936
2345
|
"Unsupported python flag '%s'." % part
|
|
@@ -1987,8 +2396,14 @@ def hasPythonFlagNoRandomization():
|
|
|
1987
2396
|
return "no_randomization" in _getPythonFlags()
|
|
1988
2397
|
|
|
1989
2398
|
|
|
2399
|
+
def hasPythonFlagNoBytecodeRuntimeCache():
|
|
2400
|
+
"""*bool* = "dontwritebytecode", "-u" in python flags given"""
|
|
2401
|
+
|
|
2402
|
+
return "dontwritebytecode" in _getPythonFlags()
|
|
2403
|
+
|
|
2404
|
+
|
|
1990
2405
|
def hasPythonFlagUnbuffered():
|
|
1991
|
-
"""*bool* = "
|
|
2406
|
+
"""*bool* = "unbuffered", "-u" in python flags given"""
|
|
1992
2407
|
|
|
1993
2408
|
return "unbuffered" in _getPythonFlags()
|
|
1994
2409
|
|
|
@@ -2106,27 +2521,28 @@ def shallUseProgressBar():
|
|
|
2106
2521
|
|
|
2107
2522
|
def getForcedStdoutPath():
|
|
2108
2523
|
"""*str* force program stdout output into that filename"""
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
if result is not None:
|
|
2112
|
-
result = os.path.normpath(result)
|
|
2524
|
+
if shallCreatePythonPgoInput():
|
|
2525
|
+
return False
|
|
2113
2526
|
|
|
2114
|
-
return
|
|
2527
|
+
return options.force_stdout_spec
|
|
2115
2528
|
|
|
2116
2529
|
|
|
2117
2530
|
def getForcedStderrPath():
|
|
2118
2531
|
"""*str* force program stderr output into that filename"""
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
if result is not None:
|
|
2122
|
-
result = os.path.normpath(result)
|
|
2532
|
+
if shallCreatePythonPgoInput():
|
|
2533
|
+
return False
|
|
2123
2534
|
|
|
2124
|
-
return
|
|
2535
|
+
return options.force_stderr_spec
|
|
2125
2536
|
|
|
2126
2537
|
|
|
2127
|
-
def shallShowSourceModifications():
|
|
2538
|
+
def shallShowSourceModifications(module_name):
|
|
2128
2539
|
"""*bool* display plugin source changes derived from --show-source-changes"""
|
|
2129
|
-
|
|
2540
|
+
if options is None:
|
|
2541
|
+
return False
|
|
2542
|
+
|
|
2543
|
+
result, _reason = module_name.matchesToShellPatterns(options.show_source_changes)
|
|
2544
|
+
|
|
2545
|
+
return result
|
|
2130
2546
|
|
|
2131
2547
|
|
|
2132
2548
|
def isLowMemory():
|
|
@@ -2208,3 +2624,63 @@ def shallDisplayWarningMnemonic(mnemonic):
|
|
|
2208
2624
|
|
|
2209
2625
|
def shallShowExecutedCommands():
|
|
2210
2626
|
return isExperimental("show-commands")
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
def getTargetPythonDescription():
|
|
2630
|
+
""":returns: tuple(python_version,OS/arch) string derived from ``--target``"""
|
|
2631
|
+
if options.target_spec is not None:
|
|
2632
|
+
# TODO: Only one we are working on right now.
|
|
2633
|
+
assert options.target_spec == "wasi"
|
|
2634
|
+
|
|
2635
|
+
return python_version, "wasi"
|
|
2636
|
+
|
|
2637
|
+
return None
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
def getFcfProtectionMode():
|
|
2641
|
+
""":returns: string derived from ``--fcf-protection``"""
|
|
2642
|
+
return options.cf_protection
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
def getModuleParameter(module_name, parameter_name):
|
|
2646
|
+
""":returns: string derived from ``--module-parameter``"""
|
|
2647
|
+
|
|
2648
|
+
module_name_prefix = module_name.getTopLevelPackageName().asString()
|
|
2649
|
+
|
|
2650
|
+
if parameter_name.startswith(module_name_prefix + "-"):
|
|
2651
|
+
option_name = parameter_name
|
|
2652
|
+
else:
|
|
2653
|
+
option_name = module_name_prefix + "-" + parameter_name
|
|
2654
|
+
|
|
2655
|
+
for module_option in options.module_parameters:
|
|
2656
|
+
module_option_name, module_option_value = module_option.split("=", 1)
|
|
2657
|
+
|
|
2658
|
+
if option_name == module_option_name:
|
|
2659
|
+
return module_option_value
|
|
2660
|
+
|
|
2661
|
+
return None
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
def getForcedRuntimeEnvironmentVariableValues():
|
|
2665
|
+
""":returns: iterable (string, string) derived from ``----force-runtime-environment-variable``"""
|
|
2666
|
+
|
|
2667
|
+
for forced_runtime_env_variables_spec in options.forced_runtime_env_variables:
|
|
2668
|
+
name, value = forced_runtime_env_variables_spec.split("=", 1)
|
|
2669
|
+
|
|
2670
|
+
yield (name, value)
|
|
2671
|
+
|
|
2672
|
+
|
|
2673
|
+
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
2674
|
+
# integrates with CPython, but also works on its own.
|
|
2675
|
+
#
|
|
2676
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2677
|
+
# you may not use this file except in compliance with the License.
|
|
2678
|
+
# You may obtain a copy of the License at
|
|
2679
|
+
#
|
|
2680
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
2681
|
+
#
|
|
2682
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
2683
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
2684
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2685
|
+
# See the License for the specific language governing permissions and
|
|
2686
|
+
# limitations under the License.
|