setup.py: renaming src package to project name

后端 未结 4 871
青春惊慌失措
青春惊慌失措 2020-12-24 05:39

Let\'s say you have a project called proj and in this project you have the following structure:

proj/
  dists/
  doc/
  src/
    __init__.py
            


        
4条回答
  •  生来不讨喜
    2020-12-24 06:01

    This is due to a bug in setuptools reported here: https://github.com/pypa/setuptools/issues/250

    Basically, it does work but not in dev mode. Now on you have 3 solutions:

    • symlink the src package as proj (and ignore it when comitting), it will works out of the box but is dirty
    • change from src to proj
    • create a subdirectory proj in src and use the following options:
    packages=['proj'],
    package_dir={'proj': 'src/proj'},
    

提交回复
热议问题