[Python-Dev] Dropping init.py requirement for subpackages (original) (raw)
Bernhard Herzog bh at intevation.de
Thu Apr 27 15:48:01 CEST 2006
- Previous message: [Python-Dev] Dropping __init__.py requirement for subpackages
- Next message: [Python-Dev] Dropping __init__.py requirement for subpackages
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Gustavo Carneiro" <gjcarneiro at gmail.com> writes:
Now the problem. Suppose you have the source package python-foo-bar, which installs pythondir/foo/init.pyandpythondir/foo/init.py and pythondir/foo/init.pyandpythondir/foo/bar.py. This would make a module called "foo.bar" available. Likewise, you can have the source package python-foo-zbr, which installs $pythondir/foo/init.py and $pythondir/foo/zbr.py. This would make a module called "foo.zbr" available.
The two packages above install the file $pythondir/foo/init.py. If one of them adds some content to init.py, the other one will overwrite it. Packaging these two packages for e.g. debian would be extremely difficult, because no two .deb packages are allowed to intall the same file. One solution is to generate the init.py file with post-install hooks and shell scripts. Another solution would be for example to have only python-foo-bar install the init.py file, but then python-foo-zbr would have to depend on python-foo-bar, while they're not really related.
Yet another solution would be to put foo/init.py into a third package, e.g. python-foo, on which both python-foo-bar and python-foo-zbr depend.
Bernhard
-- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/
- Previous message: [Python-Dev] Dropping __init__.py requirement for subpackages
- Next message: [Python-Dev] Dropping __init__.py requirement for subpackages
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]