A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20060427/bb6f3ff6/attachment.html below:

<br><br><div><span class="gmail_quote">On 4/27/06, <b class="gmail_sendername">Phillip J. Eby</b> &lt;<a href="mailto:pje@telecommunity.com">pje@telecommunity.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At 03:48 PM 4/27/2006 +0200, Bernhard Herzog wrote:<br>&gt;&quot;Gustavo Carneiro&quot; &lt;<a href="mailto:gjcarneiro@gmail.com">gjcarneiro@gmail.com</a>&gt; writes:<br>&gt;<br>&gt; &gt;&nbsp;&nbsp; Now the problem.&nbsp;&nbsp;Suppose you have the source package python-foo-bar,
<br>&gt; &gt; which installs $pythondir/foo/__init__.py and $pythondir/foo/bar.py.&nbsp;&nbsp;This<br>&gt; &gt; would make a module called &quot;foo.bar&quot; available.&nbsp;&nbsp;Likewise, you can have the<br>&gt; &gt; source package python-foo-zbr, which installs
<br>&gt; $pythondir/foo/__init__.py and<br>&gt; &gt; $pythondir/foo/zbr.py.&nbsp;&nbsp;This would make a module called &quot;foo.zbr&quot;<br>&gt; available.<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp; The two packages above install the file $pythondir/foo/__init__.py.&nbsp;&nbsp;If
<br>&gt; &gt; one of them adds some content to __init__.py, the other one will overwrite<br>&gt; &gt; it.&nbsp;&nbsp;Packaging these two packages for e.g. debian would be extremely<br>&gt; &gt; difficult, because no two .deb packages are allowed to intall the same
<br>&gt; file.<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp; One solution is to generate the __init__.py file with post-install hooks<br>&gt; &gt; and shell scripts.&nbsp;&nbsp;Another solution would be for example to have only<br>&gt; &gt; python-foo-bar install the __init__.py file, but then python-foo-zbr would
<br>&gt; &gt; have to depend on python-foo-bar, while they're not really related.<br>&gt;<br>&gt;Yet another solution would be to put foo/__init__.py into a third<br>&gt;package, e.g. python-foo, on which both python-foo-bar and
<br>&gt;python-foo-zbr depend.</blockquote><div><br>&nbsp; You can't be serious.&nbsp; One package just to install a __init__.py file?<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Or you can package them with setuptools, and declare foo to be a namespace<br>package.</blockquote><div><br>&nbsp; Let's&nbsp; not assume setuptools are always used, shall we?<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;If installing in the mode used for building RPMs and debs, there<br>will be no __init__.py.&nbsp;&nbsp;Instead, each installs a .pth file that ensures a<br>dummy package object is created in sys.modules with an appropriate<br>__path__.&nbsp;&nbsp;This solution is packaging-system agnostic and doesn't require
<br>any special support from the packaging tool.</blockquote><div><br>&nbsp; I don't understand this solution.&nbsp; How can a .pth file create a 'dummy package'?&nbsp; Remember that the objective is to have &quot;foo.bar&quot; and &quot;
foo.zbr&quot; modules, not just &quot;bar&quot; and &quot;zbr&quot;.<br><br>&nbsp; But in any case, it already sounds like a convoluted solution.&nbsp; No way it can beat the obvious/simple solution: to remove the need to have __init__.py in the first place.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(The downside, however, is that neither foo.bar nor foo.zbr's __init__.py<br>will be allowed to have any content, since in some installation scenarios
<br>there will be no __init__.py at all.)</blockquote><div><br>&nbsp; That's ok in the context of this proposal (not having __init__.py at all). <br></div><br></div><br>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4