Search code examples
pythonexecutablesetup.pypypi

How to include an executable file in setup.py


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.


Solution

  • You need to use a manifest.

    In MANIFEST.in:

    include Package/executableFile