<div dir="ltr">Hi,<div><br></div><div>I'm the current developer of Xapian-Haystack, and I'm glad to announce that we've been finally able to install and pass all the tests of Xapian-Haystack with Xapian 1.3.3 in both Python 2 and 3, which means that Xapian-Haystack now supports Python 3. This naturally would not be possible without your efforts to push Xapian bindings to Python 3, and I thank you for that.</div><div><br></div><div>Here I report some of the "features" that hindered this task from our perspective, so that Xapian devs are aware of the kind of problems a user may face on this process.</div><div><br></div><div>1. Dev version of Xapian has different names for their tools, namely xapian-config and delve. xapian-config became xapian-config-1.3, delve became xapian-delve-1.3.</div><div><br></div><div>Suggestion: make names independent of oddity of the minor version. I don't find a compelling reason to force users to code:</div><div><pre style="color:rgb(0,0,0);font-family:Menlo"><pre style="font-family:Menlo">XAPIAN_VERSION = [<span style="color:rgb(0,0,128)">int</span>(x) <span style="color:rgb(0,0,128);font-weight:bold">for </span>x <span style="color:rgb(0,0,128);font-weight:bold">in </span>xapian.<span style="color:rgb(178,0,178)">__version__</span>.split(<span style="color:rgb(0,128,128);font-weight:bold">'.'</span>)]</pre></pre><pre style="color:rgb(0,0,0);font-family:Menlo"><span style="color:rgb(0,0,128);font-weight:bold">if </span>XAPIAN_VERSION[<span style="color:rgb(0,0,255)">1</span>] <= <span style="color:rgb(0,0,255)">2</span>:<br>    <span style="color:rgb(128,128,128);font-style:italic"># old versions use "delve".<br></span><span style="color:rgb(128,128,128);font-style:italic">    </span>executable = <span style="color:rgb(0,128,128);font-weight:bold">'delve'<br></span><span style="color:rgb(0,0,128);font-weight:bold">else</span>:<br>    <span style="color:rgb(128,128,128);font-style:italic"># new versions use 'xapian-delve'<br></span><span style="color:rgb(128,128,128);font-style:italic">    </span>executable = <span style="color:rgb(0,128,128);font-weight:bold">'xapian-delve'<br></span><span style="color:rgb(0,128,128);font-weight:bold"><br></span><span style="color:rgb(128,128,128);font-style:italic"># dev versions (odd minor) use a suffix<br></span><span style="color:rgb(0,0,128);font-weight:bold">if </span>XAPIAN_VERSION[<span style="color:rgb(0,0,255)">1</span>] % <span style="color:rgb(0,0,255)">2 </span>!= <span style="color:rgb(0,0,255)">0</span>:<br>    executable = executable+<span style="color:rgb(0,128,128);font-weight:bold">'-%d.%d' </span>% <span style="color:rgb(0,0,128)">tuple</span>(XAPIAN_VERSION[<span style="color:rgb(0,0,255)">0</span>:<span style="color:rgb(0,0,255)">2</span>])</pre></div><div>or, in languages where version comparison is more tricky, atm our (bad) solution is</div><div><pre style="color:rgb(0,0,0);font-family:Menlo"><span style="color:rgb(0,0,128);font-weight:bold">if [ </span>$VERSION <span style="color:rgb(0,0,128);font-weight:bold">= </span><span style="color:rgb(0,128,0);font-weight:bold">"1.3.3"</span><span style="color:rgb(0,0,128);font-weight:bold"> ]</span>; <span style="color:rgb(0,0,128);font-weight:bold">then<br></span><span style="color:rgb(0,0,128);font-weight:bold">    </span>XAPIAN_CONFIG=$VIRTUAL_ENV/bin/xapian-config-1.3<br><span style="color:rgb(0,0,128);font-weight:bold">else<br></span><span style="color:rgb(0,0,128);font-weight:bold">    </span>XAPIAN_CONFIG=<br><span style="color:rgb(0,0,128);font-weight:bold">fi</span></pre></div><div>2. Almost all Xapian bindings output is in non-unicode that can be converted to unicode via `decode('utf-8')`, which is great. Yet, this is still not perfect because e.g. `xapian.sortable_unserialise(12.345)` is not decodable to utf-8. Thus, depending on the type of field (string, int, float) (in the user side), its value will be either a string or byte strings, something that is against any Python idiom.<br></div><div><br></div><div>Suggestion: make all public interface of Xapian in Python to return either unicode or utf-8 decodable strings. IMO, at the current state of Python development where unicode is *the* standard, it is the bindings responsibility to return unicodes. If that is not possible in Xapian bindings, at least consider making the output to be totally undecodable so a user can be sure that any Xapian public interface allows .decode('utf-8').</div><div><br></div><div>3. In Xapian-Haystack we use TravisCI to build against different Python, Django and Xapian versions. Installing Xapian takes 95% of the total build time. Any suggestion how to reduce this? For concreteness, here is the installation file we are using: <a href="https://github.com/notanumber/xapian-haystack/blob/master/install_xapian.sh">https://github.com/notanumber/xapian-haystack/blob/master/install_xapian.sh</a></div><div><br></div><div>Again, thanks for your work,</div><div>Regards,</div><div>Jorge</div><div><br></div></div>