Force Python setup.py bdist_wheel package for including binary files in subdirectories

I have a Python package that includes the subdirectories bin_win32 , bin_win64 , bin_osx , bin_lnx32 and bin_lnx64 with binaries for the respective platforms, which I call through the steamcloud.py Python steamcloud.py . When I run python setup.py bdist_wheel --universal , the created wheel does not include files in these subdirectories, but only the Python file. How can I get them in the wheel?

Note. I know 1) that the --universal flag is for Python-only packages and 2) that I have to create separate wheels for each platform. However, I do not have access to Windows or Linux computers for development, and there is no naming convention for Linux-specific drives.

The contents of setup.py can be found here .

+6
source share
1 answer

So, the first problem is that your project does not match the expected layout, so you need to call setup() with the package_dir argument in addition to the packages and package_data (see setting the package data ).

 package_dir={'airship': '<path_to_package>/airship'} 

However, the files you are trying to include are not actually package data, so you probably do not want to add them to package_data , as you are now. package_data interprets paths relative to your packages, not relative to the project root. Use data_files , so you can provide paths relative to your setup.py file.

0
source

Source: https://habr.com/ru/post/987459/


All Articles