This release bumps the much awaited 3.11 support to full level. This means Nuitka is now expected to behave identical to CPython3.11 for the largest part.
There is plenty of new features in Nuitka, e.g. a new testing approach with reproducible compilation reports, support for including the metadata if an distribution, and more.
In terms of bug fixes, it’s also huge, and esp. macOS got a lot of improvements that solve issues with prominent packages in our dependency detection. And then for PySide we found a corruption issue, that got workarounds.
The new dict in
optimization was compile time crashing on code where the dictionary shaped value checked for a key was actually an conditional expression
crash_before.py
Fixed in 1.5.1 already.
Standalone: Added support for openvino
. This also required to make sure to keep used DLLs and their dependencies in the same folder. Before they were put on the top level. Fixed in 1.5.1 already.
Android: Convert RPATH
to RUNPATH
such that standalone binaries need no LD_LIBRARY_PATH
guidance anymore. Fixed in 1.5.1 already.
Standalone: Added support for newer skimage
. Fixed in 1.5.1 already.
Standalone: Fix, new data file type .json
needed to be added to the list of extensions used for the Qt plugin bindings. Fixed in 1.5.2 already.
Standalone: Fix, the nuitka_types_patch
module using during startup was released, which can have bad effects. Fixed in 1.5.2 already.
Android: More reliable detection of the Android based Python Flavor. Fixed in 1.5.2 already.
Standalone: Added data files for pytorch_lightning
and lightning_fabric
packages. Added in 1.5.2 already.
Windows: Fix, the preservation of PATH
didn’t work on systems where this could lead to encoding issues due to reading a MBCS value and writing it as a unicode string. We now read and write the environment value as unicode
both. Fixed in 1.5.3 already.
Plugins: Fix, the scons report values were not available in case of removed --remove-output
deleting it before use. It is now read in case if will be used. Fixed in 1.5.3 already.
Python3.11: Added support for ExceptionGroup
built-in type. Fixed in 1.5.4 already.
Anaconda: Fix, using numpy
in a virtualenv and not from conda package was crashing. Fixed in 1.5.4 already.
Standalone: Added support for setuptools
. Due to the anti-bloat work, we didn’t notice that if that was not sufficiently usable, the compiled result was not usable. Fixed in 1.5.4 already.
Distutils: Added support for pyproject with src
folders. This supports now tool.setuptools.packages.find
with a where
value with pyproject files, where it typically is used like this:
pyproject.toml
Windows: Fix, the nuitka-run
batch file was not working. Fixed in 1.5.4 already.
Standalone: Add pymoo
implicit dependencies. Fixed in 1.5.5 already.
macOS: Avoid deprecated API, this should fix newer Xcode being used. Fixed in 1.5.5 already.
Fix, the multiprocessing
in spawn mode didn’t handle relative paths that become invalid after process start. Fixed in 1.5.5 already.
Fix, spec %CACHE_DIR%
was not given the correct folder on non-Windows. Fixed in 1.5.5 already.
Fix, special float values like nan
and inf
didn’t properly generate code for C values. Fixed in 1.5.5 already.
Standalone: Add missing DLL for onnxruntime
on Linux too. Fixed in 1.5.5 already.
UI: Fix, illegal python flags value could enable site
mode. by mistake and were not caught. Fixed in 1.5.6 already.
Windows: Fix, user names with spaces failed with MinGW64 during linking. Fixed in 1.5.6 already.
Linux: Fix, was not excluding all libraries from glibc, which could cause crashes on newer systems. Fixed in 1.5.6 already.
Windows: Fix, could still pickup SxS libraries distributed by other software when found in PATH. Fixed in 1.5.6 already.
Windows: Fix, do not use cache DLL dependencies if one the files listed there went missing. Fixed in 1.5.6 already.
Onefile: Reject path spec that points to a system folder. We do not want to delete those when cleaning up clearly. Added in 1.5.6 already.
Plugins: Fix, the dill-compat
was broken by code object changes. Fixed in 1.5.6 already.
Standalone: Added workaround for networkx
decorator issues. Fixed in 1.5.7 already.
Standalone: Added workaround for PySide6 problem with disconnecting signals from methods. Fixed in 1.5.7 already.
Standalone: Added workaround for PySide2 problem with disconnecting signals.
Fix, need to make sure the yaml package is located absolutely or else case insensitive file systems can confuse things. Fixed in 1.5.7 already.
Standalone: Fix, extra scan paths were not considered in caching of module imports, breaking the feature in many cases. Fixed in 1.5.7 already.
Windows: Fix, avoid system installed appdirs
package as it is frequently broken. Fixed in 1.5.7 already.
Standalone: The bytecode cache check needs to handle re-checking relative imports found in the cache better. Otherwise some standard library modules were always recompiled due to apparent import changes. Fixed in 1.5.7 already.
Nuitka-Python: Fix, do not insist on PYTHONHOME
making it to os.environ
in order to delete it again. Fixed in 1.5.7 already.
Nuitka-Python: Allow builtin modules of all names. This is of course what it does. Fixed in 1.5.7 already.
Nuitka-Python: Ignore empty extension module suffix. Was confusing Nuitka to consider every file an extension module potentially. Fixed in 1.5.7 already.
Plugins: Properly merge code coming from distinct plugins. The __future__
imports need to be moved to the start. Added in 1.5.7 already.
Standalone: Added support for opentele
package. Fixed in 1.5.7 already.
Standalone: Added support for newer pandas
and pyarrow
usage. Fixed in 1.5.7 already.
Standalone: Added missing implicit dependency for PySide6. Fixed in 1.5.7 already.
Fix, the pyi-file parser didn’t handle doc strings, and could be crash for comment contents not conforming to be import statement code. Fixed in 1.5.8 already.
Standalone: Added support for pyqtlet2
data files.
Python2: Fix, PermissionError
doesn’t exist on that version, which could lead to issues with retries for locked files e.g. but was also observed with symlinks.
Plugins: Recognize the error given by with upx
if a file is already compressed.
Fix, so called “fixed” imports were not properly tracking their use, such that they then didn’t show up in reports, and didn’t cause dependencies on the module, which could e.g. impact importlib
to not be included even if still being used.
Windows: Fix, retries for payload attachment were crashing when maximum number of retries were reached. Using the common code for retries solves that, since that code handles it just fine.
Standalone: Added support for the av
module.
Distutils: Fix, should build from files in build
folder rather than source
files. This allows tools like versioneer
that integrate with setuptools to do their thing, and get the result of that to compilation rather than the original source files.
Standalone: Added support for the Equation
module.
Windows/macOS: Avoid problems with case insensitive file systems. The nuitka.Constants
module and nuitka.constants
package could collide, so we now avoid that package, there was only what is now nuitka.Serialization
in there anyway. Also similar problem with nuitka.utils.Json
and json
standard library module.
Standalone: Added support transformers
package.
Standalone: Fix for PyQt5
which needs a directory to exist.
macOS: Fix, was crashing with PyQt6 in standalone mode when trying to register plugins to non-default path. We now try to skip the need, which also makes it work.
Fix, recursion error for complex code that doesn’t happen in ast
module, but during conversion of the node tree it gives to our own tree, were not handled, and crashed with RecursionError
. This is now also handled, just like the error from ast
.
Standalone: Added support for sqlfluff
.
Standalone: Added support for PySide 6.5 on macOS solving DLL dependency issues.
Scons: Recognize more ccache
outputs properly, their logging changed and provided irrelevant states, and ones not associated so far.
Onefile: Fix, could do random exit codes when failing to fork for whatever reason.
Standalone: Added support for pysnmp
package.
Standalone: Added support for torchaudio
and tensorflow
on macOS. These contain broken DLL dependencies as relative paths, that are apparently ignored by macOS, so we do that too now.
Onefile: Use actual rather than guessed standalone binary name for multiprocessing
spawns. Without this, a renamed onefile binary, didn’t work.
Fix, side effect nodes, that are typically created when an expression raises, were use in optimization contexts, where they do not work.
Standalone: Added missing implicit dependency for sentence_transformers
package.
macOS: Fix, added missing dependency for platform
module.
--report-diffable
to make the XML report created with --report
become usable for comparison across different machine installations, users compiling, etc. so it can be used to compare versions of Nuitka and versions of packages being compiled for changes. Also avoid short names in reports, and resolve them back to long names, so they become more portable too.--report-user-provided=pipenv-lock-hash=64a5e4
with this data ending up inside of reports, where tools like the new testing tool nuitka-watch
can use it to decide if upstream packages changed or not. These are free form, just needs to fit XML rules.include-pyi-file
flag to data-files section. If provided, the .pyi
file belonging to a specific module is included. Some packages, e.g. skimage
depend at runtime on them. For data file options and configuration, these files are excluded, but this is now the way to force their inclusion. Added in 1.5.1 already.--include-distribution-metadata
.
This allows generic walks over distributions and their entry points to succeed, as well as version checks with the metadata packages that are not compile time optimized.--list-package-dlls
option. So far, this was a manual task to figure out actual DLLs. This will of course improve the Yaml package configuration tooling .--include-package-data=package_name:*.py
is doing what you say, even if of course, that might not be working.--edit-module-code
option.
To avoid manually locating code to open it in Visual Code replaced old find-module
helper to be a main Nuitka option, where it is more accessible. This also goes beyond it it, such that it resolves standalone file paths to module names to make debugging easier, and that it opens the file right away.IPython
usage in huggingface_hub
package versions. Added in 1.5.2 already.IPython
usage in tokenizers
module. Added in 1.5.4 already.type(x)
optimization. This is only the start.IPython
in trio
package. Added in 1.5.6 already.pytest
and IPython
for some packages used by newer torch
. Added in 1.5.7 already.triton
to use setuptools. Added in 1.5.7 already.pytest
in newer networkx
package. Added in 1.5.7 already.pytest
namespaces py
and _pytest
sooner, to point to the actual uses more directly.doctest
equals usage of “unittest” so cover it too, to point to the actual uses more directly.plugin-list
, they do not have any effect, but listing them, makes people use them still. Fixed in 1.5.4 already.y
as a shortcut for yes
in prompts. Added in 1.5.5 already.requires.txt
in source distribution. This apparently breaks poetry. Changed in 1.5.7 already.--onefile
for issues that show up with --standalone
already, to report factory branch issues rather on Discord, and give a quick tip for a likely reproducer if a package fails to import.--debug
exceptions become warning messages with the original exception being raised instead, making debugging during development much easier.ccache
actually means. Not everybody is familiar with the design of Nuitka there or what the tool can actually do.PyConfig
values during interpreter initialization. There is otherwise always the risk of crashes, should these values change during runtime. Fixed in 1.5.2 already.nuitka-watch
tool, which is still experimental and for use with the Nuitka-Watch repository.The class bodies optimization has made some progress in this release, going to a re-formulation of the metaclass selection, so as to allow its future optimization. We are not yet at “compiled objects”, but this is a promising road. We need to make some optimization improvements for inlining constant value calls, then this can become really important, but by itself these changes do not yield a lot of improvement.
For macOS again a bunch of time was spent to improve and complete the detection of DLL dependencies. More corner cases are covered now and more packages just work fine as a result.
The most important is to become Python3.11 compatible, even if attribute lookups, and other things, and not yet optimized. We will get to that in future releases. For now, compatibility is the first step to take.
For GitHub users, the Nuitka-Action will be interesting. But it’s still in develop. We keep adding missing options of Nuitka for a while it seems, but for most people it should be usable already.
The new nuitka-watch
ability, should allow us to detect breaking PyPI releases, that need a new tweak in Nuitka sooner. But it will probably grow in the coming releases to full value only. For now the tool itself is not yet finished.
From here, a few open ends in the CPython 3.11 test suite will have to be addressed, and maybe some of the performance tricks that it now will enable, e.g. with repeated attribute lookups.