Extending distutils with a package in site-packages?

Hi, I'm trying to write a module 'mydistutils', an extension to original distutils. I would like to make it distutils-compatible so that user of the module use mydistutils interchangeably. The only difference between them would be the addition of 'MyDistribution' and 'bdist_mycmd'. Because I don't want to mess up my python installation, It want to put all of those extension parts in site-packages/. But if I do that way, I cannot do "from mydistutils import core" or the like because mydistutils is in different package... Is there any pythonic tips for dealing this problem? I'd like to keep it simple, so setuptools-free solution would be preferable Thanks,

On Wed, Jan 21, 2009 at 11:42 PM, Akira Kitada <akitada@gmail.com> wrote:
Hi,
I'm trying to write a module 'mydistutils', an extension to original distutils. I would like to make it distutils-compatible so that user of the module use mydistutils interchangeably. The only difference between them would be the addition of 'MyDistribution' and 'bdist_mycmd'. Because I don't want to mess up my python installation, It want to put all of those extension parts in site-packages/. But if I do that way, I cannot do "from mydistutils import core" or the like because mydistutils is in different package... Is there any pythonic tips for dealing this problem? I'd like to keep it simple, so setuptools-free solution would be preferable
Do you mean, how to distribute your distutils extension ? if so, you have to create a package with its own setup.py, and use full paths in your import directives. Regards Tarek
Thanks, _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/

Hi Tarek, I asked that how can I write 'mydistutils' package pythonic way. The 'mydistutils' is distutils with only two additional things: - MyDistribution (Based on Distribution - bdist_mycmd (Based on Command) If I copied whole distutils/ package into site-packages/mydistutils, it should work, but I'm sure this is ugly and a serious kludge. importing everything of distutils in mydistutils __init__.py might also work, but I think this is not the way to go. At the other place, I was suggested to use __path__ to workaround this. It seems to me a much better than other solutions, but I would like to know there're any other recommendations before diving into __path__ solution...
Do you mean, how to distribute your distutils extension ?
if so, you have to create a package with its own setup.py, and use full paths in your import directives.
participants (2)
-
Akira Kitada
-
Tarek Ziadé