mt4pycon
mt4pycon copied to clipboard
Include most recent mtapi DLL's in pip installer
We'd like to make the usage of this very easy, so a good start is to include all the latest DLLs from the mtapi repo releases.
In order to make this happen, we need to bake in the correct DLL paths into the setup.py file among the ./libs/*.dll files.
Check where things are going:
python.exe -c "import distutils.sysconfig as a; print(a.get_python_lib());"
The trick is to add something like this:
setup(
# [...]
# use: --executable (or -e) to overrride "#!" substitution
scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val']
# Package Data
packages=['mypkg'],
package_dir={'mypkg': 'src/mypkg'},
package_data={'mypkg': ['data/*.dat']},
# Additional Files
#data_files = [(distutils.sysconfig.get_python_lib(), ["/path/to/the/DLL"])],
data_files = [('', ["/path/to/the/DLL"])],
)
Where else?
- https://stackoverflow.com/a/64989917/
All about using DLL's in python:
- https://www.codementor.io/@spyoungtech/how-to-use-dlls-com-objects-from-python-or-how-to-send-a-fax-with-python-192lmtt5p5