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