Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 446
Frank Avatar asked Mar 09 '26 06:03

Frank


1 Answers

You need to use a manifest.

In MANIFEST.in:

include Package/executableFile

like image 76
MoxieBall Avatar answered Mar 10 '26 19:03

MoxieBall