Razer
Razer

Reputation: 8201

setup.py include custom data file

I've written C-based extension module in python. Now I want to create a setup.py for installing the library. The library has following folder layout.

Mylib
    |--- setup.py
    |--- README.txt
    |--- mylib 
          |--- __init__.py
          |--- core.py
          |--- _core.pyd

How can I include _core.pyd for the installation? This is the my setup.py I tried so far but this does not include my pyd file.

setup(
    name='mylib',
    version='0.1dev',
    license='GPL',
    long_description=open('README.txt').read(),
    packages = find_packages(),
    data_files=[('', ['_core.pyd'])],
)

Upvotes: 2

Views: 1891

Answers (1)

user248237
user248237

Reputation:

Use this (if it were in data dir)

data_files = [('mylib/data', ['mylib/data/_core.pyd']),
              ..others]

make sure to include it in MANIFEST.in with include keyword, like:

include mylib/data/*

Upvotes: 3

Related Questions