Is it possible to include subdirectories using dist utils (setup.py) as part of package data?

前端 未结 6 1532
礼貌的吻别
礼貌的吻别 2021-01-03 17:54

Basically my python package is setup like:

module
\\_examples
  \\_folder1
     \\_file1.py
     \\_file2.py
  \\_folder2
    \\_file1.py
    \\_file2.py
         


        
6条回答
  •  -上瘾入骨i
    2021-01-03 18:37

    I believe what you're looking for is something like this for you setup.py, which will recursively find any packages in the project, also be sure and include __init__.py files to subdirectories for each package you want.

    from setuptools import setup, find_packages
    
    setup(name='MySoftware',
          packages=find_packages()
    )
    

提交回复
热议问题