<div dir="ltr">Gregory,<div><br></div><div>Aside: A point of terminology, by hyperlink, I think you mean <a href="https://en.wikipedia.org/wiki/Symbolic_link">symbolic link</a> or hard link.<div><br></div><div>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><br></div><div><a href="https://github.com/schwehr/gdal-autotest2">https://github.com/schwehr/gdal-autotest2</a></div><div><br></div><div>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><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 3:35 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">ok, thansk for the pointers on the deployment side. I'll think about it</div><div class="gmail_extra"><br clear="all"><div><div class="gmail-m_-2343707299888456433gmail_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"><div><div class="gmail-h5">On Wed, Jan 25, 2017 at 12:19 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal"><span>
<p style="margin:0px;text-indent:0px">On mercredi 25 janvier 2017 05:48:00 CET Grégory Bataille wrote:</p>
<p style="margin:0px;text-indent:0px">> Hello,</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> 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">> clean engineering around it.</p>
<p style="margin:0px;text-indent:0px">> What I'd like to do is:</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> - split the script into several files (smaller, single purpose, ...)</p>
<p style="margin:0px;text-indent:0px">> --> can you confirm that on all target platform, all .py files are deployed</p>
<p style="margin:0px;text-indent:0px">> and the /usr/local/bin/gdal2tiles.py is just an hyperlink on the source</p>
<p style="margin:0px;text-indent:0px">> file installed somewhere else?</p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">This depends pretty much on how GDAL is packaged.</p>
<p style="margin:0px;text-indent:0px">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"> </p>
<p style="margin:0px;text-indent:0px">On OSGeo4W, they do that similarly and have a .bat that creates a .bat shortcut for each installed .py file</p><span>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> --> do you see any issue with that?</p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">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"> </p>
<p style="margin:0px;text-indent:0px">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">from osgeo import gdal_scripts</p>
<p style="margin:0px;text-indent:0px">gdal_scripts.gdal2tiles(...)</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">I'm not clear what the effort required / benefit would be however.</p><span>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> - Introduce a standard unittesting platform - pytest + tox I guess - (on</p>
<p style="margin:0px;text-indent:0px">> top of the autotest thing, I would not attempt to redo them all) that would</p>
<p style="margin:0px;text-indent:0px">> be incorporated in the CI</p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">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"> </p>
<p style="margin:0px;text-indent:0px">One thing that is missing currently, when comparing to the C++ part, is to get coverage information of the Python code.</p><span>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> - Clean up the code: follow PEP8 and fix pylint issues. Put PEP8 and pylint</p>
<p style="margin:0px;text-indent:0px">> in the CI. Rename the hell out of the variables because I'm banging my head</p>
<p style="margin:0px;text-indent:0px">> with rx, ry, lrux and the like :)</p>
<p style="margin:0px;text-indent:0px">> </p>
<p style="margin:0px;text-indent:0px">> Any comments, warnings, problems you can think of?</p>
<p style="margin:0px;text-indent:0px"> </p>
</span><p style="margin:0px;text-indent:0px">Clearer variable names are always welcome.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Even</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">-- </p>
<p style="margin:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div><br></div></div>______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/gdal-dev</a><br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div></div></div></div>