Nuitka-winsvc 2.7.7__cp313-cp313-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/Builtins.py +259 -0
- nuitka/BytecodeCaching.py +184 -0
- nuitka/Bytecodes.py +109 -0
- nuitka/CacheCleanup.py +54 -0
- nuitka/Constants.py +425 -0
- nuitka/Errors.py +93 -0
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +1201 -0
- nuitka/ModuleRegistry.py +364 -0
- nuitka/OptionParsing.py +2473 -0
- nuitka/Options.py +2948 -0
- nuitka/OutputDirectories.py +201 -0
- nuitka/PostProcessing.py +551 -0
- nuitka/Progress.py +252 -0
- nuitka/PythonFlavors.py +426 -0
- nuitka/PythonOperators.py +146 -0
- nuitka/PythonVersions.py +513 -0
- nuitka/Serialization.py +291 -0
- nuitka/SourceCodeReferences.py +176 -0
- nuitka/Tracing.py +579 -0
- nuitka/TreeXML.py +141 -0
- nuitka/Variables.py +515 -0
- nuitka/Version.py +88 -0
- nuitka/__init__.py +19 -0
- nuitka/__main__.py +224 -0
- nuitka/__past__.py +217 -0
- nuitka/build/Backend.scons +1111 -0
- nuitka/build/CCompilerVersion.scons +281 -0
- nuitka/build/DataComposerInterface.py +116 -0
- nuitka/build/Offsets.scons +626 -0
- nuitka/build/Onefile.scons +564 -0
- nuitka/build/SconsCaching.py +451 -0
- nuitka/build/SconsCompilerSettings.py +1133 -0
- nuitka/build/SconsHacks.py +215 -0
- nuitka/build/SconsInterface.py +664 -0
- nuitka/build/SconsProgress.py +100 -0
- nuitka/build/SconsSpawn.py +436 -0
- nuitka/build/SconsUtils.py +939 -0
- nuitka/build/__init__.py +19 -0
- nuitka/build/include/nuitka/allocator.h +450 -0
- nuitka/build/include/nuitka/builtins.h +97 -0
- nuitka/build/include/nuitka/calling.h +123 -0
- nuitka/build/include/nuitka/checkers.h +39 -0
- nuitka/build/include/nuitka/checksum_tools.h +28 -0
- nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
- nuitka/build/include/nuitka/compiled_cell.h +64 -0
- nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
- nuitka/build/include/nuitka/compiled_frame.h +502 -0
- nuitka/build/include/nuitka/compiled_function.h +170 -0
- nuitka/build/include/nuitka/compiled_generator.h +287 -0
- nuitka/build/include/nuitka/compiled_method.h +54 -0
- nuitka/build/include/nuitka/constants.h +251 -0
- nuitka/build/include/nuitka/constants_blob.h +34 -0
- 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 +51 -0
- nuitka/build/include/nuitka/exception_groups.h +167 -0
- nuitka/build/include/nuitka/exceptions.h +1458 -0
- nuitka/build/include/nuitka/filesystem_paths.h +117 -0
- nuitka/build/include/nuitka/freelists.h +92 -0
- nuitka/build/include/nuitka/hedley.h +1774 -0
- nuitka/build/include/nuitka/helper/attributes.h +90 -0
- nuitka/build/include/nuitka/helper/boolean.h +86 -0
- nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
- nuitka/build/include/nuitka/helper/bytes.h +28 -0
- nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
- 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 +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
- nuitka/build/include/nuitka/helper/complex.h +46 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
- nuitka/build/include/nuitka/helper/floats.h +32 -0
- nuitka/build/include/nuitka/helper/import_hard.h +121 -0
- nuitka/build/include/nuitka/helper/indexes.h +47 -0
- nuitka/build/include/nuitka/helper/ints.h +165 -0
- nuitka/build/include/nuitka/helper/iterators.h +376 -0
- nuitka/build/include/nuitka/helper/lists.h +94 -0
- nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
- nuitka/build/include/nuitka/helper/mappings.h +39 -0
- nuitka/build/include/nuitka/helper/operations.h +114 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
- nuitka/build/include/nuitka/helper/raising.h +114 -0
- nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
- nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
- nuitka/build/include/nuitka/helper/sequences.h +33 -0
- nuitka/build/include/nuitka/helper/sets.h +25 -0
- nuitka/build/include/nuitka/helper/slices.h +314 -0
- nuitka/build/include/nuitka/helper/strings.h +30 -0
- nuitka/build/include/nuitka/helper/subscripts.h +390 -0
- nuitka/build/include/nuitka/helper/tuples.h +187 -0
- nuitka/build/include/nuitka/helpers.h +417 -0
- nuitka/build/include/nuitka/importing.h +149 -0
- nuitka/build/include/nuitka/incbin.h +402 -0
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +626 -0
- nuitka/build/include/nuitka/printing.h +84 -0
- nuitka/build/include/nuitka/python_pgo.h +57 -0
- nuitka/build/include/nuitka/safe_string_ops.h +57 -0
- nuitka/build/include/nuitka/threading.h +142 -0
- nuitka/build/include/nuitka/tracing.h +82 -0
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +91 -0
- nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
- nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
- nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
- nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
- nuitka/build/inline_copy/bin/scons.py +58 -0
- nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
- nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
- nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
- nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
- nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
- nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
- nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
- nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
- nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
- nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
- nuitka/build/inline_copy/glob2/LICENSE +27 -0
- nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
- nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
- nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
- nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
- nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
- nuitka/build/inline_copy/jinja2/README.rst +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
- nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
- nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- 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 +484 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
- nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
- nuitka/build/inline_copy/yaml/LICENSE +20 -0
- nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
- nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
- nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
- nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
- nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
- nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
- nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
- nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
- nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
- nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
- nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
- nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
- nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
- nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
- 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/inline_copy/zstd/LICENSE.txt +30 -0
- nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
- nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
- nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
- nuitka/build/inline_copy/zstd/common/debug.h +107 -0
- nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
- nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
- nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
- nuitka/build/inline_copy/zstd/common/fse.h +715 -0
- nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- nuitka/build/inline_copy/zstd/common/huf.h +361 -0
- nuitka/build/inline_copy/zstd/common/mem.h +426 -0
- nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
- nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
- nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
- nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- nuitka/build/inline_copy/zstd/zstd.h +2391 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
- nuitka/build/static_src/CompiledCellType.c +300 -0
- nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
- nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
- nuitka/build/static_src/CompiledFrameType.c +1337 -0
- nuitka/build/static_src/CompiledFunctionType.c +3320 -0
- nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
- nuitka/build/static_src/CompiledMethodType.c +614 -0
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +939 -0
- nuitka/build/static_src/HelpersAttributes.c +1241 -0
- nuitka/build/static_src/HelpersBuiltin.c +901 -0
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
- nuitka/build/static_src/HelpersBytes.c +107 -0
- nuitka/build/static_src/HelpersCalling.c +397 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
- nuitka/build/static_src/HelpersChecksumTools.c +59 -0
- nuitka/build/static_src/HelpersClasses.c +91 -0
- 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 +12070 -0
- nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
- nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
- nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
- nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
- nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
- nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
- nuitka/build/static_src/HelpersConsole.c +124 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
- nuitka/build/static_src/HelpersDeepcopy.c +636 -0
- nuitka/build/static_src/HelpersDictionaries.c +1739 -0
- nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
- nuitka/build/static_src/HelpersExceptions.c +298 -0
- nuitka/build/static_src/HelpersFiles.c +353 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
- nuitka/build/static_src/HelpersFloats.c +92 -0
- nuitka/build/static_src/HelpersHeapStorage.c +68 -0
- nuitka/build/static_src/HelpersImport.c +506 -0
- nuitka/build/static_src/HelpersImportHard.c +526 -0
- nuitka/build/static_src/HelpersJitSources.c +48 -0
- nuitka/build/static_src/HelpersLists.c +899 -0
- nuitka/build/static_src/HelpersListsGenerated.c +564 -0
- nuitka/build/static_src/HelpersMappings.c +46 -0
- nuitka/build/static_src/HelpersMatching.c +192 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
- nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
- nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
- nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
- nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
- nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
- nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
- nuitka/build/static_src/HelpersProfiling.c +104 -0
- nuitka/build/static_src/HelpersPythonPgo.c +113 -0
- nuitka/build/static_src/HelpersRaising.c +447 -0
- nuitka/build/static_src/HelpersSafeStrings.c +185 -0
- nuitka/build/static_src/HelpersSequences.c +134 -0
- nuitka/build/static_src/HelpersSlices.c +73 -0
- nuitka/build/static_src/HelpersStrings.c +998 -0
- nuitka/build/static_src/HelpersTuples.c +148 -0
- nuitka/build/static_src/HelpersTypes.c +329 -0
- nuitka/build/static_src/InspectPatcher.c +439 -0
- nuitka/build/static_src/MainProgram.c +2060 -0
- nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
- nuitka/build/static_src/OnefileBootstrap.c +1580 -0
- nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
- nuitka/code_generation/AsyncgenCodes.py +186 -0
- nuitka/code_generation/AttributeCodes.py +357 -0
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
- nuitka/code_generation/BranchCodes.py +67 -0
- nuitka/code_generation/BuiltinCodes.py +529 -0
- nuitka/code_generation/CallCodes.py +1186 -0
- nuitka/code_generation/ClassCodes.py +156 -0
- nuitka/code_generation/CodeGeneration.py +1078 -0
- nuitka/code_generation/CodeHelperSelection.py +81 -0
- nuitka/code_generation/CodeHelpers.py +455 -0
- nuitka/code_generation/CodeObjectCodes.py +165 -0
- nuitka/code_generation/ComparisonCodes.py +569 -0
- nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
- nuitka/code_generation/ConditionalCodes.py +236 -0
- nuitka/code_generation/ConstantCodes.py +243 -0
- nuitka/code_generation/Contexts.py +1248 -0
- nuitka/code_generation/CoroutineCodes.py +253 -0
- nuitka/code_generation/CtypesCodes.py +46 -0
- nuitka/code_generation/DictCodes.py +918 -0
- nuitka/code_generation/Emission.py +75 -0
- nuitka/code_generation/ErrorCodes.py +281 -0
- nuitka/code_generation/EvalCodes.py +444 -0
- nuitka/code_generation/ExceptionCodes.py +337 -0
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
- nuitka/code_generation/ExpressionCodes.py +61 -0
- nuitka/code_generation/FrameCodes.py +518 -0
- nuitka/code_generation/FunctionCodes.py +858 -0
- nuitka/code_generation/GeneratorCodes.py +218 -0
- nuitka/code_generation/GlobalConstants.py +249 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
- nuitka/code_generation/IdCodes.py +53 -0
- nuitka/code_generation/ImportCodes.py +468 -0
- nuitka/code_generation/Indentation.py +45 -0
- nuitka/code_generation/IndexCodes.py +50 -0
- nuitka/code_generation/InjectCCodes.py +28 -0
- nuitka/code_generation/IntegerCodes.py +110 -0
- nuitka/code_generation/IteratorCodes.py +378 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +68 -0
- nuitka/code_generation/LineNumberCodes.py +91 -0
- nuitka/code_generation/ListCodes.py +502 -0
- nuitka/code_generation/LoaderCodes.py +193 -0
- nuitka/code_generation/LocalsDictCodes.py +359 -0
- nuitka/code_generation/LoopCodes.py +88 -0
- nuitka/code_generation/MatchCodes.py +67 -0
- nuitka/code_generation/ModuleCodes.py +247 -0
- nuitka/code_generation/Namify.py +260 -0
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +398 -0
- nuitka/code_generation/PackageResourceCodes.py +986 -0
- nuitka/code_generation/PrintCodes.py +93 -0
- nuitka/code_generation/PythonAPICodes.py +215 -0
- nuitka/code_generation/RaisingCodes.py +481 -0
- nuitka/code_generation/Reports.py +115 -0
- nuitka/code_generation/ReturnCodes.py +143 -0
- nuitka/code_generation/SetCodes.py +196 -0
- nuitka/code_generation/SliceCodes.py +465 -0
- nuitka/code_generation/StringCodes.py +303 -0
- nuitka/code_generation/SubscriptCodes.py +263 -0
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +326 -0
- nuitka/code_generation/TupleCodes.py +115 -0
- nuitka/code_generation/TypeAliasCodes.py +120 -0
- nuitka/code_generation/VariableCodes.py +519 -0
- nuitka/code_generation/VariableDeclarations.py +279 -0
- nuitka/code_generation/YieldCodes.py +253 -0
- nuitka/code_generation/__init__.py +19 -0
- nuitka/code_generation/c_types/CTypeBases.py +177 -0
- nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
- nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
- nuitka/code_generation/c_types/CTypeVoids.py +92 -0
- nuitka/code_generation/c_types/__init__.py +19 -0
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
- nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
- nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
- nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
- nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
- nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
- nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
- nuitka/code_generation/templates/__init__.py +19 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
- nuitka/containers/Namedtuples.py +51 -0
- nuitka/containers/OrderedDicts.py +191 -0
- nuitka/containers/OrderedSets.py +123 -0
- nuitka/containers/OrderedSetsFallback.py +139 -0
- nuitka/containers/__init__.py +19 -0
- nuitka/distutils/Build.py +76 -0
- nuitka/distutils/DistutilCommands.py +438 -0
- nuitka/distutils/__init__.py +19 -0
- nuitka/finalizations/Finalization.py +35 -0
- nuitka/finalizations/FinalizeMarkups.py +136 -0
- nuitka/finalizations/__init__.py +19 -0
- nuitka/freezer/DependsExe.py +257 -0
- nuitka/freezer/DllDependenciesCommon.py +97 -0
- nuitka/freezer/DllDependenciesMacOS.py +444 -0
- nuitka/freezer/DllDependenciesPosix.py +242 -0
- nuitka/freezer/DllDependenciesWin32.py +315 -0
- nuitka/freezer/ImportDetection.py +359 -0
- nuitka/freezer/IncludedDataFiles.py +689 -0
- nuitka/freezer/IncludedEntryPoints.py +376 -0
- nuitka/freezer/Onefile.py +296 -0
- nuitka/freezer/Standalone.py +520 -0
- nuitka/freezer/__init__.py +19 -0
- nuitka/importing/IgnoreListing.py +449 -0
- nuitka/importing/ImportCache.py +95 -0
- nuitka/importing/ImportResolving.py +186 -0
- nuitka/importing/Importing.py +1200 -0
- nuitka/importing/PreloadedPackages.py +164 -0
- nuitka/importing/Recursion.py +611 -0
- nuitka/importing/StandardLibrary.py +429 -0
- nuitka/importing/__init__.py +19 -0
- nuitka/nodes/AsyncgenNodes.py +107 -0
- nuitka/nodes/AttributeLookupNodes.py +124 -0
- nuitka/nodes/AttributeNodes.py +386 -0
- nuitka/nodes/AttributeNodesGenerated.py +10734 -0
- nuitka/nodes/BuiltinAllNodes.py +115 -0
- nuitka/nodes/BuiltinAnyNodes.py +124 -0
- nuitka/nodes/BuiltinComplexNodes.py +83 -0
- nuitka/nodes/BuiltinDecodingNodes.py +52 -0
- nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
- nuitka/nodes/BuiltinDictNodes.py +140 -0
- nuitka/nodes/BuiltinFormatNodes.py +159 -0
- nuitka/nodes/BuiltinHashNodes.py +63 -0
- nuitka/nodes/BuiltinInputNodes.py +39 -0
- nuitka/nodes/BuiltinIntegerNodes.py +170 -0
- nuitka/nodes/BuiltinIteratorNodes.py +391 -0
- nuitka/nodes/BuiltinLenNodes.py +61 -0
- nuitka/nodes/BuiltinNextNodes.py +111 -0
- nuitka/nodes/BuiltinOpenNodes.py +148 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
- nuitka/nodes/BuiltinRangeNodes.py +690 -0
- nuitka/nodes/BuiltinRefNodes.py +314 -0
- nuitka/nodes/BuiltinSumNodes.py +104 -0
- nuitka/nodes/BuiltinTypeNodes.py +454 -0
- nuitka/nodes/BuiltinVarsNodes.py +44 -0
- nuitka/nodes/BytesNodes.py +829 -0
- nuitka/nodes/CallNodes.py +217 -0
- nuitka/nodes/Checkers.py +55 -0
- nuitka/nodes/ChildrenHavingMixins.py +21576 -0
- nuitka/nodes/ClassNodes.py +286 -0
- nuitka/nodes/CodeObjectSpecs.py +230 -0
- nuitka/nodes/ComparisonNodes.py +687 -0
- nuitka/nodes/ConditionalNodes.py +884 -0
- nuitka/nodes/ConstantRefNodes.py +1717 -0
- nuitka/nodes/ContainerMakingNodes.py +408 -0
- nuitka/nodes/ContainerOperationNodes.py +87 -0
- nuitka/nodes/CoroutineNodes.py +144 -0
- nuitka/nodes/CtypesNodes.py +51 -0
- nuitka/nodes/DictionaryNodes.py +1513 -0
- nuitka/nodes/ExceptionNodes.py +393 -0
- nuitka/nodes/ExecEvalNodes.py +229 -0
- nuitka/nodes/ExpressionBases.py +1301 -0
- nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
- nuitka/nodes/ExpressionShapeMixins.py +886 -0
- nuitka/nodes/FrameNodes.py +413 -0
- nuitka/nodes/FunctionAttributeNodes.py +102 -0
- nuitka/nodes/FunctionNodes.py +1303 -0
- nuitka/nodes/FutureSpecs.py +224 -0
- nuitka/nodes/GeneratorNodes.py +201 -0
- nuitka/nodes/GlobalsLocalsNodes.py +209 -0
- nuitka/nodes/HardImportNodesGenerated.py +3599 -0
- nuitka/nodes/ImportHardNodes.py +185 -0
- nuitka/nodes/ImportNodes.py +1366 -0
- nuitka/nodes/IndicatorMixins.py +79 -0
- nuitka/nodes/InjectCNodes.py +51 -0
- nuitka/nodes/IterationHandles.py +407 -0
- nuitka/nodes/KeyValuePairNodes.py +378 -0
- nuitka/nodes/ListOperationNodes.py +525 -0
- nuitka/nodes/LocalsDictNodes.py +717 -0
- nuitka/nodes/LocalsScopes.py +505 -0
- nuitka/nodes/LoopNodes.py +445 -0
- nuitka/nodes/MatchNodes.py +60 -0
- nuitka/nodes/ModuleAttributeNodes.py +180 -0
- nuitka/nodes/ModuleNodes.py +1137 -0
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +890 -0
- nuitka/nodes/NodeMakingHelpers.py +481 -0
- nuitka/nodes/NodeMetaClasses.py +172 -0
- nuitka/nodes/OperatorNodes.py +944 -0
- nuitka/nodes/OperatorNodesUnary.py +403 -0
- nuitka/nodes/OsSysNodes.py +215 -0
- nuitka/nodes/OutlineNodes.py +372 -0
- nuitka/nodes/PackageMetadataNodes.py +982 -0
- nuitka/nodes/PackageResourceNodes.py +424 -0
- nuitka/nodes/PrintNodes.py +105 -0
- nuitka/nodes/ReturnNodes.py +255 -0
- nuitka/nodes/SideEffectNodes.py +139 -0
- nuitka/nodes/SliceNodes.py +386 -0
- nuitka/nodes/StatementBasesGenerated.py +3419 -0
- nuitka/nodes/StatementNodes.py +316 -0
- nuitka/nodes/StrNodes.py +919 -0
- nuitka/nodes/StringConcatenationNodes.py +103 -0
- nuitka/nodes/SubscriptNodes.py +245 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +519 -0
- nuitka/nodes/TypeMatchNodes.py +65 -0
- nuitka/nodes/TypeNodes.py +390 -0
- nuitka/nodes/VariableAssignNodes.py +1177 -0
- nuitka/nodes/VariableDelNodes.py +320 -0
- nuitka/nodes/VariableNameNodes.py +153 -0
- nuitka/nodes/VariableRefNodes.py +895 -0
- nuitka/nodes/VariableReleaseNodes.py +153 -0
- nuitka/nodes/YieldNodes.py +121 -0
- nuitka/nodes/__init__.py +19 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
- nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +255 -0
- nuitka/nodes/shapes/StandardShapes.py +1384 -0
- nuitka/nodes/shapes/__init__.py +19 -0
- nuitka/optimizations/BytecodeDemotion.py +105 -0
- nuitka/optimizations/FunctionInlining.py +110 -0
- nuitka/optimizations/Graphs.py +70 -0
- nuitka/optimizations/Optimization.py +363 -0
- nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
- nuitka/optimizations/Tags.py +76 -0
- nuitka/optimizations/TraceCollections.py +1257 -0
- nuitka/optimizations/ValueTraces.py +980 -0
- nuitka/optimizations/__init__.py +19 -0
- nuitka/pgo/PGO.py +160 -0
- nuitka/pgo/__init__.py +19 -0
- nuitka/plugins/PluginBase.py +1924 -0
- nuitka/plugins/Plugins.py +2007 -0
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +19 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
- nuitka/plugins/standard/DataFilesPlugin.py +311 -0
- nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
- nuitka/plugins/standard/DillPlugin.py +137 -0
- nuitka/plugins/standard/DllFilesPlugin.py +527 -0
- nuitka/plugins/standard/EnumPlugin.py +64 -0
- nuitka/plugins/standard/EventletPlugin.py +57 -0
- nuitka/plugins/standard/GeventPlugin.py +64 -0
- nuitka/plugins/standard/GiPlugin.py +118 -0
- nuitka/plugins/standard/GlfwPlugin.py +138 -0
- nuitka/plugins/standard/ImplicitImports.py +845 -0
- nuitka/plugins/standard/KivyPlugin.py +141 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
- nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
- nuitka/plugins/standard/NumpyPlugin.py +35 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
- nuitka/plugins/standard/PbrPlugin.py +62 -0
- nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
- nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
- nuitka/plugins/standard/PmwPlugin.py +248 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
- nuitka/plugins/standard/PywebViewPlugin.py +81 -0
- nuitka/plugins/standard/SpacyPlugin.py +137 -0
- nuitka/plugins/standard/TensorflowPlugin.py +35 -0
- nuitka/plugins/standard/TkinterPlugin.py +416 -0
- nuitka/plugins/standard/TorchPlugin.py +35 -0
- nuitka/plugins/standard/TransformersPlugin.py +121 -0
- nuitka/plugins/standard/TrioPlugin.py +33 -0
- nuitka/plugins/standard/UpxPlugin.py +174 -0
- nuitka/plugins/standard/__init__.py +19 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
- nuitka/reports/CompilationReportReader.py +83 -0
- nuitka/reports/LicenseReport.rst.j2 +41 -0
- nuitka/reports/Reports.py +961 -0
- nuitka/reports/__init__.py +19 -0
- nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
- nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
- nuitka/specs/BuiltinListOperationSpecs.py +80 -0
- nuitka/specs/BuiltinParameterSpecs.py +831 -0
- nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
- nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
- nuitka/specs/HardImportSpecs.py +236 -0
- nuitka/specs/ParameterSpecs.py +630 -0
- nuitka/specs/__init__.py +19 -0
- nuitka/tools/Basics.py +55 -0
- nuitka/tools/__init__.py +19 -0
- nuitka/tools/commercial/__init__.py +21 -0
- nuitka/tools/data_composer/DataComposer.py +593 -0
- nuitka/tools/data_composer/__init__.py +19 -0
- nuitka/tools/data_composer/__main__.py +41 -0
- nuitka/tools/environments/CreateEnvironment.py +69 -0
- nuitka/tools/environments/Virtualenv.py +158 -0
- nuitka/tools/environments/__init__.py +19 -0
- nuitka/tools/general/__init__.py +19 -0
- nuitka/tools/general/dll_report/__init__.py +19 -0
- nuitka/tools/general/dll_report/__main__.py +83 -0
- nuitka/tools/general/find_module/FindModuleCode.py +127 -0
- nuitka/tools/general/find_module/__init__.py +19 -0
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
- nuitka/tools/onefile_compressor/__init__.py +19 -0
- nuitka/tools/onefile_compressor/__main__.py +41 -0
- nuitka/tools/podman/Podman.py +55 -0
- nuitka/tools/podman/__init__.py +19 -0
- nuitka/tools/podman/__main__.py +425 -0
- nuitka/tools/profiler/__init__.py +19 -0
- nuitka/tools/profiler/__main__.py +93 -0
- nuitka/tools/scanning/DisplayDistributions.py +39 -0
- nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
- nuitka/tools/scanning/DisplayPackageData.py +73 -0
- nuitka/tools/scanning/__init__.py +19 -0
- nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
- nuitka/tools/specialize/Common.py +380 -0
- nuitka/tools/specialize/SpecializeC.py +1483 -0
- nuitka/tools/specialize/SpecializePython.py +1151 -0
- nuitka/tools/specialize/__init__.py +19 -0
- nuitka/tools/testing/Common.py +2007 -0
- nuitka/tools/testing/Constructs.py +53 -0
- nuitka/tools/testing/DocTests.py +156 -0
- nuitka/tools/testing/OutputComparison.py +313 -0
- nuitka/tools/testing/Pythons.py +34 -0
- nuitka/tools/testing/RuntimeTracing.py +260 -0
- nuitka/tools/testing/SearchModes.py +208 -0
- nuitka/tools/testing/Valgrind.py +103 -0
- nuitka/tools/testing/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
- nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
- nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
- nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
- nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
- nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
- nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
- nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +145 -0
- nuitka/tools/watch/__init__.py +19 -0
- nuitka/tools/watch/__main__.py +615 -0
- nuitka/tree/Building.py +1459 -0
- nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
- nuitka/tree/Extractions.py +48 -0
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +96 -0
- nuitka/tree/Operations.py +45 -0
- nuitka/tree/ReformulationAssertStatements.py +97 -0
- nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
- nuitka/tree/ReformulationBooleanExpressions.py +97 -0
- nuitka/tree/ReformulationCallExpressions.py +314 -0
- nuitka/tree/ReformulationClasses.py +407 -0
- nuitka/tree/ReformulationClasses3.py +1149 -0
- nuitka/tree/ReformulationComparisonExpressions.py +174 -0
- nuitka/tree/ReformulationContractionExpressions.py +676 -0
- nuitka/tree/ReformulationDictionaryCreation.py +304 -0
- nuitka/tree/ReformulationExecStatements.py +386 -0
- nuitka/tree/ReformulationForLoopStatements.py +215 -0
- nuitka/tree/ReformulationFunctionStatements.py +931 -0
- nuitka/tree/ReformulationImportStatements.py +333 -0
- nuitka/tree/ReformulationLambdaExpressions.py +185 -0
- nuitka/tree/ReformulationMatchStatements.py +797 -0
- nuitka/tree/ReformulationMultidist.py +80 -0
- nuitka/tree/ReformulationNamespacePackages.py +239 -0
- nuitka/tree/ReformulationPrintStatements.py +127 -0
- nuitka/tree/ReformulationSequenceCreation.py +438 -0
- nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
- nuitka/tree/ReformulationTryExceptStatements.py +418 -0
- nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
- nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
- nuitka/tree/ReformulationWithStatements.py +382 -0
- nuitka/tree/ReformulationYieldExpressions.py +133 -0
- nuitka/tree/SourceHandling.py +476 -0
- nuitka/tree/SyntaxErrors.py +143 -0
- nuitka/tree/TreeHelpers.py +720 -0
- nuitka/tree/VariableClosure.py +483 -0
- nuitka/tree/__init__.py +19 -0
- nuitka/utils/AppDirs.py +104 -0
- nuitka/utils/CStrings.py +208 -0
- nuitka/utils/CommandLineOptions.py +207 -0
- nuitka/utils/Distributions.py +728 -0
- nuitka/utils/Download.py +217 -0
- nuitka/utils/Execution.py +517 -0
- nuitka/utils/FileOperations.py +1587 -0
- nuitka/utils/Hashing.py +137 -0
- nuitka/utils/Images.py +79 -0
- nuitka/utils/Importing.py +335 -0
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +254 -0
- nuitka/utils/InstanceCounters.py +86 -0
- nuitka/utils/Jinja2.py +158 -0
- nuitka/utils/Json.py +40 -0
- nuitka/utils/MacOSApp.py +134 -0
- nuitka/utils/MemoryUsage.py +165 -0
- nuitka/utils/ModuleNames.py +317 -0
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +152 -0
- nuitka/utils/Rest.py +60 -0
- nuitka/utils/SharedLibraries.py +1014 -0
- nuitka/utils/Shebang.py +113 -0
- nuitka/utils/Signing.py +144 -0
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +260 -0
- nuitka/utils/ThreadedExecutor.py +87 -0
- nuitka/utils/Timing.py +102 -0
- nuitka/utils/Utils.py +483 -0
- nuitka/utils/WindowsFileUsage.py +337 -0
- nuitka/utils/WindowsResources.py +652 -0
- nuitka/utils/Yaml.py +247 -0
- nuitka/utils/__init__.py +19 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
- nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
- nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
- nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
- nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
- nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
- nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2007 @@
|
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
""" Common test infrastructure functions. To be used by test runners. """
|
|
5
|
+
|
|
6
|
+
import atexit
|
|
7
|
+
import gc
|
|
8
|
+
import os
|
|
9
|
+
import shutil
|
|
10
|
+
import signal
|
|
11
|
+
import sys
|
|
12
|
+
import tempfile
|
|
13
|
+
import threading
|
|
14
|
+
import time
|
|
15
|
+
from contextlib import contextmanager
|
|
16
|
+
from optparse import OptionParser
|
|
17
|
+
|
|
18
|
+
from nuitka.__past__ import md5, subprocess
|
|
19
|
+
from nuitka.containers.OrderedDicts import OrderedDict
|
|
20
|
+
from nuitka.Options import getCommercialVersion
|
|
21
|
+
from nuitka.PythonVersions import getTestExecutionPythonVersions, isDebugPython
|
|
22
|
+
from nuitka.Tracing import OurLogger, flushStandardOutputs, my_print
|
|
23
|
+
from nuitka.tree.SourceHandling import readSourceCodeFromFilename
|
|
24
|
+
from nuitka.utils.AppDirs import getCacheDir
|
|
25
|
+
from nuitka.utils.Execution import (
|
|
26
|
+
check_output,
|
|
27
|
+
createProcess,
|
|
28
|
+
executeProcess,
|
|
29
|
+
getNullInput,
|
|
30
|
+
getNullOutput,
|
|
31
|
+
withEnvironmentVarOverridden,
|
|
32
|
+
)
|
|
33
|
+
from nuitka.utils.FileOperations import (
|
|
34
|
+
areSamePaths,
|
|
35
|
+
getExternalUsePath,
|
|
36
|
+
getFileContentByLine,
|
|
37
|
+
getFileContents,
|
|
38
|
+
getFileList,
|
|
39
|
+
getParentDirectories,
|
|
40
|
+
isFilenameSameAsOrBelowPath,
|
|
41
|
+
makePath,
|
|
42
|
+
openTextFile,
|
|
43
|
+
removeDirectory,
|
|
44
|
+
)
|
|
45
|
+
from nuitka.utils.InstalledPythons import findInstalledPython
|
|
46
|
+
from nuitka.utils.Jinja2 import getTemplate
|
|
47
|
+
from nuitka.utils.Utils import isFreeBSD, isLinux, isMacOS, isWin32Windows
|
|
48
|
+
|
|
49
|
+
from .SearchModes import (
|
|
50
|
+
SearchModeByPattern,
|
|
51
|
+
SearchModeCoverage,
|
|
52
|
+
SearchModeImmediate,
|
|
53
|
+
SearchModeOnly,
|
|
54
|
+
SearchModeResume,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# spell-checker: ignore popenargs,pathsep,killpg
|
|
58
|
+
|
|
59
|
+
test_logger = OurLogger("", base_style="blue")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def check_result(*popenargs, **kwargs):
|
|
63
|
+
if "stdout" in kwargs:
|
|
64
|
+
raise ValueError("stdout argument not allowed, it will be overridden.")
|
|
65
|
+
|
|
66
|
+
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
|
|
67
|
+
_unused_output, _unused_err = process.communicate()
|
|
68
|
+
ret_value = process.poll()
|
|
69
|
+
|
|
70
|
+
if ret_value:
|
|
71
|
+
return False
|
|
72
|
+
else:
|
|
73
|
+
return True
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
_start_dir = None
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def goMainDir():
|
|
80
|
+
global _start_dir # singleton, pylint: disable=global-statement
|
|
81
|
+
_start_dir = os.getcwd()
|
|
82
|
+
|
|
83
|
+
# Go its own directory, to have it easy with path knowledge.
|
|
84
|
+
os.chdir(os.path.dirname(os.path.abspath(sys.modules["__main__"].__file__)))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def getStartDir():
|
|
88
|
+
return _start_dir
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
_python_version_str = None
|
|
92
|
+
_python_version = None
|
|
93
|
+
_python_arch = None
|
|
94
|
+
_python_executable = None
|
|
95
|
+
_python_vendor = None
|
|
96
|
+
_python_debug = None
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _parsePythonVersionOutput(python_binary):
|
|
100
|
+
version_output = check_output(
|
|
101
|
+
(
|
|
102
|
+
python_binary,
|
|
103
|
+
"-c",
|
|
104
|
+
"""\
|
|
105
|
+
import sys, os;\
|
|
106
|
+
print(".".join(str(s) for s in list(sys.version_info)[:3]));\
|
|
107
|
+
print(("x86_64" if "AMD64" in sys.version else "x86") if os.name == "nt" else os.uname()[4]);\
|
|
108
|
+
print(sys.executable);\
|
|
109
|
+
print("Anaconda" if os.path.exists(os.path.join(sys.prefix, 'conda-meta')) else "Unknown");\
|
|
110
|
+
print(hasattr(sys, "gettotalrefcount"))\
|
|
111
|
+
""",
|
|
112
|
+
),
|
|
113
|
+
stderr=subprocess.STDOUT,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
if str is not bytes:
|
|
117
|
+
version_output = version_output.decode("utf8")
|
|
118
|
+
|
|
119
|
+
python_version_str = version_output.split("\n")[0].strip()
|
|
120
|
+
python_arch = version_output.split("\n")[1].strip()
|
|
121
|
+
python_executable = version_output.split("\n")[2].strip()
|
|
122
|
+
python_vendor = version_output.split("\n")[3].strip()
|
|
123
|
+
python_debug = version_output.split("\n")[4].strip()
|
|
124
|
+
|
|
125
|
+
assert type(python_version_str) is str, repr(python_version_str)
|
|
126
|
+
assert type(python_arch) is str, repr(python_arch)
|
|
127
|
+
assert type(python_executable) is str, repr(_python_executable)
|
|
128
|
+
|
|
129
|
+
python_version = tuple(int(d) for d in python_version_str.split("."))
|
|
130
|
+
python_debug = python_debug == "True"
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
python_version,
|
|
134
|
+
python_version_str,
|
|
135
|
+
python_arch,
|
|
136
|
+
python_executable,
|
|
137
|
+
python_vendor,
|
|
138
|
+
python_debug,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def setup(suite="", needs_io_encoding=False, silent=False, go_main=True):
|
|
143
|
+
if go_main:
|
|
144
|
+
goMainDir()
|
|
145
|
+
|
|
146
|
+
if "PYTHON" not in os.environ:
|
|
147
|
+
os.environ["PYTHON"] = sys.executable
|
|
148
|
+
|
|
149
|
+
# Allow test code to use this to make caching specific.
|
|
150
|
+
os.environ["NUITKA_TEST_SUITE"] = suite
|
|
151
|
+
|
|
152
|
+
# Allow providing 33, 27, and expand that to python2.7
|
|
153
|
+
if (
|
|
154
|
+
len(os.environ["PYTHON"]) == 2
|
|
155
|
+
and os.environ["PYTHON"].isdigit()
|
|
156
|
+
and not isWin32Windows()
|
|
157
|
+
):
|
|
158
|
+
os.environ["PYTHON"] = "python%s.%s" % (
|
|
159
|
+
os.environ["PYTHON"][0],
|
|
160
|
+
os.environ["PYTHON"][1],
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
if needs_io_encoding and "PYTHONIOENCODING" not in os.environ:
|
|
164
|
+
os.environ["PYTHONIOENCODING"] = "utf-8"
|
|
165
|
+
|
|
166
|
+
global _python_version_str, _python_version, _python_arch, _python_executable, _python_vendor, _python_debug # singleton, pylint: disable=global-statement
|
|
167
|
+
|
|
168
|
+
(
|
|
169
|
+
_python_version,
|
|
170
|
+
_python_version_str,
|
|
171
|
+
_python_arch,
|
|
172
|
+
_python_executable,
|
|
173
|
+
_python_vendor,
|
|
174
|
+
_python_debug,
|
|
175
|
+
) = _parsePythonVersionOutput(python_binary=os.environ["PYTHON"])
|
|
176
|
+
|
|
177
|
+
if not silent:
|
|
178
|
+
my_print("Using concrete python", _python_version_str, "on", _python_arch)
|
|
179
|
+
|
|
180
|
+
if "COVERAGE_FILE" not in os.environ:
|
|
181
|
+
os.environ["COVERAGE_FILE"] = os.path.join(
|
|
182
|
+
os.path.dirname(__file__), "..", "..", "..", ".coverage"
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
return _python_version
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def getPythonBinary():
|
|
189
|
+
return _python_executable
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def getPythonArch():
|
|
193
|
+
return _python_arch
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def getPythonVendor():
|
|
197
|
+
return _python_vendor
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def getPythonDebug():
|
|
201
|
+
return _python_debug
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def getPythonVersionString():
|
|
205
|
+
return _python_version_str
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
tmp_dir = None
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def getTempDir():
|
|
212
|
+
# Create a temporary directory to work in, automatically remove it in case
|
|
213
|
+
# it is empty in the end.
|
|
214
|
+
global tmp_dir # singleton, pylint: disable=global-statement
|
|
215
|
+
|
|
216
|
+
if tmp_dir is None:
|
|
217
|
+
tmp_dir = tempfile.mkdtemp(
|
|
218
|
+
prefix=os.path.basename(
|
|
219
|
+
os.path.dirname(os.path.abspath(sys.modules["__main__"].__file__))
|
|
220
|
+
)
|
|
221
|
+
+ "-",
|
|
222
|
+
dir=None if not (isLinux() and os.path.exists("/var/tmp")) else "/var/tmp",
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
def removeTempDir():
|
|
226
|
+
removeDirectory(
|
|
227
|
+
path=tmp_dir,
|
|
228
|
+
logger=test_logger,
|
|
229
|
+
ignore_errors=True,
|
|
230
|
+
extra_recommendation=None,
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
atexit.register(removeTempDir)
|
|
234
|
+
|
|
235
|
+
return tmp_dir
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def convertUsing2to3(path, force=False):
|
|
239
|
+
command = [os.environ["PYTHON"], "-m", "py_compile", path]
|
|
240
|
+
|
|
241
|
+
if not force:
|
|
242
|
+
if "xrange" not in getFileContents(path):
|
|
243
|
+
with getNullOutput() as null_output:
|
|
244
|
+
if check_result(command, stderr=null_output):
|
|
245
|
+
return path, False
|
|
246
|
+
|
|
247
|
+
filename = os.path.basename(path)
|
|
248
|
+
|
|
249
|
+
new_path = os.path.join(getTempDir(), filename)
|
|
250
|
+
|
|
251
|
+
# This may already be a temp file, e.g. because of construct creation.
|
|
252
|
+
try:
|
|
253
|
+
shutil.copy(path, new_path)
|
|
254
|
+
except shutil.Error:
|
|
255
|
+
pass
|
|
256
|
+
|
|
257
|
+
# For Python2.6 and 3.2 the -m lib2to3 was not yet supported.
|
|
258
|
+
use_binary = sys.version_info[:2] in ((2, 6), (3, 2))
|
|
259
|
+
|
|
260
|
+
if use_binary:
|
|
261
|
+
# On Windows, we cannot rely on 2to3 to be in the path.
|
|
262
|
+
if isWin32Windows():
|
|
263
|
+
command = [
|
|
264
|
+
sys.executable,
|
|
265
|
+
os.path.join(os.path.dirname(sys.executable), "Tools/Scripts/2to3.py"),
|
|
266
|
+
]
|
|
267
|
+
else:
|
|
268
|
+
command = ["2to3"]
|
|
269
|
+
else:
|
|
270
|
+
command = [sys.executable, "-m", "lib2to3"]
|
|
271
|
+
|
|
272
|
+
command += ("-w", "-n", "--no-diffs", new_path)
|
|
273
|
+
|
|
274
|
+
with getNullOutput() as null_output:
|
|
275
|
+
try:
|
|
276
|
+
check_output(command, stderr=null_output)
|
|
277
|
+
|
|
278
|
+
except subprocess.CalledProcessError:
|
|
279
|
+
if isWin32Windows():
|
|
280
|
+
raise
|
|
281
|
+
|
|
282
|
+
command[0:3] = ["2to3"]
|
|
283
|
+
|
|
284
|
+
check_output(command, stderr=null_output)
|
|
285
|
+
|
|
286
|
+
data = getFileContents(new_path)
|
|
287
|
+
|
|
288
|
+
with openTextFile(new_path, "w") as result_file:
|
|
289
|
+
result_file.write("__file__ = %r\n" % os.path.abspath(path))
|
|
290
|
+
result_file.write(data)
|
|
291
|
+
|
|
292
|
+
return new_path, True
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def decideFilenameVersionSkip(filename):
|
|
296
|
+
"""Make decision whether to skip based on filename and Python version.
|
|
297
|
+
|
|
298
|
+
This codifies certain rules that files can have as suffixes or prefixes
|
|
299
|
+
to make them be part of the set of tests executed for a version or not.
|
|
300
|
+
|
|
301
|
+
Generally, an ending of "<major><minor>.py" indicates that it must be that
|
|
302
|
+
Python version or higher. There is no need for ending in "26.py" as this
|
|
303
|
+
is the minimum version anyway.
|
|
304
|
+
|
|
305
|
+
The "_2.py" indicates a maximum version of 2.7, i.e. not Python 3.x, for
|
|
306
|
+
language syntax no more supported.
|
|
307
|
+
"""
|
|
308
|
+
|
|
309
|
+
# This will make many decisions with immediate returns.
|
|
310
|
+
# pylint: disable=too-many-branches,too-many-return-statements
|
|
311
|
+
|
|
312
|
+
assert type(filename) is str, repr(filename)
|
|
313
|
+
|
|
314
|
+
# There are commercial only test cases
|
|
315
|
+
if "commercial" in filename.lower() and getCommercialVersion() is None:
|
|
316
|
+
return False
|
|
317
|
+
|
|
318
|
+
# Skip runner scripts by default.
|
|
319
|
+
if filename.startswith("run_"):
|
|
320
|
+
return False
|
|
321
|
+
|
|
322
|
+
if filename.endswith(".j2"):
|
|
323
|
+
filename = filename[:-3]
|
|
324
|
+
|
|
325
|
+
# Skip tests that require Python 2.7 at least.
|
|
326
|
+
if filename.endswith("27.py") and _python_version < (2, 7):
|
|
327
|
+
return False
|
|
328
|
+
|
|
329
|
+
# Skip tests that require Python 2 at maximum.
|
|
330
|
+
if filename.endswith("_2.py") and _python_version >= (3,):
|
|
331
|
+
return False
|
|
332
|
+
|
|
333
|
+
# Skip tests that require Python 3.7 at maximum.
|
|
334
|
+
if filename.endswith("_37.py") and _python_version >= (3, 8):
|
|
335
|
+
return False
|
|
336
|
+
|
|
337
|
+
# Skip tests that require Python 3.11 at maximum.
|
|
338
|
+
if filename.endswith("_311.py") and _python_version >= (3, 8):
|
|
339
|
+
return False
|
|
340
|
+
|
|
341
|
+
# Skip tests that require Python 3.2 at least.
|
|
342
|
+
if filename.endswith("32.py") and _python_version < (3, 2):
|
|
343
|
+
return False
|
|
344
|
+
|
|
345
|
+
# Skip tests that require Python 3.3 at least.
|
|
346
|
+
if filename.endswith("33.py") and _python_version < (3, 3):
|
|
347
|
+
return False
|
|
348
|
+
|
|
349
|
+
# Skip tests that require Python 3.4 at least.
|
|
350
|
+
if filename.endswith("34.py") and _python_version < (3, 4):
|
|
351
|
+
return False
|
|
352
|
+
|
|
353
|
+
# Skip tests that require Python 3.5 at least.
|
|
354
|
+
if filename.endswith("35.py") and _python_version < (3, 5):
|
|
355
|
+
return False
|
|
356
|
+
|
|
357
|
+
# Skip tests that require Python 3.6 at least.
|
|
358
|
+
if filename.endswith("36.py") and _python_version < (3, 6):
|
|
359
|
+
return False
|
|
360
|
+
|
|
361
|
+
# Skip tests that require Python 3.7 at least.
|
|
362
|
+
if filename.endswith("37.py") and _python_version < (3, 7):
|
|
363
|
+
return False
|
|
364
|
+
|
|
365
|
+
# Skip tests that require Python 3.8 at least.
|
|
366
|
+
if filename.endswith("38.py") and _python_version < (3, 8):
|
|
367
|
+
return False
|
|
368
|
+
|
|
369
|
+
# Skip tests that require Python 3.9 at least.
|
|
370
|
+
if filename.endswith("39.py") and _python_version < (3, 9):
|
|
371
|
+
return False
|
|
372
|
+
|
|
373
|
+
# Skip tests that require Python 3.10 at least.
|
|
374
|
+
if filename.endswith("310.py") and _python_version < (3, 10):
|
|
375
|
+
return False
|
|
376
|
+
|
|
377
|
+
# Skip tests that require Python 3.11 at least.
|
|
378
|
+
if filename.endswith("311.py") and _python_version < (3, 11):
|
|
379
|
+
return False
|
|
380
|
+
|
|
381
|
+
# Skip tests that require Python 3.12 at least.
|
|
382
|
+
if filename.endswith("312.py") and _python_version < (3, 12):
|
|
383
|
+
return False
|
|
384
|
+
|
|
385
|
+
# Skip tests that require Python 3.13 at least.
|
|
386
|
+
if filename.endswith("313.py") and _python_version < (3, 13):
|
|
387
|
+
return False
|
|
388
|
+
|
|
389
|
+
return True
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
def _removeCPythonTestSuiteDir():
|
|
393
|
+
# Cleanup, some tests apparently forget that.
|
|
394
|
+
try:
|
|
395
|
+
if os.path.isdir("@test"):
|
|
396
|
+
removeDirectory(
|
|
397
|
+
"@test",
|
|
398
|
+
logger=test_logger,
|
|
399
|
+
ignore_errors=False,
|
|
400
|
+
extra_recommendation=None,
|
|
401
|
+
)
|
|
402
|
+
elif os.path.isfile("@test"):
|
|
403
|
+
os.unlink("@test")
|
|
404
|
+
except OSError:
|
|
405
|
+
# TODO: Move this into removeDirectory maybe. Doing an external
|
|
406
|
+
# call as last resort could be a good idea.
|
|
407
|
+
|
|
408
|
+
# This seems to work for broken "lnk" files.
|
|
409
|
+
if isWin32Windows():
|
|
410
|
+
os.system("rmdir /S /Q @test")
|
|
411
|
+
|
|
412
|
+
if os.path.exists("@test"):
|
|
413
|
+
raise
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
def _compareWithCPythonVariations(
|
|
417
|
+
dirname, filename, extra_flags, search_mode, on_error=None
|
|
418
|
+
):
|
|
419
|
+
if "" not in extra_flags:
|
|
420
|
+
test_logger.sysexit("Error, default flags not present")
|
|
421
|
+
|
|
422
|
+
# Drop empty values or identical values.
|
|
423
|
+
extra_flags = OrderedDict(
|
|
424
|
+
(key, value) for (key, value) in extra_flags.items() if (value or key == "")
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
def _getVariation(source, variant_name):
|
|
428
|
+
if type(source) in (dict, OrderedDict):
|
|
429
|
+
return source.get(variant_name, source.get(""))
|
|
430
|
+
else:
|
|
431
|
+
return source
|
|
432
|
+
|
|
433
|
+
if len(extra_flags) == 1:
|
|
434
|
+
return compareWithCPython(
|
|
435
|
+
dirname=dirname,
|
|
436
|
+
filename=filename,
|
|
437
|
+
extra_flags=_getVariation(extra_flags, ""),
|
|
438
|
+
search_mode=search_mode,
|
|
439
|
+
on_error=on_error,
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
for test_variant_name in extra_flags.keys():
|
|
443
|
+
if test_variant_name == "":
|
|
444
|
+
test_logger.info("Default variation of the test.")
|
|
445
|
+
else:
|
|
446
|
+
test_logger.info("Extra variation '%s'." % test_variant_name)
|
|
447
|
+
|
|
448
|
+
with withEnvironmentVarOverridden("NUITKA_TEST_VARIANT", test_variant_name):
|
|
449
|
+
compareWithCPython(
|
|
450
|
+
dirname=_getVariation(dirname, test_variant_name),
|
|
451
|
+
filename=_getVariation(filename, test_variant_name),
|
|
452
|
+
extra_flags=_getVariation(extra_flags, test_variant_name),
|
|
453
|
+
search_mode=search_mode,
|
|
454
|
+
on_error=on_error,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
def compareWithCPython(dirname, filename, extra_flags, search_mode, on_error=None):
|
|
459
|
+
"""Call the comparison tool. For a given directory filename.
|
|
460
|
+
|
|
461
|
+
The search mode decides if the test case aborts on error or gets extra
|
|
462
|
+
flags that are exceptions.
|
|
463
|
+
|
|
464
|
+
"""
|
|
465
|
+
|
|
466
|
+
# Allow being called with variations of extra flags.
|
|
467
|
+
if type(extra_flags) in (dict, OrderedDict):
|
|
468
|
+
return _compareWithCPythonVariations(
|
|
469
|
+
dirname=dirname,
|
|
470
|
+
filename=filename,
|
|
471
|
+
extra_flags=extra_flags,
|
|
472
|
+
search_mode=search_mode,
|
|
473
|
+
on_error=on_error,
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
if dirname is None:
|
|
477
|
+
path = filename
|
|
478
|
+
else:
|
|
479
|
+
path = os.path.join(dirname, filename)
|
|
480
|
+
|
|
481
|
+
if os.getenv("NUITKA_TEST_INSTALLED", "") == "1":
|
|
482
|
+
command = [
|
|
483
|
+
sys.executable,
|
|
484
|
+
"-m",
|
|
485
|
+
"nuitka.tools.testing.compare_with_cpython",
|
|
486
|
+
path,
|
|
487
|
+
"silent",
|
|
488
|
+
]
|
|
489
|
+
else:
|
|
490
|
+
compare_with_cpython = os.path.join("..", "..", "bin", "compare_with_cpython")
|
|
491
|
+
if os.path.exists(compare_with_cpython):
|
|
492
|
+
command = [sys.executable, compare_with_cpython, path, "silent"]
|
|
493
|
+
else:
|
|
494
|
+
test_logger.sysexit("Error, cannot locate Nuitka comparison runner.")
|
|
495
|
+
|
|
496
|
+
if extra_flags is not None:
|
|
497
|
+
command += extra_flags
|
|
498
|
+
|
|
499
|
+
command += search_mode.getExtraFlags(dirname, filename)
|
|
500
|
+
|
|
501
|
+
# Cleanup before and after test stage directory.
|
|
502
|
+
_removeCPythonTestSuiteDir()
|
|
503
|
+
|
|
504
|
+
try:
|
|
505
|
+
result = subprocess.call(command)
|
|
506
|
+
except KeyboardInterrupt:
|
|
507
|
+
result = 2
|
|
508
|
+
|
|
509
|
+
# Cleanup before and after test stage directory.
|
|
510
|
+
_removeCPythonTestSuiteDir()
|
|
511
|
+
|
|
512
|
+
if result != 0 and result != 2 and search_mode.abortOnFinding(dirname, filename):
|
|
513
|
+
if on_error is not None:
|
|
514
|
+
on_error(dirname, filename)
|
|
515
|
+
|
|
516
|
+
search_mode.onErrorDetected("Error exit! %s" % result)
|
|
517
|
+
|
|
518
|
+
if result == 2:
|
|
519
|
+
test_logger.sysexit("Interrupted, with CTRL-C\n", exit_code=2)
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
def checkCompilesNotWithCPython(dirname, filename, search_mode):
|
|
523
|
+
if dirname is None:
|
|
524
|
+
path = filename
|
|
525
|
+
else:
|
|
526
|
+
path = os.path.join(dirname, filename)
|
|
527
|
+
|
|
528
|
+
command = [_python_executable, "-mcompileall", path]
|
|
529
|
+
|
|
530
|
+
try:
|
|
531
|
+
result = subprocess.call(command)
|
|
532
|
+
except KeyboardInterrupt:
|
|
533
|
+
result = 2
|
|
534
|
+
|
|
535
|
+
if result != 1 and result != 2 and search_mode.abortOnFinding(dirname, filename):
|
|
536
|
+
search_mode.onErrorDetected("Error exit! %s" % result)
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
def checkSucceedsWithCPython(filename):
|
|
540
|
+
command = [_python_executable, filename]
|
|
541
|
+
|
|
542
|
+
stdout, stderr, exit_code = executeProcess(command)
|
|
543
|
+
|
|
544
|
+
if exit_code != 0:
|
|
545
|
+
my_print("stdout", stdout)
|
|
546
|
+
my_print("stderr", stderr)
|
|
547
|
+
|
|
548
|
+
return exit_code == 0
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
def getDebugPython():
|
|
552
|
+
# For all Python, if it's the one also executing the runner, which is
|
|
553
|
+
# very probably the case, we check that. We don't check the provided
|
|
554
|
+
# binary here, this could be done as well.
|
|
555
|
+
if sys.executable == os.environ["PYTHON"] and isDebugPython():
|
|
556
|
+
return sys.executable
|
|
557
|
+
|
|
558
|
+
# On Debian systems, these work.
|
|
559
|
+
debug_python = os.path.join("/usr/bin/", os.environ["PYTHON"] + "-dbg")
|
|
560
|
+
if os.path.exists(debug_python):
|
|
561
|
+
return debug_python
|
|
562
|
+
|
|
563
|
+
# On Fedora systems, these work, but on for Python3
|
|
564
|
+
debug_python = os.path.join("/usr/bin/", os.environ["PYTHON"] + "-debug")
|
|
565
|
+
if os.path.exists(debug_python) and _parsePythonVersionOutput(debug_python)[0] >= (
|
|
566
|
+
3,
|
|
567
|
+
):
|
|
568
|
+
return debug_python
|
|
569
|
+
|
|
570
|
+
# On Windows systems, these work. TODO: Python asserts in Nuitka with
|
|
571
|
+
# these, not sure why, pylint: disable=using-constant-test
|
|
572
|
+
if False:
|
|
573
|
+
debug_python = os.environ["PYTHON"]
|
|
574
|
+
if debug_python.lower().endswith(".exe"):
|
|
575
|
+
debug_python = debug_python[:-4]
|
|
576
|
+
debug_python = debug_python + "_d.exe"
|
|
577
|
+
if os.path.exists(debug_python):
|
|
578
|
+
return debug_python
|
|
579
|
+
|
|
580
|
+
# Otherwise no.
|
|
581
|
+
return None
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def displayRuntimeTraces(logger, path):
|
|
585
|
+
if not os.path.exists(path):
|
|
586
|
+
# TODO: Have a logger package passed.
|
|
587
|
+
logger.sysexit("Error, cannot find %r (%r)." % (path, os.path.abspath(path)))
|
|
588
|
+
|
|
589
|
+
path = os.path.abspath(path)
|
|
590
|
+
|
|
591
|
+
# TODO: Merge code for building command with below function, this is otherwise
|
|
592
|
+
# horribly bad.
|
|
593
|
+
|
|
594
|
+
if os.name == "posix":
|
|
595
|
+
# Run with traces to help debugging, specifically in CI environment.
|
|
596
|
+
if isMacOS() or isFreeBSD():
|
|
597
|
+
test_logger.info("dtruss:")
|
|
598
|
+
flushStandardOutputs()
|
|
599
|
+
os.system("sudo dtruss %s" % path)
|
|
600
|
+
else:
|
|
601
|
+
test_logger.info("strace:")
|
|
602
|
+
flushStandardOutputs()
|
|
603
|
+
os.system("strace -s4096 -e file %s" % path)
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
def hasModule(module_name):
|
|
607
|
+
with getNullOutput() as null_output:
|
|
608
|
+
result = subprocess.call(
|
|
609
|
+
(os.environ["PYTHON"], "-c", "import %s" % module_name),
|
|
610
|
+
stdout=null_output,
|
|
611
|
+
stderr=subprocess.STDOUT,
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
return result == 0
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
m1 = {}
|
|
618
|
+
m2 = {}
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
def cleanObjRefCntMaps():
|
|
622
|
+
m1.clear()
|
|
623
|
+
m2.clear()
|
|
624
|
+
|
|
625
|
+
# Warm out repr
|
|
626
|
+
for x in gc.get_objects():
|
|
627
|
+
try:
|
|
628
|
+
str(x)
|
|
629
|
+
except Exception: # Catch all the things, pylint: disable=broad-except
|
|
630
|
+
pass
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
def snapObjRefCntMap(before):
|
|
634
|
+
# Inherently complex, pylint: disable=too-many-branches
|
|
635
|
+
|
|
636
|
+
if before:
|
|
637
|
+
m = m1
|
|
638
|
+
else:
|
|
639
|
+
m = m2
|
|
640
|
+
|
|
641
|
+
m.clear()
|
|
642
|
+
gc.collect()
|
|
643
|
+
|
|
644
|
+
for x in gc.get_objects():
|
|
645
|
+
# The dictionary is cyclic, and contains itself, avoid that.
|
|
646
|
+
if x is m1 or x is m2:
|
|
647
|
+
continue
|
|
648
|
+
|
|
649
|
+
if type(x) is str and (x in m1 or x in m2):
|
|
650
|
+
continue
|
|
651
|
+
|
|
652
|
+
if type(x) is not str and isinstance(x, str):
|
|
653
|
+
k = "str_overload_" + x.__class__.__name__ + str(x)
|
|
654
|
+
elif type(x) is dict:
|
|
655
|
+
if "__builtins__" in x:
|
|
656
|
+
k = "<module dict %s>" % x.get("__name__", "<maybe not a module>")
|
|
657
|
+
elif "__spec__" in x and "__name__" in x:
|
|
658
|
+
k = "<module dict %s>" % x["__name__"]
|
|
659
|
+
else:
|
|
660
|
+
k = str(x)
|
|
661
|
+
elif hasattr(x, "__class__") and x.__class__.__name__ == "compiled_frame":
|
|
662
|
+
k = "<compiled_frame at xxx, line %d code %s" % (x.f_lineno, x.f_code)
|
|
663
|
+
else:
|
|
664
|
+
k = str(x)
|
|
665
|
+
|
|
666
|
+
c = sys.getrefcount(x)
|
|
667
|
+
|
|
668
|
+
if k in m:
|
|
669
|
+
m[k] += c
|
|
670
|
+
else:
|
|
671
|
+
m[k] = c
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
orig_print = None
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def disablePrinting():
|
|
678
|
+
# Singleton, pylint: disable=global-statement
|
|
679
|
+
global orig_print
|
|
680
|
+
|
|
681
|
+
if orig_print is None:
|
|
682
|
+
orig_print = __builtins__["print"]
|
|
683
|
+
__builtins__["print"] = lambda *args, **kwargs: None
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
def reenablePrinting():
|
|
687
|
+
# Singleton, pylint: disable=global-statement
|
|
688
|
+
global orig_print
|
|
689
|
+
|
|
690
|
+
if orig_print is not None:
|
|
691
|
+
__builtins__["print"] = orig_print
|
|
692
|
+
orig_print = None
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
_debug_python = isDebugPython()
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
def getTotalReferenceCount():
|
|
699
|
+
if _debug_python:
|
|
700
|
+
gc.collect()
|
|
701
|
+
return sys.gettotalrefcount()
|
|
702
|
+
else:
|
|
703
|
+
gc.collect()
|
|
704
|
+
all_objects = gc.get_objects()
|
|
705
|
+
|
|
706
|
+
# Sum object reference twice, once without the sum value type, then switch
|
|
707
|
+
# the type, and use the type used to avoid the integers before that.
|
|
708
|
+
result = 0.0
|
|
709
|
+
for obj in all_objects:
|
|
710
|
+
if type(obj) is float:
|
|
711
|
+
continue
|
|
712
|
+
|
|
713
|
+
result += sys.getrefcount(obj)
|
|
714
|
+
|
|
715
|
+
result = int(result)
|
|
716
|
+
|
|
717
|
+
for obj in all_objects:
|
|
718
|
+
if type(obj) is not float:
|
|
719
|
+
continue
|
|
720
|
+
|
|
721
|
+
result += sys.getrefcount(obj)
|
|
722
|
+
|
|
723
|
+
return result
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
def checkReferenceCount(checked_function, max_rounds=20, explain=False, no_print=True):
|
|
727
|
+
# This is obviously going to be complex, pylint: disable=too-many-branches
|
|
728
|
+
|
|
729
|
+
# Clean start conditions.
|
|
730
|
+
assert sys.exc_info() == (None, None, None), sys.exc_info()
|
|
731
|
+
|
|
732
|
+
my_print(checked_function.__name__ + ": ", end="")
|
|
733
|
+
sys.stdout.flush()
|
|
734
|
+
|
|
735
|
+
if no_print:
|
|
736
|
+
disablePrinting()
|
|
737
|
+
|
|
738
|
+
# Make sure reference for these are already taken at the start.
|
|
739
|
+
ref_count1 = 17
|
|
740
|
+
ref_count2 = 17
|
|
741
|
+
|
|
742
|
+
if explain:
|
|
743
|
+
cleanObjRefCntMaps()
|
|
744
|
+
|
|
745
|
+
assert max_rounds > 0
|
|
746
|
+
|
|
747
|
+
result = False
|
|
748
|
+
|
|
749
|
+
for count in range(max_rounds):
|
|
750
|
+
if explain and count == max_rounds - 1:
|
|
751
|
+
snapObjRefCntMap(before=True)
|
|
752
|
+
|
|
753
|
+
ref_count1 = getTotalReferenceCount()
|
|
754
|
+
|
|
755
|
+
checked_function()
|
|
756
|
+
|
|
757
|
+
ref_count2 = getTotalReferenceCount()
|
|
758
|
+
|
|
759
|
+
# Not allowed, but happens when bugs occur.
|
|
760
|
+
assert sys.exc_info() == (None, None, None), sys.exc_info()
|
|
761
|
+
|
|
762
|
+
if ref_count1 == ref_count2:
|
|
763
|
+
result = True
|
|
764
|
+
break
|
|
765
|
+
|
|
766
|
+
if explain and count == max_rounds - 1:
|
|
767
|
+
snapObjRefCntMap(before=False)
|
|
768
|
+
|
|
769
|
+
if no_print:
|
|
770
|
+
reenablePrinting()
|
|
771
|
+
|
|
772
|
+
if result:
|
|
773
|
+
my_print("PASSED")
|
|
774
|
+
else:
|
|
775
|
+
my_print(
|
|
776
|
+
"FAILED %d %d leaked %d" % (ref_count1, ref_count2, ref_count2 - ref_count1)
|
|
777
|
+
)
|
|
778
|
+
|
|
779
|
+
if explain:
|
|
780
|
+
print("REPORT of differences:")
|
|
781
|
+
assert m1
|
|
782
|
+
assert m2
|
|
783
|
+
|
|
784
|
+
# Using items will unwanted usages, pylint: disable=consider-using-dict-items
|
|
785
|
+
for key in m1:
|
|
786
|
+
if key not in m2:
|
|
787
|
+
my_print("*" * 80)
|
|
788
|
+
my_print("extra:", m1[key], key)
|
|
789
|
+
elif m1[key] != m2[key]:
|
|
790
|
+
my_print("*" * 80)
|
|
791
|
+
my_print(m1[key], "->", m2[key], repr(key))
|
|
792
|
+
else:
|
|
793
|
+
pass
|
|
794
|
+
|
|
795
|
+
for key in m2:
|
|
796
|
+
if key not in m1:
|
|
797
|
+
my_print("*" * 80)
|
|
798
|
+
my_print("missing:", m2[key], key)
|
|
799
|
+
|
|
800
|
+
# print m1[key]
|
|
801
|
+
|
|
802
|
+
assert sys.exc_info() == (None, None, None), sys.exc_info()
|
|
803
|
+
|
|
804
|
+
gc.collect()
|
|
805
|
+
sys.stdout.flush()
|
|
806
|
+
|
|
807
|
+
return result
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
def createSearchMode():
|
|
811
|
+
# Dealing with many options, pylint: disable=too-many-branches
|
|
812
|
+
# Return driven, pylint: disable=too-many-return-statements
|
|
813
|
+
|
|
814
|
+
parser = OptionParser()
|
|
815
|
+
|
|
816
|
+
select_group = parser.add_option_group("Select Tests")
|
|
817
|
+
|
|
818
|
+
select_group.add_option(
|
|
819
|
+
"--pattern",
|
|
820
|
+
action="store",
|
|
821
|
+
dest="pattern",
|
|
822
|
+
default="",
|
|
823
|
+
help="""\
|
|
824
|
+
Execute only tests matching the pattern. Defaults to all tests.""",
|
|
825
|
+
)
|
|
826
|
+
select_group.add_option(
|
|
827
|
+
"--all",
|
|
828
|
+
action="store_true",
|
|
829
|
+
dest="all",
|
|
830
|
+
default=False,
|
|
831
|
+
help="""\
|
|
832
|
+
Execute all tests, continue execution even after failure of one.""",
|
|
833
|
+
)
|
|
834
|
+
select_group.add_option(
|
|
835
|
+
"--jobs",
|
|
836
|
+
action="store",
|
|
837
|
+
dest="jobs",
|
|
838
|
+
default=None,
|
|
839
|
+
help="""\
|
|
840
|
+
Pass this as the --jobs value to Nuitka.""",
|
|
841
|
+
)
|
|
842
|
+
|
|
843
|
+
del select_group
|
|
844
|
+
|
|
845
|
+
debug_group = parser.add_option_group("Test features")
|
|
846
|
+
|
|
847
|
+
debug_group.add_option(
|
|
848
|
+
"--debug",
|
|
849
|
+
action="store_true",
|
|
850
|
+
dest="debug",
|
|
851
|
+
default=False,
|
|
852
|
+
help="""\
|
|
853
|
+
Executing all self checks possible to find errors in Nuitka, good for test coverage.
|
|
854
|
+
Defaults to off.""",
|
|
855
|
+
)
|
|
856
|
+
|
|
857
|
+
debug_group.add_option(
|
|
858
|
+
"--commands",
|
|
859
|
+
action="store_true",
|
|
860
|
+
dest="show_commands",
|
|
861
|
+
default=False,
|
|
862
|
+
help="""Output commands being done in output comparison.
|
|
863
|
+
Defaults to off.""",
|
|
864
|
+
)
|
|
865
|
+
|
|
866
|
+
del debug_group
|
|
867
|
+
|
|
868
|
+
options, positional_args = parser.parse_args()
|
|
869
|
+
|
|
870
|
+
if options.debug:
|
|
871
|
+
addExtendedExtraOptions("--debug")
|
|
872
|
+
|
|
873
|
+
if options.jobs is not None:
|
|
874
|
+
addExtendedExtraOptions("--jobs=%s" % options.jobs)
|
|
875
|
+
|
|
876
|
+
if options.show_commands:
|
|
877
|
+
os.environ["NUITKA_TRACE_COMMANDS"] = "1"
|
|
878
|
+
|
|
879
|
+
# Default to searching.
|
|
880
|
+
mode = positional_args[0] if positional_args else "search"
|
|
881
|
+
|
|
882
|
+
# Avoid having to use options style.
|
|
883
|
+
if mode in ("search", "only", "coverage"):
|
|
884
|
+
if len(positional_args) >= 2 and not options.pattern:
|
|
885
|
+
options.pattern = positional_args[1]
|
|
886
|
+
|
|
887
|
+
if mode == "search":
|
|
888
|
+
if options.all:
|
|
889
|
+
return SearchModeByPattern(start_at=None)
|
|
890
|
+
elif options.pattern:
|
|
891
|
+
return SearchModeByPattern(
|
|
892
|
+
start_at=options.pattern.replace("/", os.path.sep)
|
|
893
|
+
)
|
|
894
|
+
else:
|
|
895
|
+
return SearchModeImmediate()
|
|
896
|
+
elif mode == "resume":
|
|
897
|
+
return SearchModeResume(sys.modules["__main__"].__file__, skip=False)
|
|
898
|
+
elif mode == "skip":
|
|
899
|
+
return SearchModeResume(sys.modules["__main__"].__file__, skip=True)
|
|
900
|
+
elif mode == "only":
|
|
901
|
+
if options.pattern:
|
|
902
|
+
pattern = options.pattern.replace("/", os.path.sep)
|
|
903
|
+
return SearchModeOnly(pattern)
|
|
904
|
+
else:
|
|
905
|
+
assert False
|
|
906
|
+
elif mode == "coverage":
|
|
907
|
+
return SearchModeCoverage(
|
|
908
|
+
start_at=(
|
|
909
|
+
options.pattern.replace("/", os.path.sep) if options.pattern else None
|
|
910
|
+
)
|
|
911
|
+
)
|
|
912
|
+
else:
|
|
913
|
+
test_logger.sysexit("Error, using unknown search mode %r" % mode)
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
def reportSkip(reason, dirname, filename):
|
|
917
|
+
case = os.path.join(dirname, filename)
|
|
918
|
+
case = os.path.normpath(case)
|
|
919
|
+
|
|
920
|
+
test_logger.info("Skipped, %s (%s)." % (case, reason))
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
def executeReferenceChecked(
|
|
924
|
+
prefix, names, tests_skipped=(), tests_stderr=(), explain=False, no_print=True
|
|
925
|
+
):
|
|
926
|
+
gc.disable()
|
|
927
|
+
|
|
928
|
+
extract_number = lambda name: int(name.replace(prefix, "") or "0")
|
|
929
|
+
|
|
930
|
+
# Find the function names.
|
|
931
|
+
matching_names = tuple(
|
|
932
|
+
name for name in names if name.startswith(prefix) and name[-1].isdigit()
|
|
933
|
+
)
|
|
934
|
+
|
|
935
|
+
old_stderr = sys.stderr
|
|
936
|
+
|
|
937
|
+
# Everything passed
|
|
938
|
+
result = True
|
|
939
|
+
|
|
940
|
+
for name in sorted(matching_names, key=extract_number):
|
|
941
|
+
number = extract_number(name)
|
|
942
|
+
|
|
943
|
+
# print(tests_skipped)
|
|
944
|
+
if number in tests_skipped:
|
|
945
|
+
my_print(name + ": SKIPPED (%s)" % tests_skipped[number])
|
|
946
|
+
continue
|
|
947
|
+
|
|
948
|
+
# Avoid non-raisable output.
|
|
949
|
+
with getNullOutput() as null_output:
|
|
950
|
+
try:
|
|
951
|
+
if number in tests_stderr:
|
|
952
|
+
sys.stderr = null_output
|
|
953
|
+
except OSError: # Windows
|
|
954
|
+
if not checkReferenceCount(
|
|
955
|
+
names[name], explain=explain, no_print=no_print
|
|
956
|
+
):
|
|
957
|
+
result = False
|
|
958
|
+
else:
|
|
959
|
+
if not checkReferenceCount(
|
|
960
|
+
names[name], explain=explain, no_print=no_print
|
|
961
|
+
):
|
|
962
|
+
result = False
|
|
963
|
+
finally:
|
|
964
|
+
if number in tests_stderr:
|
|
965
|
+
sys.stderr = old_stderr
|
|
966
|
+
|
|
967
|
+
gc.enable()
|
|
968
|
+
return result
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
def addToPythonPath(python_path, in_front=False):
|
|
972
|
+
if type(python_path) in (tuple, list):
|
|
973
|
+
python_path = os.pathsep.join(python_path)
|
|
974
|
+
|
|
975
|
+
if python_path:
|
|
976
|
+
if "PYTHONPATH" in os.environ:
|
|
977
|
+
if in_front:
|
|
978
|
+
os.environ["PYTHONPATH"] = (
|
|
979
|
+
python_path + os.pathsep + os.environ["PYTHONPATH"]
|
|
980
|
+
)
|
|
981
|
+
else:
|
|
982
|
+
os.environ["PYTHONPATH"] += os.pathsep + python_path
|
|
983
|
+
else:
|
|
984
|
+
os.environ["PYTHONPATH"] = python_path
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
@contextmanager
|
|
988
|
+
def withPythonPathChange(python_path):
|
|
989
|
+
if python_path:
|
|
990
|
+
if type(python_path) not in (tuple, list):
|
|
991
|
+
python_path = python_path.split(os.pathsep)
|
|
992
|
+
|
|
993
|
+
python_path = [
|
|
994
|
+
os.path.normpath(os.path.abspath(element)) for element in python_path
|
|
995
|
+
]
|
|
996
|
+
|
|
997
|
+
python_path = os.pathsep.join(python_path)
|
|
998
|
+
|
|
999
|
+
if "PYTHONPATH" in os.environ:
|
|
1000
|
+
old_path = os.environ["PYTHONPATH"]
|
|
1001
|
+
os.environ["PYTHONPATH"] += os.pathsep + python_path
|
|
1002
|
+
else:
|
|
1003
|
+
old_path = None
|
|
1004
|
+
os.environ["PYTHONPATH"] = python_path
|
|
1005
|
+
|
|
1006
|
+
yield
|
|
1007
|
+
|
|
1008
|
+
if python_path:
|
|
1009
|
+
if old_path is None:
|
|
1010
|
+
del os.environ["PYTHONPATH"]
|
|
1011
|
+
else:
|
|
1012
|
+
os.environ["PYTHONPATH"] = old_path
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
def addExtendedExtraOptions(*args):
|
|
1016
|
+
old_value = os.getenv("NUITKA_EXTRA_OPTIONS")
|
|
1017
|
+
|
|
1018
|
+
value = old_value
|
|
1019
|
+
|
|
1020
|
+
for arg in args:
|
|
1021
|
+
if value is None:
|
|
1022
|
+
value = arg
|
|
1023
|
+
else:
|
|
1024
|
+
value += " " + arg
|
|
1025
|
+
|
|
1026
|
+
os.environ["NUITKA_EXTRA_OPTIONS"] = value
|
|
1027
|
+
|
|
1028
|
+
return old_value
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
@contextmanager
|
|
1032
|
+
def withExtendedExtraOptions(*args):
|
|
1033
|
+
assert args
|
|
1034
|
+
|
|
1035
|
+
old_value = addExtendedExtraOptions(*args)
|
|
1036
|
+
|
|
1037
|
+
yield
|
|
1038
|
+
|
|
1039
|
+
if old_value is None:
|
|
1040
|
+
del os.environ["NUITKA_EXTRA_OPTIONS"]
|
|
1041
|
+
else:
|
|
1042
|
+
os.environ["NUITKA_EXTRA_OPTIONS"] = old_value
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
def indentedCode(codes, count):
|
|
1046
|
+
"""Indent code, used for generating test codes."""
|
|
1047
|
+
indent = " " * count
|
|
1048
|
+
return "\n".join(indent + line if line else "" for line in codes)
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
def compileLibraryPath(search_mode, path, stage_dir, decide, action):
|
|
1052
|
+
my_print("Checking standard library path:", path)
|
|
1053
|
+
|
|
1054
|
+
for root, dirnames, filenames in os.walk(path):
|
|
1055
|
+
dirnames_to_remove = [dirname for dirname in dirnames if "-" in dirname]
|
|
1056
|
+
|
|
1057
|
+
for dirname in dirnames_to_remove:
|
|
1058
|
+
dirnames.remove(dirname)
|
|
1059
|
+
|
|
1060
|
+
dirnames.sort()
|
|
1061
|
+
|
|
1062
|
+
filenames = [filename for filename in filenames if decide(root, filename)]
|
|
1063
|
+
|
|
1064
|
+
for filename in sorted(filenames):
|
|
1065
|
+
if not search_mode.consider(root, filename):
|
|
1066
|
+
continue
|
|
1067
|
+
|
|
1068
|
+
full_path = os.path.join(root, filename)
|
|
1069
|
+
|
|
1070
|
+
my_print(full_path, ":", end=" ")
|
|
1071
|
+
sys.stdout.flush()
|
|
1072
|
+
|
|
1073
|
+
action(stage_dir, path, full_path)
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
def compileLibraryTest(search_mode, stage_dir, decide, action):
|
|
1077
|
+
if not os.path.exists(stage_dir):
|
|
1078
|
+
os.makedirs(stage_dir)
|
|
1079
|
+
|
|
1080
|
+
my_dirname = os.path.join(os.path.dirname(__file__), "../../..")
|
|
1081
|
+
my_dirname = os.path.normpath(my_dirname)
|
|
1082
|
+
|
|
1083
|
+
paths = [path for path in sys.path if not path.startswith(my_dirname)]
|
|
1084
|
+
|
|
1085
|
+
my_print("Using standard library paths:")
|
|
1086
|
+
for path in paths:
|
|
1087
|
+
my_print(path)
|
|
1088
|
+
|
|
1089
|
+
for path in paths:
|
|
1090
|
+
print("Checking path:", path)
|
|
1091
|
+
compileLibraryPath(
|
|
1092
|
+
search_mode=search_mode,
|
|
1093
|
+
path=path,
|
|
1094
|
+
stage_dir=stage_dir,
|
|
1095
|
+
decide=decide,
|
|
1096
|
+
action=action,
|
|
1097
|
+
)
|
|
1098
|
+
|
|
1099
|
+
search_mode.finish()
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
def run_async(coro):
|
|
1103
|
+
"""Execute a coroutine until it's done."""
|
|
1104
|
+
|
|
1105
|
+
values = []
|
|
1106
|
+
result = None
|
|
1107
|
+
while True:
|
|
1108
|
+
try:
|
|
1109
|
+
values.append(coro.send(None))
|
|
1110
|
+
except StopIteration as ex:
|
|
1111
|
+
result = ex.args[0] if ex.args else None
|
|
1112
|
+
break
|
|
1113
|
+
return values, result
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
def async_iterate(g):
|
|
1117
|
+
"""Execute async generator until it's done."""
|
|
1118
|
+
|
|
1119
|
+
# Test code for Python3, catches all kinds of exceptions.
|
|
1120
|
+
# pylint: disable=broad-except
|
|
1121
|
+
|
|
1122
|
+
# Also Python3 only, pylint: disable=I0021,undefined-variable
|
|
1123
|
+
|
|
1124
|
+
res = []
|
|
1125
|
+
while True:
|
|
1126
|
+
try:
|
|
1127
|
+
g.__anext__().__next__()
|
|
1128
|
+
except StopAsyncIteration:
|
|
1129
|
+
res.append("STOP")
|
|
1130
|
+
break
|
|
1131
|
+
except StopIteration as ex:
|
|
1132
|
+
if ex.args:
|
|
1133
|
+
res.append("StopIteration args %s" % ex.args)
|
|
1134
|
+
else:
|
|
1135
|
+
res.append("EMPTY StopIteration")
|
|
1136
|
+
break
|
|
1137
|
+
except Exception as ex:
|
|
1138
|
+
res.append(str(type(ex)))
|
|
1139
|
+
|
|
1140
|
+
return res
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
def sync_iterate(g):
|
|
1144
|
+
"""Execute sync generator until it's done."""
|
|
1145
|
+
res = []
|
|
1146
|
+
|
|
1147
|
+
while True:
|
|
1148
|
+
try:
|
|
1149
|
+
if str is bytes:
|
|
1150
|
+
res.append(next(g))
|
|
1151
|
+
else:
|
|
1152
|
+
res.append(g.__next__())
|
|
1153
|
+
except StopIteration as ex:
|
|
1154
|
+
if ex.args:
|
|
1155
|
+
res.append("StopIteration arg %s" % ex.args[0])
|
|
1156
|
+
else:
|
|
1157
|
+
res.append("EMPTY StopIteration")
|
|
1158
|
+
|
|
1159
|
+
break
|
|
1160
|
+
except Exception as ex: # pylint: disable=broad-exception-caught
|
|
1161
|
+
|
|
1162
|
+
res.append(str(type(ex)))
|
|
1163
|
+
|
|
1164
|
+
return res
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
def getTestingCacheDir():
|
|
1168
|
+
cache_dir = getCacheDir("tests_state")
|
|
1169
|
+
makePath(cache_dir)
|
|
1170
|
+
return cache_dir
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
def getTestingCPythonOutputsCacheDir():
|
|
1174
|
+
cache_dir = getCacheDir("cpython_outputs")
|
|
1175
|
+
|
|
1176
|
+
result = os.path.join(cache_dir, os.getenv("NUITKA_TEST_SUITE", ""))
|
|
1177
|
+
|
|
1178
|
+
makePath(result)
|
|
1179
|
+
return result
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
def scanDirectoryForTestCases(
|
|
1183
|
+
dirname, template_context=None, cases_are_directories=False
|
|
1184
|
+
):
|
|
1185
|
+
filenames = os.listdir(dirname)
|
|
1186
|
+
|
|
1187
|
+
if not cases_are_directories:
|
|
1188
|
+
filenames = [
|
|
1189
|
+
filename
|
|
1190
|
+
for filename in filenames
|
|
1191
|
+
if (filename.endswith(".py") and filename + ".j2" not in filenames)
|
|
1192
|
+
or filename.endswith(".j2")
|
|
1193
|
+
]
|
|
1194
|
+
|
|
1195
|
+
for filename in sorted(filenames):
|
|
1196
|
+
if filename.endswith((".build", ".onefile-build", ".dist", ".app")):
|
|
1197
|
+
continue
|
|
1198
|
+
|
|
1199
|
+
filename_full = os.path.join(dirname, filename)
|
|
1200
|
+
|
|
1201
|
+
if cases_are_directories:
|
|
1202
|
+
if not os.path.isdir(filename_full):
|
|
1203
|
+
continue
|
|
1204
|
+
else:
|
|
1205
|
+
if not os.path.isfile(filename_full):
|
|
1206
|
+
continue
|
|
1207
|
+
|
|
1208
|
+
if not decideFilenameVersionSkip(filename):
|
|
1209
|
+
continue
|
|
1210
|
+
|
|
1211
|
+
if cases_are_directories and filename.endswith(".j2"):
|
|
1212
|
+
# Needs to be a dictionary with template arguments.
|
|
1213
|
+
assert template_context is not None
|
|
1214
|
+
|
|
1215
|
+
template = getTemplate(
|
|
1216
|
+
package_name=None,
|
|
1217
|
+
template_name=filename,
|
|
1218
|
+
template_subdir=dirname,
|
|
1219
|
+
extensions=("jinja2.ext.do",),
|
|
1220
|
+
)
|
|
1221
|
+
|
|
1222
|
+
code = template.render(name=template.name, **template_context)
|
|
1223
|
+
|
|
1224
|
+
filename = filename[:-3]
|
|
1225
|
+
with openTextFile(filename, "w") as output:
|
|
1226
|
+
output.write(
|
|
1227
|
+
"'''Automatically generated test, not part of releases or git.\n\n'''\n"
|
|
1228
|
+
)
|
|
1229
|
+
|
|
1230
|
+
output.write(code)
|
|
1231
|
+
|
|
1232
|
+
yield filename
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
def scanDirectoryForTestCaseFolders(dirname, allow_none=False):
|
|
1236
|
+
filenames = os.listdir(dirname)
|
|
1237
|
+
|
|
1238
|
+
for filename in sorted(filenames):
|
|
1239
|
+
if not decideFilenameVersionSkip(filename + ".py"):
|
|
1240
|
+
continue
|
|
1241
|
+
|
|
1242
|
+
filename = os.path.join(dirname, filename)
|
|
1243
|
+
filename = os.path.relpath(filename)
|
|
1244
|
+
|
|
1245
|
+
if (
|
|
1246
|
+
not os.path.isdir(filename)
|
|
1247
|
+
or filename.endswith((".dist", ".build"))
|
|
1248
|
+
or os.path.basename(filename).startswith("venv_")
|
|
1249
|
+
):
|
|
1250
|
+
continue
|
|
1251
|
+
|
|
1252
|
+
filename_main = getMainProgramFilename(filename, allow_none=allow_none)
|
|
1253
|
+
|
|
1254
|
+
yield filename, filename_main
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
def setupCacheHashSalt(test_code_path):
|
|
1258
|
+
assert os.path.exists(test_code_path)
|
|
1259
|
+
|
|
1260
|
+
if os.path.exists(os.path.join(test_code_path, ".git")):
|
|
1261
|
+
git_cmd = ["git", "ls-tree", "-r", "HEAD", test_code_path]
|
|
1262
|
+
|
|
1263
|
+
with getNullInput() as null_input:
|
|
1264
|
+
process = subprocess.Popen(
|
|
1265
|
+
args=git_cmd,
|
|
1266
|
+
stdin=null_input,
|
|
1267
|
+
stdout=subprocess.PIPE,
|
|
1268
|
+
stderr=subprocess.PIPE,
|
|
1269
|
+
)
|
|
1270
|
+
|
|
1271
|
+
stdout_git, stderr_git = process.communicate()
|
|
1272
|
+
assert process.returncode == 0, stderr_git
|
|
1273
|
+
|
|
1274
|
+
salt_value = md5(stdout_git)
|
|
1275
|
+
else:
|
|
1276
|
+
salt_value = md5()
|
|
1277
|
+
|
|
1278
|
+
for filename in getFileList(test_code_path):
|
|
1279
|
+
if filename.endswith(".py"):
|
|
1280
|
+
salt_value.update(getFileContents(filename, mode="rb"))
|
|
1281
|
+
|
|
1282
|
+
os.environ["NUITKA_HASH_SALT"] = salt_value.hexdigest()
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
def displayFolderContents(name, path):
|
|
1286
|
+
test_logger.info("Listing of %s '%s':" % (name, path))
|
|
1287
|
+
flushStandardOutputs()
|
|
1288
|
+
|
|
1289
|
+
if os.path.exists(path):
|
|
1290
|
+
if isWin32Windows():
|
|
1291
|
+
command = "dir /b /s /a:-D %s" % path
|
|
1292
|
+
else:
|
|
1293
|
+
command = "ls -Rla %s" % path
|
|
1294
|
+
|
|
1295
|
+
os.system(command)
|
|
1296
|
+
else:
|
|
1297
|
+
test_logger.info("Does not exist.")
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
def displayFileContents(name, path):
|
|
1301
|
+
test_logger.info("Contents of %s %r:" % (name, path))
|
|
1302
|
+
|
|
1303
|
+
if os.path.exists(path):
|
|
1304
|
+
for line in getFileContentByLine(path):
|
|
1305
|
+
my_print(line)
|
|
1306
|
+
else:
|
|
1307
|
+
test_logger.info("Does not exist.")
|
|
1308
|
+
|
|
1309
|
+
flushStandardOutputs()
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
def someGenerator():
|
|
1313
|
+
yield 1
|
|
1314
|
+
yield 2
|
|
1315
|
+
yield 3
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
def someGeneratorRaising():
|
|
1319
|
+
yield 1
|
|
1320
|
+
raise TypeError(2)
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
# checks requirements needed to run each test module, according to the specified special comment
|
|
1324
|
+
# special comments are in the following formats:
|
|
1325
|
+
# "# nuitka-skip-unless-expression: expression to be evaluated"
|
|
1326
|
+
# OR
|
|
1327
|
+
# "# nuitka-skip-unless-imports: module1,module2,..."
|
|
1328
|
+
def checkTestRequirements(filename):
|
|
1329
|
+
if os.path.isdir(filename):
|
|
1330
|
+
candidate = os.path.join(filename, "__main__.py")
|
|
1331
|
+
|
|
1332
|
+
if os.path.isfile(candidate):
|
|
1333
|
+
filename = candidate
|
|
1334
|
+
else:
|
|
1335
|
+
filename = os.path.join(filename, getMainProgramFilename(filename))
|
|
1336
|
+
|
|
1337
|
+
for line in readSourceCodeFromFilename(None, filename).splitlines():
|
|
1338
|
+
if line.startswith("# nuitka-skip-unless-"):
|
|
1339
|
+
if line[21:33] == "expression: ":
|
|
1340
|
+
expression = line[33:]
|
|
1341
|
+
|
|
1342
|
+
with getNullOutput() as null_output:
|
|
1343
|
+
result = subprocess.call(
|
|
1344
|
+
(
|
|
1345
|
+
os.environ["PYTHON"],
|
|
1346
|
+
"-c",
|
|
1347
|
+
"import sys, os; sys.exit(not bool(%s))" % expression,
|
|
1348
|
+
),
|
|
1349
|
+
stdout=null_output,
|
|
1350
|
+
stderr=subprocess.STDOUT,
|
|
1351
|
+
)
|
|
1352
|
+
if result != 0:
|
|
1353
|
+
return (False, "Expression '%s' evaluated to false" % expression)
|
|
1354
|
+
|
|
1355
|
+
elif line[21:30] == "imports: ":
|
|
1356
|
+
imports_needed = line[30:].rstrip().split(",")
|
|
1357
|
+
for i in imports_needed:
|
|
1358
|
+
if not hasModule(i):
|
|
1359
|
+
return (
|
|
1360
|
+
False,
|
|
1361
|
+
i
|
|
1362
|
+
+ " not installed for this Python version, but test needs it",
|
|
1363
|
+
)
|
|
1364
|
+
# default return value
|
|
1365
|
+
return (True, "")
|
|
1366
|
+
|
|
1367
|
+
|
|
1368
|
+
class DelayedExecutionThread(threading.Thread):
|
|
1369
|
+
def __init__(self, timeout, func):
|
|
1370
|
+
threading.Thread.__init__(self)
|
|
1371
|
+
self.timeout = timeout
|
|
1372
|
+
|
|
1373
|
+
self.func = func
|
|
1374
|
+
|
|
1375
|
+
def run(self):
|
|
1376
|
+
time.sleep(self.timeout)
|
|
1377
|
+
self.func()
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
def executeAfterTimePassed(message, timeout, func):
|
|
1381
|
+
test_logger.info(message % timeout)
|
|
1382
|
+
|
|
1383
|
+
alarm = DelayedExecutionThread(timeout=timeout, func=func)
|
|
1384
|
+
alarm.start()
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
def killProcessGroup(process_name, pid):
|
|
1388
|
+
"""Kill a process in a portable way.
|
|
1389
|
+
|
|
1390
|
+
Right now SIGINT is used, unclear what to do on Windows
|
|
1391
|
+
with Python2 or non-related processes.
|
|
1392
|
+
"""
|
|
1393
|
+
|
|
1394
|
+
if isWin32Windows():
|
|
1395
|
+
test_logger.sysexit("Error, cannot send kill signal on Windows")
|
|
1396
|
+
else:
|
|
1397
|
+
test_logger.info("Killing test process group '%s'." % process_name)
|
|
1398
|
+
os.killpg(pid, signal.SIGINT)
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
def checkLoadedFileAccesses(loaded_filenames, current_dir):
|
|
1402
|
+
# Many details to consider, pylint: disable=too-many-branches,too-many-statements
|
|
1403
|
+
|
|
1404
|
+
current_dir = os.path.normpath(current_dir)
|
|
1405
|
+
current_dir = os.path.normcase(current_dir)
|
|
1406
|
+
current_dir_ext = os.path.normcase(getExternalUsePath(current_dir))
|
|
1407
|
+
current_dir_real = os.path.realpath(current_dir)
|
|
1408
|
+
|
|
1409
|
+
illegal_accesses = []
|
|
1410
|
+
|
|
1411
|
+
for loaded_filename in loaded_filenames:
|
|
1412
|
+
orig_loaded_filename = loaded_filename
|
|
1413
|
+
|
|
1414
|
+
loaded_filename = os.path.normpath(loaded_filename)
|
|
1415
|
+
loaded_filename = os.path.normcase(loaded_filename)
|
|
1416
|
+
loaded_basename = os.path.basename(loaded_filename)
|
|
1417
|
+
|
|
1418
|
+
if isWin32Windows():
|
|
1419
|
+
if areSamePaths(
|
|
1420
|
+
os.path.dirname(loaded_filename),
|
|
1421
|
+
os.path.normpath(os.path.join(os.environ["SYSTEMROOT"], "System32")),
|
|
1422
|
+
):
|
|
1423
|
+
continue
|
|
1424
|
+
if areSamePaths(
|
|
1425
|
+
os.path.dirname(loaded_filename),
|
|
1426
|
+
os.path.normpath(os.path.join(os.environ["SYSTEMROOT"], "SysWOW64")),
|
|
1427
|
+
):
|
|
1428
|
+
continue
|
|
1429
|
+
|
|
1430
|
+
if r"windows\winsxs" in loaded_filename:
|
|
1431
|
+
continue
|
|
1432
|
+
|
|
1433
|
+
# GitHub actions have these in PATH overriding SYSTEMROOT
|
|
1434
|
+
if r"windows performance toolkit" in loaded_filename:
|
|
1435
|
+
continue
|
|
1436
|
+
if r"powershell" in loaded_filename:
|
|
1437
|
+
continue
|
|
1438
|
+
if r"azure dev spaces cli" in loaded_filename:
|
|
1439
|
+
continue
|
|
1440
|
+
if r"tortoisesvn" in loaded_filename:
|
|
1441
|
+
continue
|
|
1442
|
+
|
|
1443
|
+
if loaded_filename.startswith(current_dir):
|
|
1444
|
+
continue
|
|
1445
|
+
|
|
1446
|
+
if loaded_filename.startswith(os.path.abspath(current_dir)):
|
|
1447
|
+
continue
|
|
1448
|
+
|
|
1449
|
+
if loaded_filename.startswith(current_dir_ext):
|
|
1450
|
+
continue
|
|
1451
|
+
|
|
1452
|
+
if loaded_filename.startswith(current_dir_real):
|
|
1453
|
+
continue
|
|
1454
|
+
|
|
1455
|
+
# Parent directories are OK too
|
|
1456
|
+
if (
|
|
1457
|
+
loaded_filename in getParentDirectories(current_dir)
|
|
1458
|
+
or loaded_filename in getParentDirectories(current_dir_ext)
|
|
1459
|
+
or loaded_filename in getParentDirectories(current_dir_real)
|
|
1460
|
+
):
|
|
1461
|
+
continue
|
|
1462
|
+
|
|
1463
|
+
ignore = True
|
|
1464
|
+
for ignored_dir in (
|
|
1465
|
+
# System configuration is OK
|
|
1466
|
+
"/etc",
|
|
1467
|
+
"/usr/etc",
|
|
1468
|
+
"/usr/local/etc",
|
|
1469
|
+
# Runtime user state and kernel information is OK.
|
|
1470
|
+
"/proc",
|
|
1471
|
+
"/dev",
|
|
1472
|
+
"/run",
|
|
1473
|
+
"/sys",
|
|
1474
|
+
"/tmp",
|
|
1475
|
+
"/var",
|
|
1476
|
+
"/private/var",
|
|
1477
|
+
# Locals may of course be loaded.
|
|
1478
|
+
"/usr/lib/locale",
|
|
1479
|
+
"/usr/share/locale",
|
|
1480
|
+
"/usr/share/X11/locale",
|
|
1481
|
+
# Themes may of course be loaded.
|
|
1482
|
+
"/usr/share/themes",
|
|
1483
|
+
# Terminal info files are OK too.
|
|
1484
|
+
"/usr/share/terminfo",
|
|
1485
|
+
"/lib/terminfo",
|
|
1486
|
+
):
|
|
1487
|
+
if isFilenameSameAsOrBelowPath(ignored_dir, loaded_filename):
|
|
1488
|
+
ignore = False
|
|
1489
|
+
break
|
|
1490
|
+
if not ignore:
|
|
1491
|
+
continue
|
|
1492
|
+
|
|
1493
|
+
# Themes may of course be loaded.
|
|
1494
|
+
if loaded_filename.startswith("/usr/share/themes"):
|
|
1495
|
+
continue
|
|
1496
|
+
if "gtk" in loaded_filename and "/engines/" in loaded_filename:
|
|
1497
|
+
continue
|
|
1498
|
+
|
|
1499
|
+
if loaded_filename in (
|
|
1500
|
+
"/usr",
|
|
1501
|
+
"/usr/local",
|
|
1502
|
+
"/usr/local/lib",
|
|
1503
|
+
"/usr/share",
|
|
1504
|
+
"/usr/local/share",
|
|
1505
|
+
"/usr/lib64",
|
|
1506
|
+
):
|
|
1507
|
+
continue
|
|
1508
|
+
|
|
1509
|
+
# TCL/tk for tkinter for non-Windows is OK.
|
|
1510
|
+
if loaded_filename.startswith(
|
|
1511
|
+
(
|
|
1512
|
+
"/usr/lib/tcltk/",
|
|
1513
|
+
"/usr/share/tcltk/",
|
|
1514
|
+
"/usr/lib/tcl/",
|
|
1515
|
+
"/usr/lib64/tcl/",
|
|
1516
|
+
)
|
|
1517
|
+
):
|
|
1518
|
+
continue
|
|
1519
|
+
if loaded_filename in (
|
|
1520
|
+
"/usr/lib/tcltk",
|
|
1521
|
+
"/usr/share/tcltk",
|
|
1522
|
+
"/usr/lib/tcl",
|
|
1523
|
+
"/usr/lib64/tcl",
|
|
1524
|
+
):
|
|
1525
|
+
continue
|
|
1526
|
+
|
|
1527
|
+
if loaded_filename in (
|
|
1528
|
+
"/lib",
|
|
1529
|
+
"/lib64",
|
|
1530
|
+
"/lib/sse2",
|
|
1531
|
+
"/lib/tls",
|
|
1532
|
+
"/lib64/tls",
|
|
1533
|
+
"/usr/lib/sse2",
|
|
1534
|
+
"/usr/lib/tls",
|
|
1535
|
+
"/usr/lib64/tls",
|
|
1536
|
+
):
|
|
1537
|
+
continue
|
|
1538
|
+
|
|
1539
|
+
if loaded_filename in ("/usr/share/tcl8.6", "/usr/share/tcl8.5"):
|
|
1540
|
+
continue
|
|
1541
|
+
if loaded_filename in (
|
|
1542
|
+
"/usr/share/tcl8.6/init.tcl",
|
|
1543
|
+
"/usr/share/tcl8.5/init.tcl",
|
|
1544
|
+
):
|
|
1545
|
+
continue
|
|
1546
|
+
if loaded_filename in (
|
|
1547
|
+
"/usr/share/tcl8.6/encoding",
|
|
1548
|
+
"/usr/share/tcl8.5/encoding",
|
|
1549
|
+
):
|
|
1550
|
+
continue
|
|
1551
|
+
|
|
1552
|
+
# System SSL config on Linux. TODO: Should this not be included and
|
|
1553
|
+
# read from dist folder.
|
|
1554
|
+
if loaded_basename == "openssl.cnf":
|
|
1555
|
+
continue
|
|
1556
|
+
|
|
1557
|
+
# Taking these from system is harmless and desirable
|
|
1558
|
+
if loaded_basename.startswith(("libz.so", "libgcc_s.so")):
|
|
1559
|
+
continue
|
|
1560
|
+
|
|
1561
|
+
# System C libraries are to be expected.
|
|
1562
|
+
if loaded_basename.startswith(
|
|
1563
|
+
(
|
|
1564
|
+
"ld-linux-x86-64.so",
|
|
1565
|
+
"libc.so.",
|
|
1566
|
+
"libpthread.so.",
|
|
1567
|
+
"libm.so.",
|
|
1568
|
+
"libdl.so.",
|
|
1569
|
+
"libBrokenLocale.so.",
|
|
1570
|
+
"libSegFault.so",
|
|
1571
|
+
"libanl.so.",
|
|
1572
|
+
"libcidn.so.",
|
|
1573
|
+
"libcrypt.so.",
|
|
1574
|
+
"libmemusage.so",
|
|
1575
|
+
"libmvec.so.",
|
|
1576
|
+
"libnsl.so.",
|
|
1577
|
+
"libnss_compat.so.",
|
|
1578
|
+
"libnss_db.so.",
|
|
1579
|
+
"libnss_dns.so.",
|
|
1580
|
+
"libnss_files.so.",
|
|
1581
|
+
"libnss_hesiod.so.",
|
|
1582
|
+
"libnss_nis.so.",
|
|
1583
|
+
"libnss_nisplus.so.",
|
|
1584
|
+
"libpcprofile.so",
|
|
1585
|
+
"libresolv.so.",
|
|
1586
|
+
"librt.so.",
|
|
1587
|
+
"libthread_db-1.0.so",
|
|
1588
|
+
"libthread_db.so.",
|
|
1589
|
+
"libutil.so.",
|
|
1590
|
+
)
|
|
1591
|
+
):
|
|
1592
|
+
continue
|
|
1593
|
+
|
|
1594
|
+
# System C++ standard library is also OK.
|
|
1595
|
+
if loaded_basename.startswith("libstdc++."):
|
|
1596
|
+
continue
|
|
1597
|
+
|
|
1598
|
+
# Curses library is OK from system too.
|
|
1599
|
+
if loaded_basename.startswith("libtinfo.so."):
|
|
1600
|
+
continue
|
|
1601
|
+
|
|
1602
|
+
# Loaded by C library potentially for DNS lookups.
|
|
1603
|
+
if loaded_basename.startswith(
|
|
1604
|
+
(
|
|
1605
|
+
"libnss_",
|
|
1606
|
+
"libnsl",
|
|
1607
|
+
# Some systems load a lot more, this is CentOS 7 on OBS
|
|
1608
|
+
"libattr.so.",
|
|
1609
|
+
"libbz2.so.",
|
|
1610
|
+
"libcap.so.",
|
|
1611
|
+
"libdw.so.",
|
|
1612
|
+
"libelf.so.",
|
|
1613
|
+
"liblzma.so.",
|
|
1614
|
+
# Some systems load a lot more, this is Fedora 26 on OBS
|
|
1615
|
+
"libselinux.so.",
|
|
1616
|
+
"libpcre.so.",
|
|
1617
|
+
# And this is Fedora 29 on OBS
|
|
1618
|
+
"libblkid.so.",
|
|
1619
|
+
"libmount.so.",
|
|
1620
|
+
"libpcre2-8.so.",
|
|
1621
|
+
# CentOS 8 on OBS
|
|
1622
|
+
"libuuid.so.",
|
|
1623
|
+
)
|
|
1624
|
+
):
|
|
1625
|
+
continue
|
|
1626
|
+
|
|
1627
|
+
# Loaded by dtruss on macOS X.
|
|
1628
|
+
if loaded_filename.startswith("/usr/lib/dtrace/"):
|
|
1629
|
+
continue
|
|
1630
|
+
|
|
1631
|
+
# Loaded by cowbuilder and pbuilder on Debian
|
|
1632
|
+
if loaded_basename == ".ilist":
|
|
1633
|
+
continue
|
|
1634
|
+
if "cowdancer" in loaded_filename:
|
|
1635
|
+
continue
|
|
1636
|
+
if "eatmydata" in loaded_filename:
|
|
1637
|
+
continue
|
|
1638
|
+
|
|
1639
|
+
# Loading from home directories is OK too.
|
|
1640
|
+
if any(
|
|
1641
|
+
isFilenameSameAsOrBelowPath(path, loaded_filename)
|
|
1642
|
+
for path in (
|
|
1643
|
+
"/home",
|
|
1644
|
+
"/data",
|
|
1645
|
+
"/root",
|
|
1646
|
+
"/Users",
|
|
1647
|
+
"/Library/Preferences",
|
|
1648
|
+
"/agent", # Azure
|
|
1649
|
+
)
|
|
1650
|
+
):
|
|
1651
|
+
continue
|
|
1652
|
+
|
|
1653
|
+
# For Debian builders, /build is OK too.
|
|
1654
|
+
if loaded_filename.startswith("/build/") or loaded_filename == "/build":
|
|
1655
|
+
continue
|
|
1656
|
+
|
|
1657
|
+
# TODO: Unclear, loading gconv from filesystem of installed system
|
|
1658
|
+
# may be OK or not. I think it should be.
|
|
1659
|
+
if loaded_basename == "gconv-modules.cache":
|
|
1660
|
+
continue
|
|
1661
|
+
if "/gconv/" in loaded_filename:
|
|
1662
|
+
continue
|
|
1663
|
+
if loaded_basename.startswith("libicu"):
|
|
1664
|
+
continue
|
|
1665
|
+
if loaded_filename.startswith("/usr/share/icu/"):
|
|
1666
|
+
continue
|
|
1667
|
+
|
|
1668
|
+
# Loading from caches is OK.
|
|
1669
|
+
if loaded_filename.startswith("/var/cache/"):
|
|
1670
|
+
continue
|
|
1671
|
+
|
|
1672
|
+
# At least Python3.7 considers the default Python3 path and checks it.
|
|
1673
|
+
if loaded_filename == "/usr/bin/python3":
|
|
1674
|
+
continue
|
|
1675
|
+
|
|
1676
|
+
# Accessing the versioned Python3.x binary is also happening.
|
|
1677
|
+
if loaded_filename in (
|
|
1678
|
+
"/usr/bin/python." + version for version in getTestExecutionPythonVersions()
|
|
1679
|
+
):
|
|
1680
|
+
continue
|
|
1681
|
+
|
|
1682
|
+
binary_path = _python_executable
|
|
1683
|
+
|
|
1684
|
+
found = False
|
|
1685
|
+
while binary_path:
|
|
1686
|
+
if loaded_filename == binary_path:
|
|
1687
|
+
found = True
|
|
1688
|
+
break
|
|
1689
|
+
|
|
1690
|
+
if binary_path == os.path.dirname(binary_path):
|
|
1691
|
+
break
|
|
1692
|
+
|
|
1693
|
+
binary_path = os.path.dirname(binary_path)
|
|
1694
|
+
|
|
1695
|
+
if loaded_filename == os.path.join(
|
|
1696
|
+
binary_path,
|
|
1697
|
+
"python" + ("%d%d" % (_python_version[0], _python_version[1])),
|
|
1698
|
+
):
|
|
1699
|
+
found = True
|
|
1700
|
+
break
|
|
1701
|
+
|
|
1702
|
+
if found:
|
|
1703
|
+
continue
|
|
1704
|
+
|
|
1705
|
+
lib_prefix_dir = "/usr/lib/python%d.%s" % (
|
|
1706
|
+
_python_version[0],
|
|
1707
|
+
_python_version[1],
|
|
1708
|
+
)
|
|
1709
|
+
|
|
1710
|
+
# TODO: These must all go away, we should not compile from Debian packages at all,
|
|
1711
|
+
# it is warned against, and it really don't matter what wrong files that accesses
|
|
1712
|
+
# or not.
|
|
1713
|
+
|
|
1714
|
+
# PySide accesses its directory.
|
|
1715
|
+
if loaded_filename == os.path.join(lib_prefix_dir, "dist-packages/PySide"):
|
|
1716
|
+
continue
|
|
1717
|
+
|
|
1718
|
+
# GTK accesses package directories only.
|
|
1719
|
+
if loaded_filename == os.path.join(lib_prefix_dir, "dist-packages/gtk-2.0/gtk"):
|
|
1720
|
+
continue
|
|
1721
|
+
if loaded_filename == os.path.join(lib_prefix_dir, "dist-packages/glib"):
|
|
1722
|
+
continue
|
|
1723
|
+
if loaded_filename == os.path.join(lib_prefix_dir, "dist-packages/gtk-2.0/gio"):
|
|
1724
|
+
continue
|
|
1725
|
+
if loaded_filename == os.path.join(lib_prefix_dir, "dist-packages/gobject"):
|
|
1726
|
+
continue
|
|
1727
|
+
|
|
1728
|
+
# PyQt5 and PySide6 seems to do this, but won't use contents then.
|
|
1729
|
+
if loaded_filename in (
|
|
1730
|
+
"/usr/lib/qt6/plugins",
|
|
1731
|
+
"/usr/lib/qt6",
|
|
1732
|
+
"/usr/lib64/qt6/plugins",
|
|
1733
|
+
"/usr/lib64/qt6",
|
|
1734
|
+
"/usr/lib/qt5/plugins",
|
|
1735
|
+
"/usr/lib/qt5",
|
|
1736
|
+
"/usr/lib64/qt5/plugins",
|
|
1737
|
+
"/usr/lib64/qt5",
|
|
1738
|
+
"/usr/lib/x86_64-linux-gnu/qt5/plugins",
|
|
1739
|
+
"/usr/lib/x86_64-linux-gnu/qt5",
|
|
1740
|
+
"/usr/lib/x86_64-linux-gnu",
|
|
1741
|
+
"/usr/lib",
|
|
1742
|
+
):
|
|
1743
|
+
continue
|
|
1744
|
+
|
|
1745
|
+
# Can look at the interpreters of the system.
|
|
1746
|
+
if loaded_basename in "python3":
|
|
1747
|
+
continue
|
|
1748
|
+
if loaded_basename in (
|
|
1749
|
+
"python%s" + supported_version
|
|
1750
|
+
for supported_version in getTestExecutionPythonVersions()
|
|
1751
|
+
):
|
|
1752
|
+
continue
|
|
1753
|
+
|
|
1754
|
+
# Current Python executable can actually be a symlink and
|
|
1755
|
+
# the real executable which it points to will be on the
|
|
1756
|
+
# loaded_filenames list. This is all fine, let's ignore it.
|
|
1757
|
+
# Also, because the loaded_filename can be yet another symlink
|
|
1758
|
+
# (this is weird, but it's true), let's better resolve its real
|
|
1759
|
+
# path too.
|
|
1760
|
+
if os.path.realpath(loaded_filename) == os.path.realpath(sys.executable):
|
|
1761
|
+
continue
|
|
1762
|
+
|
|
1763
|
+
# Accessing SE-Linux is OK.
|
|
1764
|
+
if loaded_filename in ("/sys/fs/selinux", "/selinux"):
|
|
1765
|
+
continue
|
|
1766
|
+
|
|
1767
|
+
# Looking at device is OK.
|
|
1768
|
+
if loaded_filename.startswith("/sys/devices/"):
|
|
1769
|
+
continue
|
|
1770
|
+
|
|
1771
|
+
# Allow reading time zone info of local system.
|
|
1772
|
+
if loaded_filename.startswith("/usr/share/zoneinfo/"):
|
|
1773
|
+
continue
|
|
1774
|
+
|
|
1775
|
+
# The access to .pth files has no effect.
|
|
1776
|
+
if loaded_filename.endswith(".pth"):
|
|
1777
|
+
continue
|
|
1778
|
+
|
|
1779
|
+
# Looking at site-package dir alone is alone.
|
|
1780
|
+
if loaded_filename.endswith(
|
|
1781
|
+
("site-packages", "dist-packages", "vendor-packages")
|
|
1782
|
+
):
|
|
1783
|
+
continue
|
|
1784
|
+
|
|
1785
|
+
# QtNetwork insist on doing this it seems.
|
|
1786
|
+
if loaded_basename.startswith(("libcrypto.so", "libssl.so")):
|
|
1787
|
+
continue
|
|
1788
|
+
|
|
1789
|
+
# macOS uses these:
|
|
1790
|
+
if loaded_basename in (
|
|
1791
|
+
"libc.dylib",
|
|
1792
|
+
"libcrypto.1.0.0.dylib",
|
|
1793
|
+
"libssl.1.0.0.dylib",
|
|
1794
|
+
"libcrypto.1.1.dylib",
|
|
1795
|
+
"libffi.dylib",
|
|
1796
|
+
"libfribidi.dylib",
|
|
1797
|
+
):
|
|
1798
|
+
continue
|
|
1799
|
+
|
|
1800
|
+
# Linux onefile uses this
|
|
1801
|
+
if loaded_basename.startswith("libfuse.so."):
|
|
1802
|
+
continue
|
|
1803
|
+
|
|
1804
|
+
# MSVC run time DLLs, due to SxS come from system.
|
|
1805
|
+
if loaded_basename.upper() in ("MSVCRT.DLL", "MSVCR90.DLL"):
|
|
1806
|
+
continue
|
|
1807
|
+
|
|
1808
|
+
if isMacOS():
|
|
1809
|
+
ignore = True
|
|
1810
|
+
for ignored_dir in (
|
|
1811
|
+
"/System/Library",
|
|
1812
|
+
"/AppleInternal",
|
|
1813
|
+
"/System/Volumes/Preboot",
|
|
1814
|
+
"/usr/lib/system/",
|
|
1815
|
+
"/usr/libexec/swift",
|
|
1816
|
+
):
|
|
1817
|
+
if isFilenameSameAsOrBelowPath(ignored_dir, loaded_filename):
|
|
1818
|
+
ignore = False
|
|
1819
|
+
break
|
|
1820
|
+
if not ignore:
|
|
1821
|
+
continue
|
|
1822
|
+
|
|
1823
|
+
if loaded_filename == "/System/Library":
|
|
1824
|
+
continue
|
|
1825
|
+
|
|
1826
|
+
if loaded_filename == "/usr/libexec/rosetta/runtime":
|
|
1827
|
+
continue
|
|
1828
|
+
|
|
1829
|
+
if loaded_filename in (
|
|
1830
|
+
"/usr/lib/libSystem.B.dylib",
|
|
1831
|
+
"/usr/lib/libc++.1.dylib",
|
|
1832
|
+
"/usr/lib/libc++abi.dylib",
|
|
1833
|
+
"/usr/lib/libfakelink.dylib",
|
|
1834
|
+
"/usr/lib/liboah.dylib",
|
|
1835
|
+
"/usr/lib/libobjc.A.dylib",
|
|
1836
|
+
):
|
|
1837
|
+
continue
|
|
1838
|
+
|
|
1839
|
+
illegal_accesses.append(orig_loaded_filename)
|
|
1840
|
+
|
|
1841
|
+
return illegal_accesses
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
def getMainProgramFilename(filename, allow_none=False):
|
|
1845
|
+
for filename_main in os.listdir(filename):
|
|
1846
|
+
if filename_main.endswith(("Main.py", "Main")):
|
|
1847
|
+
return filename_main
|
|
1848
|
+
|
|
1849
|
+
if filename_main in (
|
|
1850
|
+
"setup.py",
|
|
1851
|
+
"setup.cfg",
|
|
1852
|
+
"pyproject.cpython.toml",
|
|
1853
|
+
"pyproject.nuitka.toml",
|
|
1854
|
+
):
|
|
1855
|
+
return filename_main
|
|
1856
|
+
|
|
1857
|
+
if allow_none:
|
|
1858
|
+
return None
|
|
1859
|
+
|
|
1860
|
+
test_logger.sysexit(
|
|
1861
|
+
"""\
|
|
1862
|
+
Error, no file ends with 'Main.py' or 'Main' in '%s', incomplete test case."""
|
|
1863
|
+
% (filename)
|
|
1864
|
+
)
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
def getInstalledPythonVersion(python_version, must_exist):
|
|
1868
|
+
result = findInstalledPython(
|
|
1869
|
+
python_versions=(python_version,), module_name=None, module_version=None
|
|
1870
|
+
)
|
|
1871
|
+
|
|
1872
|
+
if result is None and must_exist:
|
|
1873
|
+
test_logger.sysexit(
|
|
1874
|
+
"Error, cannot find required Python version %s installation."
|
|
1875
|
+
% python_version
|
|
1876
|
+
)
|
|
1877
|
+
|
|
1878
|
+
return result
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
_sys_path_path = None
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
def getPythonSysPath():
|
|
1885
|
+
global _sys_path_path # singleton, pylint: disable=global-statement
|
|
1886
|
+
|
|
1887
|
+
if _sys_path_path is None:
|
|
1888
|
+
_sys_path_path = check_output(
|
|
1889
|
+
[
|
|
1890
|
+
os.environ["PYTHON"],
|
|
1891
|
+
"-c",
|
|
1892
|
+
"import sys, os; print(os.pathsep.join(sys.path))",
|
|
1893
|
+
]
|
|
1894
|
+
)
|
|
1895
|
+
|
|
1896
|
+
if str is not bytes:
|
|
1897
|
+
_sys_path_path = _sys_path_path.decode("utf8")
|
|
1898
|
+
|
|
1899
|
+
_sys_path_path = _sys_path_path.strip()
|
|
1900
|
+
|
|
1901
|
+
return _sys_path_path
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
_web_server_process = None
|
|
1905
|
+
_web_server_port = 27272
|
|
1906
|
+
_web_server_hostname = "localhost"
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
def getLocalWebServerUrl():
|
|
1910
|
+
return "http://%s:%d" % (_web_server_hostname, _web_server_port)
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
def getLocalWebServerDir(base_dir):
|
|
1914
|
+
global _web_server_process # singleton, pylint: disable=global-statement
|
|
1915
|
+
|
|
1916
|
+
web_dir = os.path.join(getTempDir(), "local-web-server", base_dir)
|
|
1917
|
+
|
|
1918
|
+
if _web_server_process is None:
|
|
1919
|
+
web_server_directory_supporting_pythons = tuple(
|
|
1920
|
+
python_version
|
|
1921
|
+
for python_version in getTestExecutionPythonVersions()
|
|
1922
|
+
if python_version not in ("3.6", "3.5", "3.4", "2.7", "2.6")
|
|
1923
|
+
)
|
|
1924
|
+
|
|
1925
|
+
web_server_python = findInstalledPython(
|
|
1926
|
+
python_versions=web_server_directory_supporting_pythons,
|
|
1927
|
+
module_name=None,
|
|
1928
|
+
module_version=None,
|
|
1929
|
+
)
|
|
1930
|
+
|
|
1931
|
+
if web_server_python is None:
|
|
1932
|
+
return None
|
|
1933
|
+
|
|
1934
|
+
os.makedirs(web_dir)
|
|
1935
|
+
|
|
1936
|
+
command = [
|
|
1937
|
+
web_server_python.getPythonExe(),
|
|
1938
|
+
"-m",
|
|
1939
|
+
"http.server",
|
|
1940
|
+
"--bind",
|
|
1941
|
+
_web_server_hostname,
|
|
1942
|
+
"--dir",
|
|
1943
|
+
web_dir,
|
|
1944
|
+
str(_web_server_port),
|
|
1945
|
+
]
|
|
1946
|
+
|
|
1947
|
+
test_logger.my_print(" ".join(command))
|
|
1948
|
+
|
|
1949
|
+
_web_server_process = createProcess(
|
|
1950
|
+
command,
|
|
1951
|
+
stdout=sys.stderr,
|
|
1952
|
+
stderr=sys.stderr,
|
|
1953
|
+
)
|
|
1954
|
+
|
|
1955
|
+
def killWebServerProcess():
|
|
1956
|
+
_web_server_process.kill()
|
|
1957
|
+
|
|
1958
|
+
atexit.register(killWebServerProcess)
|
|
1959
|
+
|
|
1960
|
+
return web_dir
|
|
1961
|
+
|
|
1962
|
+
|
|
1963
|
+
def traceExecutedCommand(description, command):
|
|
1964
|
+
my_print(description, ":", *command, style="pink")
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
def extractNuitkaVersionFromFilePath(version_filename):
|
|
1968
|
+
with openTextFile(version_filename, "r") as f:
|
|
1969
|
+
option_lines = f.readlines()
|
|
1970
|
+
|
|
1971
|
+
(version_line,) = [line for line in option_lines if line.startswith("Nuitka V")]
|
|
1972
|
+
|
|
1973
|
+
return version_line[8:].rstrip()
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
def decryptOutput(project_options, output):
|
|
1977
|
+
nuitka_decrypt_call = [
|
|
1978
|
+
os.environ.get("PYTHON", sys.executable),
|
|
1979
|
+
"-m",
|
|
1980
|
+
"nuitka.tools.commercial.decrypt", # Note: Needed for Python2.6
|
|
1981
|
+
]
|
|
1982
|
+
|
|
1983
|
+
for project_option in project_options:
|
|
1984
|
+
if project_option.startswith("--encryption-key="):
|
|
1985
|
+
nuitka_decrypt_call.append("--key=" + project_option.split("=", 1)[1])
|
|
1986
|
+
|
|
1987
|
+
stdout, stderr, exit_code = executeProcess(nuitka_decrypt_call, stdin=output)
|
|
1988
|
+
|
|
1989
|
+
assert exit_code == 0, stderr
|
|
1990
|
+
|
|
1991
|
+
return stdout
|
|
1992
|
+
|
|
1993
|
+
|
|
1994
|
+
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
1995
|
+
# integrates with CPython, but also works on its own.
|
|
1996
|
+
#
|
|
1997
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
1998
|
+
# you may not use this file except in compliance with the License.
|
|
1999
|
+
# You may obtain a copy of the License at
|
|
2000
|
+
#
|
|
2001
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
2002
|
+
#
|
|
2003
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
2004
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
2005
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2006
|
+
# See the License for the specific language governing permissions and
|
|
2007
|
+
# limitations under the License.
|