开发者

How to package example scripts using distribute?

I use distribute to package a small python library. I made a directory structure as described in the Hitchhiker's Guide to Packaging.

My question: Where (in the directory structure) do I place example scripts that show how to use the library and what开发者_如何学编程 changes are necessary to the setup.py?


I think its good, not to install the examples, rather you can keep your examples folder with your distribution, so it may be on the same level where your setup.py,

If you want to include them, then include as separate module of package, like 'example' - and that directory holds the all example scripts, that users can refer even after installing.

package_data = {
        'module_1': [files],
        'module_2': [files],
        'example': [files],
}


Example scripts are a type of documentation, so install them in the same way you would install other documentation: as package_data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜