繁体   English   中英

无法排除python setup.py中的子目录

[英]Can't exclude subdirectory in python setup.py

我有以下结构:

project
  - setup.py
  - app
    - stuff
    - to
    - include
    - module_to_exclude
      - more stuff

setup.py我有:

setup(
    name="app",
    packages=find_packages(exclude=['module_to_exclude', '*.module_to_exclude', '*.module_to_exclude.*', 'module_to_exclude.*']),
    include_package_data=True,
    install_requires=[...],
    ext_modules=[],
    package_data={},
)

但是当我运行时:

python setup.py bdist_wheel

我可以看到module_to_exclude仍在添加中。 我究竟做错了什么?

packages=find_packages(exclude=['app.module_to_exclude']),

module_to_excludeapp的子程序包,而不是顶级程序包。

扩展@phd 的答案:如果要排除module_to_exclude及其所有子模块,则需要添加:

packages=find_packages(exclude=['app.module_to_exclude', 'app.module_to_exclude.*'])

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM