【发布时间】:2017-09-08 00:29:34
【问题描述】:
我的项目结构如下:
.
├── docs
├── examples
├── MANIFEST.in
├── README.rst
├── setup.cfg
├── setup.py
└── myproject
我想将我的项目捆绑到一个轮子中。为此,我使用以下setup.py:
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='myproject',
version='1.0',
description='Great project'
long_description=open('README.rst').read(),
author='Myself'
packages=find_packages(exclude=['tests','test','examples'])
)
运行python setup.py bdist_wheel 时,examples 目录包含在轮子中。如何防止这种情况发生?
根据
Excluding a top-level directory from a setuptools package
我希望examples 被排除在外。
【问题讨论】:
-
尝试将
examples/添加到.gitignore。也许你应该添加setup(..., include_package_data=True, ...)。 -
我不想从存储库中排除示例/。另外,我为什么要包含_package_data?这和我的问题有关吗?
标签: python setuptools python-wheel