Bugs item #608033, was opened at 2002-09-11 17:13 Message generated for change (Comment added) made by facundobatista 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: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Tom Epperly (tepperly) Assigned to: A.M. Kuchling (akuchling) 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: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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. ---------------------------------------------------------------------- Comment By: Facundo Batista (facundobatista) Date: 2005-03-22 18:25 Message: Logged In: YES user_id=752496 Deprecated. Reopen only if still happens in 2.3 or newer. . Facundo ---------------------------------------------------------------------- Comment By: Facundo Batista (facundobatista) Date: 2004-12-01 20:56 Message: Logged In: YES user_id=752496 Please, could you verify if this problem persists in Python 2.3.4 or 2.4? If yes, in which version? Can you provide a test case? If the problem is solved, from which version? Note that if you fail to answer in one month, I'll close this bug as "Won't fix". Thank you! . Facundo ---------------------------------------------------------------------- Comment By: A.M. Kuchling (akuchling) Date: 2002-11-06 12:01 Message: Logged In: YES user_id=11375 Actually, it looks like there's code in build_py.py that does add the __init__.py file; see the find_modules() method. It must be broken in some way. I'll look into it. ---------------------------------------------------------------------- Comment By: Tom Epperly (tepperly) Date: 2002-09-12 14:28 Message: Logged In: YES user_id=94539 I can fix my particular problem by using packages and not py_modules. ---------------------------------------------------------------------- Comment By: Tom Epperly (tepperly) Date: 2002-09-12 14:19 Message: Logged In: YES user_id=94539 I read the section loewis linked me to, and the example given there has 'mod1' in the "root package" and "pkg.mod2" in the pkg/ package. This leads me to believe that py_modules do not go into a single package as loewis suggests. In addition, distutils should copy __init__.py files implied by the list of C extension modules. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2002-09-12 04:04 Message: Logged In: YES user_id=21627 It appears that you are misunderstanding the meaning of the py_modules argument. See http://www.python.org/doc/current/dist/setup-script.html#SECTION000320000000000000000 It says "specially the case of a single module that goes in the ``root package'' " All py_modules modules are in a single package, irrespective of their source location. ---------------------------------------------------------------------- Comment By: Tom Epperly (tepperly) Date: 2002-09-11 17:22 Message: Logged In: YES user_id=94539 I am surprised that sourceforge let me assign this to someone. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=608033&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com