<div dir="ltr">ok, I'll try to get a look</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font color="#999999"><br></font></div><div><font color="#999999">---</font></div><div><font color="#999999">Gregory Bataille</font><br></div></div></div></div>
<br><div class="gmail_quote">On Sat, Jan 28, 2017 at 2:26 AM, Kurt Schwehr <span dir="ltr"><<a href="mailto:schwehr@gmail.com" target="_blank">schwehr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I just pushed a copy of all of the python unittest based tests that I have so far to here:<div><br></div><div><a href="https://github.com/schwehr/gdal-autotest2/tree/master/python" target="_blank">https://github.com/schwehr/<wbr>gdal-autotest2/tree/master/<wbr>python</a><br></div><div><br></div><div>Be warned that I haven't tested them in this form and that in addition to needing build infrastructure, I am pretty sure the code can't currently find the test files.  Also a few of the NITF tests do not work in my custom environment so there are a few untried test files in nitf_test.py.  And I haven't tried these with python 3.x.</div><div><br></div><div>-kurt</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 10:52 AM, Grégory Bataille <span dir="ltr"><<a href="mailto:gregory.bataille@gmail.com" target="_blank">gregory.bataille@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>You are completely right. Symbolic link. Don't know what I was thinking about at the time!</div><div class="m_-4229881754520739235HOEnZb"><div class="m_-4229881754520739235h5"><div><br></div><div><br><div class="gmail_quote"><div>On Wed, 25 Jan 2017 at 19:12, Kurt Schwehr <<a href="mailto:schwehr@gmail.com" target="_blank">schwehr@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Gregory,<div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Aside: A point of terminology, by hyperlink, I think you mean <a href="https://en.wikipedia.org/wiki/Symbolic_link" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">symbolic link</a> or hard link.<div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg">As a point of information, I'm using both python unittest and C++ gunit very effectively for GDAL.  I do use bazel as the build system, but that doesn't really matter.  A very behind copy of what I've done is here:</div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><a href="https://github.com/schwehr/gdal-autotest2" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">https://github.com/schwehr/gda<wbr>l-autotest2</a></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg">And, sadly, it looks like I've yet to get any of the python code in there.  I'll try to get at least something in there today.<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="gmail_extra m_-4229881754520739235m_-1366722216468540339gmail_msg"></div></div></div></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="gmail_extra m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="gmail_quote m_-4229881754520739235m_-1366722216468540339gmail_msg">On Wed, Jan 25, 2017 at 3:35 AM, Grégory Bataille <span class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><<a href="mailto:gregory.bataille@gmail.com" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">gregory.bataille@gmail.com</a>></span> wrote:<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><blockquote class="gmail_quote m_-4229881754520739235m_-1366722216468540339gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg">ok, thansk for the pointers on the deployment side. I'll think about it</div><div class="gmail_extra m_-4229881754520739235m_-1366722216468540339gmail_msg"><br clear="all" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339m_6577167433768968283gmail-m_-2343707299888456433gmail_signature m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><font color="#999999" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></font></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><font color="#999999" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">---</font></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><font color="#999999" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Gregory Bataille</font><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div></div></div></div>
<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="gmail_quote m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339m_6577167433768968283gmail-h5 m_-4229881754520739235m_-1366722216468540339gmail_msg">On Wed, Jan 25, 2017 at 12:19 PM, Even Rouault <span class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><<a href="mailto:even.rouault@spatialys.com" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div></div><blockquote class="gmail_quote m_-4229881754520739235m_-1366722216468540339gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339m_6577167433768968283gmail-h5 m_-4229881754520739235m_-1366722216468540339gmail_msg"><u class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><span class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">On mercredi 25 janvier 2017 05:48:00 CET Grégory Bataille wrote:</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> Hello,</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> If I want to really spend some time for this utility, I'd like to do some</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> clean engineering around it.</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> What I'd like to do is:</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> - split the script into several files (smaller, single purpose, ...)</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> --> can you confirm that on all target platform, all .py files are deployed</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> and the /usr/local/bin/gdal2tiles.py is just an hyperlink on the source</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> file installed somewhere else?</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
</span><p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">This depends pretty much on how GDAL is packaged.</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">On Unix, the default "make install" target will copy any .py file of swig/python/scripts/ to the ${install_prefix}/bin directory. And for example Debian/Ubuntu packaging follows that.</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">On OSGeo4W, they do that similarly and have a .bat that creates a .bat shortcut for each installed .py file</p><span class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> --> do you see any issue with that?</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
</span><p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Yes, that the sub files would be available as executable scripts, whereas some of them would not be.</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">One could imagine that the code could go to a Python module (gdal_scripts ?), and the top-level gdal2tiles.py could be something like:</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">from osgeo import gdal_scripts</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">gdal_scripts.gdal2tiles(...)</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">I'm not clear what the effort required / benefit would be however.</p><span class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> - Introduce a standard unittesting platform - pytest + tox I guess - (on</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> top of the autotest thing, I would not attempt to redo them all) that would</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> be incorporated in the CI</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
</span><p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">No opinion on that, having not used any of those. One must keep in mind that GDAL is not a pure python project, so not sure how those tools integrate well with the custom approaches we might have.</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">One thing that is missing currently, when comparing to the C++ part, is to get coverage information of the Python code.</p><span class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> - Clean up the code: follow PEP8 and fix pylint issues. Put PEP8 and pylint</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> in the CI. Rename the hell out of the variables because I'm banging my head</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> with rx, ry, lrux and the like :)</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">> Any comments, warnings, problems you can think of?</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
</span><p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Clearer variable names are always welcome.</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Even</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"> </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">-- </p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg">Spatialys - Geospatial professional services</p>
<p style="margin:0px;text-indent:0px" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><a href="http://www.spatialys.com" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">http://www.spatialys.com</a></p></div><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div></div>______________________________<wbr>_________________<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
gdal-dev mailing list<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<a href="mailto:gdal-dev@lists.osgeo.org" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">gdal-dev@lists.osgeo.org</a><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/gdal-dev</a><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></blockquote></div><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div>
<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">______________________________<wbr>_________________<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
gdal-dev mailing list<br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<a href="mailto:gdal-dev@lists.osgeo.org" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">gdal-dev@lists.osgeo.org</a><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg">
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/gdal-dev</a><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></blockquote></div><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br clear="all" class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"></div></div></div></div></div><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="gmail_extra m_-4229881754520739235m_-1366722216468540339gmail_msg">-- <br class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><div class="m_-4229881754520739235m_-1366722216468540339m_6577167433768968283gmail_signature m_-4229881754520739235m_-1366722216468540339gmail_msg">--<div class="m_-4229881754520739235m_-1366722216468540339gmail_msg"><a href="http://schwehr.org" class="m_-4229881754520739235m_-1366722216468540339gmail_msg" target="_blank">http://schwehr.org</a></div></div>
</div></div></div></div></blockquote></div></div></div></div><span class="m_-4229881754520739235HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature">Greg</div>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-4229881754520739235gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</font></span></div>
</blockquote></div><br></div>