[Python-ideas] problems with import
Neal Becker
ndbecker2 at gmail.com
Fri Jun 27 23:02:14 CEST 2014
Steven D'Aprano wrote:
> On Fri, Jun 27, 2014 at 02:33:07PM -0400, Antoine Pitrou wrote:
>> Le 27/06/2014 13:12, Steven D'Aprano a écrit :
>> >On Fri, Jun 27, 2014 at 09:05:48AM -0400, Neal Becker wrote:
>> >[...]
>> >>Now I also have
>> >>~/.local/lib/python2.7/site-packages/hgext
>> >>
>> >>but python won't search there for extensions. Once if finds the system
>> >>hgext
>> >>directory, it won't look also in the local one.
>> >
>> >Re-arrange sys.path so that the local site-packages comes first,
>> >before the global site-packages. (I'm surprised Python doesn't
>> >already do this.)
>>
>> Then he would have the reverse problem: once he installs a user-local hg
>> extension, the bundled (official) hg extensions wouldn't be reachable
>> anymore.
>
> Naturally, but I assumed that the only reason you would install
> something locally was if you intended it to over-ride the global
> version. If that's not the case, then you're right, it's an issue for
> Mercurial to solve.
>
>
I don't think this is unique to mercurial.
I'd like to have 2 areas for installing extensions to a package:
a system wide and a local.
I think the semantics we'd want is that the 2 trees are effectively merged,
with the local overriding in the event of a conflict
More information about the Python-ideas
mailing list