开发者

Question about bdist directory hierarchy

I just made a small app and then wrote开发者_StackOverflow a setup.py file for it. Everything seems to be working, except I can't figure out a small thing.

When passing the bdist option to setup.py, it creates the archive gzipped tar file. When I open that file, I notice that the directory structure is:

> usr
  > lib
    > python2.6
      > site-packages 
        > Folder 1
        > Folder 2

What is the reason for this? Typically, I had expect that Folder 1 and Folder 2 would be in the root directory. Why does bdist add the top level directories? Is there any way I can get rid of them (more importantly, should I get rid of them?)


I think that you want an sdist output .... so try python setup.py sdist

Quote of Python documentation

As a simple example, if I run the following command in the Distutils source tree:

python setup.py bdist

then the Distutils builds my module distribution (the Distutils itself in this case), does a “fake” installation (also in the build directory), and creates the default type of built distribution for my platform. The default format for built distributions is a “dumb” tar file on Unix, and a simple executable installer on Windows. (That tar file is considered “dumb” because it has to be unpacked in a specific location to work.)

See Python Documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜