[Python-bugs-list] [ python-Bugs-608033 ] Implied __init__.py not copied

noreply@sourceforge.net noreply@sourceforge.net
Wed, 11 Sep 2002 13:13:16 -0700


Bugs item #608033, was opened at 2002-09-11 13:13
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=608033&group_id=5470

Category: Distutils
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Tom Epperly (tepperly)
Assigned to: Nobody/Anonymous (nobody)
Summary: Implied __init__.py not copied

Initial Comment:
The setup method in distutils won't allow me to specify
packages and py_modules, and it doesn't correctly
deduce all of the directories that need __init__.py
files copied.  See the attached setup.py for an
example. This setup.py is automatically generated from
a cca.sidl file containing an interface description.

In my example, the directory structure is as follows:
gov/
gov/cca/
gov/cca/ports/
decaf/
decaf/ports
The problem is that gov/ only contains __init__.py.

If I specific packages and py_modules in my setup call,
I see the following:
[epperly@tux06 runPython]$ python2.2 setup.py
--include-dirs=`cd ../../../runtime/python && pwd`
--include-dirs=`cd ../../../runtime/sidl && pwd`
--include-dirs=`cd . && pwd` --library-dirs=`cd
../../../runtime/sidl/.libs && pwd` install
--prefix=/tmp/pytest
running install
running build
running build_py
error: build_py: supplying both 'packages' and
'py_modules' options is not allowed
[epperly@tux06 runPython]$ 

If I comment out the "packages = []" part and do a
"python setup.py install", it doesn't copy 
gov/__init__.py, decaf/__init__.py and
decaf/ports/__init__.py to the installation directory.

>From this data, it appears that distutils isn't
deducing the package list correctly from py_modules and
ext_modules. For each element of py_modules, it should
add all the parent modules. For an py_modules entry,
a.b.c.d.e.f, distutils should add a, a.b, a.b.c,
a.b.c.d, and a.b.c.d.e to the package list.

distutils should also glean package names from the
ext_modules list.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=608033&group_id=5470