eabase / mt4pycon

The MT4 Python Connector
MIT License
23 stars 8 forks source link

Include most recent mtapi DLL's in pip installer #5

Open eabase opened 3 years ago

eabase commented 3 years ago

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?

All about using DLL's in python: