Let's say you have a project called proj
and in this project you have the following structure:
proj/
dists/
doc/
src/
__init__.py
xyz.py
abc.py
test/
setup.py
As you can see all the content of your project is in the src
subfolder. How to go about making a distutils distribution package out of the src
folder?
My naive idea, following the tutorial, would've been to write the setup.py
like this:
#omitting basics
setup(
name='proj',
packages=['src'],
package_dir={'proj':'src'}
)
But after installing the resulting package to my system, I still have to import src.xyz
and not proj.xyz
, which would've been the goal and the expected result.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…