[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tool support for private modules



Josselin Mouette <joss@debian.org> writes:

> Le lundi 01 octobre 2007 à 14:42 +1000, Ben Finney a écrit :
> > But the Python distutils and setuptools will install the modules
> > to /usr/lib/site-python/.
> 
> Hrm, they shouldn't. With a default setup, public modules are
> shipped to /usr/lib/python2.X/site-packages.

Yes, my apologies, that's what the tools do. I've no idea why I typed
that unrelated path above.

> > My 'debian/rules' already has a 'dh_pycentral' line.
> 
> That would work if the files were shipped
> in /usr/lib/python2.X/site-packages.

That's where the distutils and setuptools place them by default,
yes. I don't know what magic is required to put them elsewhere; that
may be part of the answer, if someone can instruct me on how to do it.

The trouble is, these are modules that clearly fall under the "private
modules for the program" description in the policy document. I fully
agree with the policy that modules intended for internal use by a
discrete set of programs should not be installed to the public
site-packages directory.

How can I use the tools available — distutils, setuptools, debhelper —
to install these package-specific modules to a package-specific
location, such that all the programs in the package will be able to
find them?

> If, as the location suggests, they are public

The location does indeed suggest that, but AFAICT that's only because
both distutils and setuptools makes no distinction between "modules
intended for general use on the system" and "modules only intended for
use by specific programs".

> If the modules are indeed private, it looks like you need to change
> the path by hand, and to add it with sys.path.append("/the/path") at
> the beginning of the binary.

Hmm. I am hoping that "modify the programs" is not a necessary part of
this.

-- 
 \                 "He who laughs last, thinks slowest."  -- Anonymous |
  `\                                                                   |
_o__)                                                                  |
Ben Finney



Reply to: