gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ✘python shebang, yet again


From: John Ackermann N8UR
Subject: Re: ✘python shebang, yet again
Date: Thu, 24 Sep 2020 18:33:20 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

I think I raised this problem a while ago when my machine's "native" Python was 2.7 but I was trying to build for 3. I think the proposed solution (update the shebang to match the target_python) is a good one.

John
----

On 9/24/20 6:24 PM, Gary E. Miller wrote:
Yo All!

One way to build gpsd for a python that is not the current python
is to use target_python.  So if you default Python is 2.7, and you
want to build for Python 3, do this:

scons config=force target_python=python3

But that leaves the python shebang in the gpsd python clients to be the
PEP 394 default:

     #!/usr/bin/env python

You fix that by using the pyshebang option:

scons config=force target_python=python3 python_shebang="/usr/bin/env python3"

The suggest has been made that is target_python is given, but
python_shebang is not, that the target_python be used to change the
python_shebang default.

So for:

scons config=force target_python=python3

The python shebang would be:

#!/usr/bin/env python3

And for:

scons config=force target_python=/usr/bin/python3

The python shebang would be:

#!/usr/bin/env /usr/bin/python3

Of course the user can over-ride the new defaults with python_shebang.
So to get PEP 394 default behavior back:

scons config=force target_python=python3 python_shebang="/usr/bin/env python"

Comments?  Suggestions?

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
     "If you can't measure it, you can't improve it." - Lord Kelvin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]