[Distutils] python setup.py bdist_egg results depend on dir location

Todd Greenwood-Geer tgreenwoodgeer at yahoo.com
Wed Dec 14 21:59:21 CET 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PROBLEM:
I would like to be able to execute the egg build from several
directories, like so:

$ cd active/SimpleExampleEgg
$ python setup.py bdist_egg

then, at other times, i'd like to change to a package directory and
execute the builds from there:

$ cd active/SimpleExampleEgg/fruit/docs
$ python ../../setup.py bdist_egg

this places the output in active/SimpleExampleEgg/fruit/docs (build,
dist), which is fine by me.

REASON:
I'm executing builds as part of my documentation process using vim and a
restructured text pluggin to vim. Everything seems to hang together a
bit better if I execute the vim/rest code from the directory it is in,
[project]/fruit/docs, in this case.

ALTERNATIVE:
I suppose I could stay in the project root directory. This means I'd
have to include my documentation via resource_filename(...), and is not
the end of the world.

BUG:
Perhaps this is exposing an interesting bug. I would expect the egg
creation to either be identical for these two cases, or fail altogether
for the second case.

REPRO:
greenwo at luxor~/active/SimpleExampleEgg$ python setup.py bdist_egg
running bdist_egg
running egg_info
writing ./SimpleExampleEgg.egg-info/PKG-INFO
writing top-level names to ./SimpleExampleEgg.egg-info/top_level.txt
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
creating build/bdist.linux-i686/egg
creating build/bdist.linux-i686/egg/fruit
copying build/lib/fruit/orange.py -> build/bdist.linux-i686/egg/fruit
copying build/lib/fruit/apple.py -> build/bdist.linux-i686/egg/fruit
copying build/lib/fruit/__init__.py -> build/bdist.linux-i686/egg/fruit
copying build/lib/fruit/simpletests.py -> build/bdist.linux-i686/egg/fruit
creating build/bdist.linux-i686/egg/fruit/docs
copying build/lib/fruit/docs/traditional.css ->
build/bdist.linux-i686/egg/fruit/docs
copying build/lib/fruit/docs/readme.rest ->
build/bdist.linux-i686/egg/fruit/docs
copying build/lib/fruit/docs/readme.html ->
build/bdist.linux-i686/egg/fruit/docs
copying build/lib/fruit/docs/default.css ->
build/bdist.linux-i686/egg/fruit/docs
copying build/lib/fruit/docs/oldstyle.css ->
build/bdist.linux-i686/egg/fruit/docs
copying build/lib/fruit/docs/vstrc.vim ->
build/bdist.linux-i686/egg/fruit/docs
byte-compiling build/bdist.linux-i686/egg/fruit/orange.py to orange.pyc
byte-compiling build/bdist.linux-i686/egg/fruit/apple.py to apple.pyc
byte-compiling build/bdist.linux-i686/egg/fruit/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-i686/egg/fruit/simpletests.py to
simpletests.pyc
creating build/bdist.linux-i686/egg/EGG-INFO
copying ./SimpleExampleEgg.egg-info/PKG-INFO ->
build/bdist.linux-i686/egg/EGG-INFO
copying ./SimpleExampleEgg.egg-info/top_level.txt ->
build/bdist.linux-i686/egg/EGG-INFO
creating 'dist/SimpleExampleEgg-0.1-py2.4.egg' and adding
'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
tgreenwo at luxor~/active/SimpleExampleEgg$ unzip -l
dist/SimpleExampleEgg-0.1-py2.4.egg
Archive:  dist/SimpleExampleEgg-0.1-py2.4.egg
~  Length     Date   Time    Name
~ --------    ----   ----    ----
~      290  12-14-05 12:11   fruit/orange.py
~      286  12-14-05 12:11   fruit/apple.py
~        0  12-14-05 12:13   fruit/__init__.py
~      240  12-14-05 12:26   fruit/simpletests.py
~      556  12-14-05 12:47   fruit/orange.pyc
~      625  12-14-05 12:47   fruit/apple.pyc
~      124  12-14-05 12:47   fruit/__init__.pyc
~      537  12-14-05 12:47   fruit/simpletests.pyc
~    14863  12-14-05 12:36   fruit/docs/traditional.css
~     5079  12-14-05 12:43   fruit/docs/readme.rest
~    12958  12-14-05 12:43   fruit/docs/readme.html
~     6464  12-14-05 12:43   fruit/docs/default.css
~    14140  12-14-05 12:36   fruit/docs/oldstyle.css
~      141  12-14-05 12:36   fruit/docs/vstrc.vim
~      532  12-14-05 12:47   EGG-INFO/PKG-INFO
~        6  12-14-05 12:47   EGG-INFO/top_level.txt
~        0  12-14-05 12:47   EGG-INFO/zip-safe
~ --------                   -------
~    56841                   17 files
tgreenwo at luxor~/active/SimpleExampleEgg$ cd fruit/docs/
tgreenwo at luxor~/active/SimpleExampleEgg/fruit/docs$ python
../../setup.py bdist_egg
running bdist_egg
running egg_info
writing ./SimpleExampleEgg.egg-info/PKG-INFO
writing top-level names to ./SimpleExampleEgg.egg-info/top_level.txt
installing library code to build/bdist.linux-i686/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to
install
creating build/bdist.linux-i686/egg
creating build/bdist.linux-i686/egg/EGG-INFO
copying ./SimpleExampleEgg.egg-info/PKG-INFO ->
build/bdist.linux-i686/egg/EGG-INFO
copying ./SimpleExampleEgg.egg-info/top_level.txt ->
build/bdist.linux-i686/egg/EGG-INFO
creating 'dist/SimpleExampleEgg-0.1-py2.4.egg' and adding
'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
tgreenwo at luxor~/active/SimpleExampleEgg/fruit/docs$ unzip -l
dist/SimpleExampleEgg-0.1-py2.4.egg
Archive:  dist/SimpleExampleEgg-0.1-py2.4.egg
~  Length     Date   Time    Name
~ --------    ----   ----    ----
~      532  12-14-05 12:48   EGG-INFO/PKG-INFO
~        1  12-14-05 12:48   EGG-INFO/top_level.txt
~        0  12-14-05 12:48   EGG-INFO/zip-safe
~ --------                   -------
~      533                   3 files
tgreenwo at luxor~/active/SimpleExampleEgg/fruit/docs$


- -Todd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDoIepz6uXX4lQc/URAmBeAJ9MNkw8rvTpZedpH7seUY8kjA6QKgCfe+sK
D/zaLhfsLcju0dOUMDOVZyo=
=jtO/
-----END PGP SIGNATURE-----


More information about the Distutils-SIG mailing list