hgext/__init__.py
author Pierre-Yves David <pierre-yves.david@fb.com>
Fri, 11 Mar 2016 09:48:12 +0000
changeset 1619 5ef77a1d975c
parent 519 9825c7da5b54
permissions -rw-r--r--
hgext: turn 'hgext' into a namespace package Actually since Python 2.3, there is some way to turn top level package into "namespace package" so that multiple subpackage installed in different part of the path can still be imported transparently. This feature was previously thought (at least by myself) to be only provided by some setuptool black magic. Turning hgext into such namespace package allows third extensions to install themselves inside the "hgext" namespace package to avoid polluting the global python module namespace. They will now be able to do so without making it a pain to use a Mercurial "installed" in a different way/location than these extensions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1619
5ef77a1d975c hgext: turn 'hgext' into a namespace package
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 519
diff changeset
     1
from __future__ import absolute_import
5ef77a1d975c hgext: turn 'hgext' into a namespace package
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 519
diff changeset
     2
import pkgutil
5ef77a1d975c hgext: turn 'hgext' into a namespace package
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 519
diff changeset
     3
__path__ = pkgutil.extend_path(__path__, __name__)
5ef77a1d975c hgext: turn 'hgext' into a namespace package
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 519
diff changeset
     4