<html><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:10pt"><div><span>Yeah, I think the "right way" (i.e., cross platform) would be to use a combination of manipulating PATH and various python env vars (see ENVIRONMENT VARIABLES in man python) such as PYTHONHOME, et al for a given development environment.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal;">Normally you would have a "helper/launcher" script or something that sets/exports these into a bash/terminal/shell/commandline/etc session.</div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal;">I
have just a simple "runchirp" script that gets me going on mac:</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: 'lucida console', sans-serif; font-style: normal;">#!/bin/bash</div><div style="background-color: transparent;">CHIRP_DEBUG=True /opt/kk7ds/bin/python chirp.hg/chirpw</div><div><br></div><div><br></div> <div style="font-family: 'lucida console', sans-serif; font-size: 10pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> "chirp.cordless@xoxy.net" <chirp.cordless@xoxy.net><br> <b><span style="font-weight: bold;">To:</span></b> chirp_devel@intrepid.danplanet.com <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, April 9, 2014 11:01
PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [chirp_devel] run_tests: No module named serial<br> </font> </div> <div class="y_msg_container"><br>Tom,<br><br>I edited the shebang line to insert the path to the "correct" python<br>so I could run the tests. But I think that might be a mistake to do<br>for all users.<br><br>I'm not sure, but run_test is not a Mac-only file, is it?<br>I assume that most linux users have the "correct" Python<br>in /usr/bin/python, or else nobody is running tests?<br>Nobody develops chirp on a Mac?<br>Or those that do overwrite the Apple-supplied python?<br><br>Even on a Mac, I note that the shell script in the app looked<br>in two places for it. Can't do that on the shebang line, so it<br>would have to be wrapped in a script - but which shell works<br>on all platforms?<br><br>And I have no idea what Windows would do here.<br>Plus, I can't test it other than on a Mac. Sounds like<br>lots of trouble
created for other developers.<br><br>I don't mind doing the work, it's going to be a pain editing<br>run_tests every time, and then restoring it so hg doesn't try<br>to add it to a patch. I could probably add a mac_run_tests<br>wrapper, essentially duplicating what the script in the app does.<br><br>You're busy. This isn't urgent. Give me some direction so I'm<br>not going to break stuff for others, and I'll do it.<br><br>-dan<br><br><br>On Apr 9, 2014, at 4:48 PM, Tom Hayward - <a ymailto="mailto:esarfl@gmail.com" href="mailto:esarfl@gmail.com">esarfl@gmail.com</a> wrote:<br>> Sorry I don't have the time to focus on this right now, but here's another hint:<br>> <a href="http://stackoverflow.com/questions/2429511/why-do-people-write-usr-bin-env-python-on-the-first-line-of-a-python-script" target="_blank">http://stackoverflow.com/questions/2429511/why-do-people-write-usr-bin-env-python-on-the-first-line-of-a-python-script</a><br>> <br>>
Notice that this is *not* how Dan calls Python from run_tests. You<br>> might fix it and submit it as your first bug fix :-)<br>> <br>> Tom KD7LXL<br><br><br>_______________________________________________<br>chirp_devel mailing list<br><a ymailto="mailto:chirp_devel@intrepid.danplanet.com" href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br><a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br><br><br></div> </div> </div> </div></body></html>