python: Port python 3.x module to Windows and improve distutils a bit
Hi,
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, sincelibxml2modmay be underlibxmlmods. - Make DLL packaging in
setup.pymore flexible: We now use the options that we specified viaconfigure.jsor CMake to determine which DLLs we want to pack into the installation orbdist*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. - Import
setuptoolsif found, so that it makes things easier to build wheels.
With blessings, thank you!