[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-distutils-sig
Subject:    Re: [Distutils] modules in sub-packages
From:       "P.J. Eby" <pje () telecommunity ! com>
Date:       2010-04-07 17:55:00
Message-ID: 20100407175506.025E83A4063 () sparrow ! telecommunity ! com
[Download RAW message or body]

At 11:00 PM 4/7/2010 +0530, Amit Sethi wrote:
>I am trying to create  a module for the docutils . I wish to install
>it docutils.writer.something

Is that a documented, official way to extend docutils?  If not, and 
docutils.writer is not a namespace package, then you should not be doing that.


>I have docutils installed at
>/usr/local/lib/python2.6/dist-packages/docutils-0.6-py2.6.egg
>on my ubuntu machine but when I tried to install it create a seperate
>package called docutils and saves
>the package in that ? How do I tell a package that this particular
>package is a subpackage of a library
>the setup.py of the package looks like :
>  license='Public Domain',
>  packages=['docutils.writers'],
>  package_dir={'docutils.writers':'docbook'},
>  scripts=['rst2docbook.py']

The correct way to do this is to NOT list packages or package_dir; 
just use py_modules = 'docutils.writer.docbook', and have a 
docutils/writer/docbook.py file.  This will install it in a 
distutils-compatible way, but not a distribute-compatible or 
setuptools-compatible way.

Really, this is not a well-supported scenario in any case -- it is to 
be avoided if at all possible.  Installing your code into other 
people's packages is a bad way to extend them.  (Setuptools and 
Distribute offer better ways of providing extensibility, such as 
namespace packages and entry points.)


_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic