我是setuptools的新手,并尝试过几种没有运气的方法。我有一个Python根模块mymod
,其中包含要打包的其他模块。 mymod
模块位于项目testproj
中,我用它来开发和测试模块。
testproj
├── mymod
│ ├── __init__.py
│ ├── mysubmod1
│ │ ├── __init__.py
│ │ └── file1.py
│ └── mysubmod2
│ ├── __init__.py
│ └── file1.py
├── testmod
│ ├── __init__.py
│ └── testsubmod
│ ├── __init__.py
│ └── file1.py
├── LICENSE
├── README.md
└── setup.cfg
我只想打包mymod
及其包含和将要包含的所有模块。目前,我正在setup.cfg
的本节中解决此问题:
[options]
py_modules=["mymod"],
packages=find:
[options.packages.find]
exclude=
testmod
testmod.*
但是对于我来说,该解决方案似乎有点棘手,因为随着我的测试项目的发展和发展,我将不得不不断更新排除在外的内容。有没有办法让find:
在特定模块上递归工作?