0

I have this C SDK that I'm working on creating a Python extension for. The C SDK documentation says that it expects a ffmpeg executable in it's working directory. My current project structure is:

my-extension/
    include/
        sdk-file.h
        sdk-file-2.h
    lib/
        sdk-lib.so
        sdk-lib2.so
    src/
        my-extension.c
    setup.py

My setup.py:

from setuptools import setup
from setuptools.extension import Extension

setup(
    name='my_extension',
    version='develop',
    ext_modules=[Extension(
        'my_extension',
        ['src/my-extension.c'],
        include_dirs=['include'],
        library_dirs=['lib'],
        libraries=['sdk-lib', 'sdk-lib2',],
        runtime_library_dirs=['lib'],
    )]
)

My question is, how do I package a executable dependency (ffmpeg in this case) with my extension? The executable file was provided with the SDK.

1 Answer 1

0

I think package_data can be used for this:

setup(
    …
    package_data={'': ['ffmpeg']},
    …
)

package_data is a dict. Keys are submodule names; an empty string means the root of the package. Values are lists that list file patterns for named submodules. See the docs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.