[PATCH 3 of 3] extensions: also search for extension in the 'hgext3rd' package

Yuya Nishihara yuya at tcha.org
Sat Mar 12 09:38:33 EST 2016


On Fri, 11 Mar 2016 11:47:05 +0000, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1457692208 0
> #      Fri Mar 11 10:30:08 2016 +0000
> # Node ID 394b75d27c45e4f9409e8185c47229990db72af8
> # Parent  22f8428e07e42b110ee72cfe2725f714617686b5
> # EXP-Topic hgext3rd
> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 394b75d27c45
> extensions: also search for extension in the 'hgext3rd' package
> 
> Mercurial extensions are not meant to be normal python package/module. Yet the
> lack of an official location to install them means that a lot of them actually
> install as root level python package, polluting the global Python package
> namespace and risking collision with more legit packages. As we recently
> discovered, core python actually support namespace package. A way for multiples
> distinct "distribution" to share a common top level package without fear of
> installation headache. (Namespace package allow submodule installed in different
> location (of the 'sys.path') to be imported properly. So we are fine as long as
> extension includes a proper 'hgext3rd.__init__.py' to declare the namespace
> package.)
> 
> Therefore we introduce a 'hgext3rd' namespace packages and search for extension
> in it. We'll then recommend third extensions to install themselves in it.
> Strictly speaking we could just get third party extensions to install in 'hgext'
> as it is also a namespace package. However, this would make the integration of
> formerly third party extensions in the main distribution more complicated as the third
> party install would overwrite the file from the main install. Moreover, having an
> explicit split between third party and core extensions seems like a good idea.
> 
> The name 'hgext3rd' have been picked because it is short and seems explicit enough.
> Other alternative I could think of where:
> 
> - hgextcontrib
> - hgextother
> - hgextunofficial

This will need a bikeshedding?

I prefer "hgextcontrib" a bit. I might look for 'hgext2nd' if there is 3rd.


More information about the Mercurial-devel mailing list