OK, in fact distutils can compile every python script without a problem as
long as it is in a package. For instance every solver is in the solvers
folder, but there is no __init__.py file there, so distutils cannot compile
the scripts that are in the subfolders, it is logical.
What you have to do is to modify your oo.py file so that it does not add all
subfolders to the sys.path. Besides, if someone has a subfoler that is named
after one of our folders, the whole scikit can crash : the purpose of
namespaces is to avoid this, so we must use them adequately (that is
scikit.openopt.*), even if it means that the whole scikit architecture must
be rethought.

Matthieu

2007/12/18, Matthieu Brucher <[EMAIL PROTECTED]>:
>
> Hi,
>
> My solution was the correct way to go, IIRC, only a few changes were to be
> done so that those files were detected correctly (I think there were some
> __init__.py files that were not present this may have to do with the fact
> that you add a lot of additional paths in sys.path when you load openopt,
> but I already told you we should simplify this).
>
> Matthieu
>
> 2007/12/18, dmitrey <[EMAIL PROTECTED] >:
> >
> > When earlier OpenOpt versions had been installed there were no
> > compiled pyc-files (in destination directory). I called to mailing
> > list but no obvious receipt had been achieved. Matthieu had done some
> > changes but it yielded other mistakes (no some py-files detected or
> > kind of), so I had removed those changes and write my own, for to have
> > OO py-files being compiled when installed, because next time when they
> > will be run user may not have root permissions, so he will recompile
> > source files each time OO starts.
> >
> > On Dec 17, 10:27 pm, Robert Kern < [EMAIL PROTECTED]> wrote:
> > > dmitrey wrote:
> > > > Use
> > > > python setup.py install
> > >
> > > People should be able to run the distutils commands independently.
> > >
> > > What are you trying to achieve with this block of code that follows
> > the setup()
> > > call?
> > >
> > >     new_name = 'tmp55'
> > >     os.rename('scikits', new_name)
> > >     newPath = []
> > >     for directory in sys.path:
> > >         if not 'scikits' in directory: newPath.append(directory)#
> > something
> > > wrong with list.remove()
> > >     sys.path = newPath
> > >     import scikits
> > >     reload(scikits)
> > >     Path = scikits.__path__[0]
> > >     NewPath = os.path.join(Path, 'openopt')
> > >     rmtree(NewPath, True) # True means ignore errors
> > >     copytree(os.path.join (os.path.curdir, new_name, 'openopt'),
> > NewPath)
> > >     NewPath = Path
> > >     compileall.compile_dir(NewPath)
> > >
> > >     os.rename(new_name, 'scikits')
> > >
> > > This just looks like a really bad idea.
> > >
> > > --
> > > Robert Kern
> > >
> > > "I have come to believe that the whole world is an enigma, a harmless
> > enigma
> > >  that is made terrible by our own mad attempt to interpret it as
> > though it had
> > >  an underlying truth."
> > >   -- Umberto Eco
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
>
> --
> French PhD student
> Website : http://matthieu-brucher.developpez.com/
> Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
> LinkedIn : http://www.linkedin.com/in/matthieubrucher




-- 
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to