python: Port python 3.x module to Windows and improve distutils a bit
This MR attempts to improve Windows support for the libxml2 Python module, by:
- Supporting Python 3.x for Windows, since previously only *NIX was supported as system-level APIs are needed for Python 3.x.
- Fix the
tstmem.pytest script, since
libxml2modmay be under
- Make DLL packaging in
setup.pymore flexible: We now use the options that we specified via
configure.jsor CMake to determine which DLLs we want to pack into the installation or
bdist*items, so that we try to avoid excessively packing in DLLs or miss out on required DLLs. Also enable one to change required DLL filenames easier, as different DLLs may be linked in. This is more important for Python 3.8+ where Python requires one to be quite clear on where dependent DLLs are loaded.
setuptoolsif found, so that it makes things easier to build wheels.
With blessings, thank you!