Adam C Powell IV wrote:
Hi again,

I know it's been a while...

So to do this right, I'd just change 'setup(name="babel",' to
'setup(name="babel.sidl",' in setup.py and sidlsetup.py, right?
I am trying a "make distcheck" on the main trunk with the attached patch (relative to the svn main trunk). This changes the name to "llnl_babel" for sidlsetup.py and to "llnl_babel_<pkg1>_<pkg2>" for a Babel run that produces code in packages pkg1 and pkg2. I think have a period in the name might produce pain on some file systems.

By the way, I am still working on getting proper permission (in the form of some kind of license) for the Babel documentation and its source. It has been a chaotic year here due to our change in management.

Tom
-Adam

On Wed, 2008-08-06 at 16:51 -0700, Ben Allan wrote:
I'll just note that fortunately for us the openbabel project
(bio/chemical) went with pybel rather than babel in the python
hierarchy.

I'd vote for proper subnaming in python sidl.babel., sidl., sidlx., etc
which it seems (in typographical terms) Tom is ok with.
Not sure what the full directory structure implications are.

ben

On Wed, Aug 06, 2008 at 06:55:52PM -0400, Adam C Powell IV wrote:
Greetings,

There's a python-babel package for internationalization, which has a
Python namespace conflict with the Python runtime bindings for the SIDL
Babel.

As a possible resolution, how much stuff would I break by changing
"babel" to "sidl" in [sidl]setup.py?  I'm afraid I don't know a whole
lot about Python, so I'm out of my league here...

[Please include all of the CC addresses in your reply.]

Cheers,
-Adam

Index: runtime/python/sidlsetup.py
===================================================================
--- runtime/python/sidlsetup.py (revision 6527)
+++ runtime/python/sidlsetup.py (working copy)
@@ -52,7 +52,7 @@
       else:
         sys.argv.append(i)
       
-setup(name="babel",
+setup(name="llnl_babel",
       author="Tom Epperly",
       version="1.2.1",
       description="Build Python support extension modules for sidl",
Index: compiler/gov/llnl/babel/backend/python/SetupGenerator.java
===================================================================
--- compiler/gov/llnl/babel/backend/python/SetupGenerator.java  (revision 6527)
+++ compiler/gov/llnl/babel/backend/python/SetupGenerator.java  (working copy)
@@ -123,6 +123,22 @@
   }
 
   /**
+   * Generate an extended name.
+   */
+  private String nameExt() {
+    StringBuffer result = new StringBuffer();
+    Iterator i = d_packages().iterator();
+    while (i.hasNext()) {
+      String pkg = (String)i.next();
+      if (pkg.indexOf('.') < 0) {
+        result.append('_');
+        result.append(pkg);
+      }
+    }
+    return result.toString();
+  }
+
+  /**
    * Generate the setup.py to build the Python extension modules.
    *
    * @exception java.io.IOException this is a exception that contains
@@ -167,7 +183,7 @@
       lw.println("from re import compile");
       lw.println("from distutils.core import setup, Extension");
       processArgs(lw);
-      lw.println("setup(name='babel',");
+      lw.println("setup(name='llnl_babel" + nameExt() + "',");
       lw.tab();
       lw.println("include_dirs=inc_dirs,");
       // writeList(lw, "py_modules", d_pymodules.iterator());

Reply via email to