2

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'])],
)

1 Answer 1

3

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/*
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, that works :) Why do have the files both, to the setup.py and also to the manifest?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.