Calling routines in Windows DLLs from Python scripts running under Linux, MacOS or BSD
c_char
and c_wchar
objects as well as c_char
and c_wchar
arrays, i.e. strings.pyproject.toml
.ctypes.byref
. Those were previously supported but remained untested.CAUTION: A number changes at least partially BREAK BACKWARDS COMPATIBILITY for certain use and edge cases.
The datatype parser and definition code was rewritten completely. It should work as before in almost all instances although unexpected breakages may occur.
If entire struct objects are synced via memsync
directives, the struct types now have to be specified directly instead of their names as strings as before, breaking backwards compatibility for those use cases.
zugbruecke now follows the Python's logging
module's log levels. Maximum logging output can now be achieved via logging.DEBUG
or 10
as opposed to 100
in earlier versions. Log level 0
remains as "no logs" as per logging.NOTSET
. This change may break debugging and development workflows.
This RELEASE FIXES A CRITICAL BUG where zugbruecke was falsely translating 64 bit integer types from the Unix side to 32 bit integer types on the Wine side.
memsync
directives, ctypes
types do not need to be specified by their name as strings anymore - plain ctypes
fundamental types and structure types can be used instead. Strings remain valid specifications for compatibility though.memsync
directives allow for more descriptive parameter names while the old single-character names remain valid for compatibility.logging
module's log levels, i.e. NOTSET
, DEBUG
, INFO
, WARNING
, ERROR
and CRITICAL
. This change serves to work towards #84.c_int64
, c_uint64
, c_long
and c_ulong
from the Unix side to their 32-bit equivalents, c_int32
and c_uint32
, on the Wine side. This was due to c_long
and c_ulong
being 8 bytes long on Unix-like systems while they are 4 bytes long on Window.c_char
and c_wchar
buffers passed by value within structures were not handled correctly, see #93.argtypes
and restype
parser does not suffer from #61 anymore where earlier different structure types from different name spaces but with identical names would cause problems.copy_modules
configuration parameter can be used to indicate that a copy instead of symlinks is required. This problem is caused by Wine bug #54228 in Wine Staging >= 7.18.zugbruecke
(and wenv
) were installed into user site-packages, the installation would break, see #88.log_write
) was set to True
during run-time, zugbruecke
would crash, see #77.memsync
was broken, see #92.restype
was explicitly assumed to be c_int
. Now, if a user does not specify it, assumptions about it are left to ctypes
on the Wine side, potentially getting closer to ctypes
original behaviour.restype
would not throw an exception when by accident set to a list or tuple like original ctypes
does.ctypes
fundamental types specified by name as strings in memsync
directives.memsync
, where it is needed and where it is not, among other improvements.examples
folder from project as its code was more than outdated and can now be found in the documentation, the test suite and/or the newly added benchmarks.array.array
objects (standard library) as well as numpy.ndarray
objects.restype
configuration errors.CAUTION: The module layout changed, effectively BREAKING BACKWARDS COMPATIBILITY for all use-cases!
OLD | NEW | |
---|---|---|
default session | import zugbruecke as ctypes |
import zugbruecke.ctypes as ctypes |
default session member | from zugbruecke import c_double |
from zugbruecke.ctypes import c_double |
ctypes session class | zugbruecke.session |
zugbruecke.CtypesSession |
Wine Python | wine-python |
wenv python |
Wine Pip | wine-pip |
wenv pip |
Wine Pytest | wine-pytest |
wenv pytest |
Wine Python shebang | #!/usr/bin/env wine-python |
#!/usr/bin/env _wenv_python |
configuration | {"version": "3.5.3"} |
{"pythonversion": "3.7.4"} |
Significant changes were mandatory for allowing to cleanup a lot of old code and to remove long-standing bugs. The main issue was that importing zugbruecke
would implicitly start a new session. This could not be prohibited. With the new package layout, it becomes possible to import sub-modules of zugbruecke
without implicitly starting a session. One of the more significant added benefits therefore is that this also allows much more fine-grained tests.
zugbruecke
will use semantic versioning from now on. Breaking changes will be indicated by increasing the second version number, the minor version. Going for example from 0.0.x to 0.1.y or going from 0.1.x to 0.2.y therefore indicates a breaking change. For as long as zugbruecke
has development status "alpha", please expect more breaking changes to come.
wine-python
, wine-pip
and wine-pytest
have been consolidated into a new Python package called wenv. One can now call wenv python
, wenv pip
and wenv pytest
. This change was necessary for allowing a more generic interface to entry points of arbitrary third party packages. Run wenv help
for more information. Changes related to wenv
are now being tracked in wenv's change log. wenv
has considerably more features and configuration options compared to the previously provided shell scripts.zugbruecke.current_session
is no longer available. zugbruecke.ctypes
on its own is now the default session. Besides, the class zugbruecke.session
was renamed into zugbruecke.CtypesSession
and has now a fully compatible ctypes
drop-in replacement API as well. Both, zugbruecke.ctypes
and custom sessions constructed from zugbruecke.CtypesSession
now have methods and properties prefixed with zb_
for manipulating their configuration, termination and Wine-related tasks.set_parameter
method, now renamed into zb_set_parameter
, only accepts a single key-value pair instead of a dictionary.version
configuration parameter for controlling the version of Wine Python has been renamed to pythonversion
.zugbruecke
. Meaningful exception are now raised throughout the package.zugbruecke.CtypesSession
objects can be managed by context manager statements (with
).zugbruecke
did not capture and forward data coming from Windows DLLs and binaries through stdout
and stderr
(running with Wine) most of the time.TimeoutError
is raised (instead of a SyntaxError
) if zugbruecke
's server component does not start.zugbruecke
did not actually check properly if its server component had terminated when a session was terminated. The reliability of relevant termination code has been significantly improved.zugbruecke.ctypes.util
(previously zugbruecke.util
) are faster and a lot less error-prone, see #52.zugbruecke.ctypes.CDLL
does no longer fall back to Unix libraries if no corresponding DLL file could be found. For attaching to Unix libraries please use the original ctypes
module instead, see #53.zugbruecke
raised TypeError
if too many arguments were given to a configured cdll
function (ctypes
does not), see #62.memsync
first (before use in a function call without memsync
), configuring (and calling) the function failed, see #63.makefile
structure.win32
) and 64bit (win64
) DLLs, see #58. Previously, only 32bit (win32
) DLLs received regular testing.cdll
/cdecl
and windll
/stdcall
calling conventions (previously only windll
/stdcall
received regular testing), see #60.zugbruecke
is tested across all supported versions of CPython, both on Unix and on Wine side.ZUGBRUECKE_DEBUG
to 1
.python-language-server
to python-lsp-server
.zugbruecke
can now be analyzed with coverage
.setuptools
for packaging to pyproject.toml
via flit
.docs
folder structure.Fifteenth release. See changes for details.
Fourteenth release. See changes for details.
Thirteenth release. See changes for details.
Twelfth release. See changes for details.
Eleventh release. See changes for details.
Tenth release. See changes for details.
Ninth release. See changes for details.