How to include an executable file in setup.py

二次信任 提交于 2021-02-10 18:12:33

问题


I have a Python project that uses an executable file.

The package structure is something like that:

/Project
    /Package
        __init__.py
        aClass.py
        executableFile
    LICENSE
    README.md

and I've this setup.py:

...
setup(
    author=...
    author_email=....
    classifiers=[...]
    description=....
    install_requires=[...]
    license=..
    long_description=...
    include_package_data=True
    packages=find_packages(include=['Package*'])
    url=..
    version=x.x.x
)

but when I upload the package as stated here with twine in PyPI, the executable file is not loaded.

How can I properly include that file in the package?

PS: I've also read about adding scripts=[..] in setup.py, but it is limited to python files.


回答1:


You need to use a manifest.

In MANIFEST.in:

include Package/executableFile



来源:https://stackoverflow.com/questions/51429740/how-to-include-an-executable-file-in-setup-py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!