On Tue, 24 Mar 2020 at 09:41, Rhodri James <rho...@kynesim.co.uk> wrote:
>
> On 24/03/2020 01:13, Oleg Broytman wrote:
> > IMO the issue is in not following the best practices. Distribute wheels
> > or freezed binaries, not just drop scripts unto users.
>
> For most circumstances, that is not a practical answer.  Creating wheels
> or frozen binaries are subjects that most Python programmers know little
> about and care less about.  Expecting someone to learn how to wield the
> packaging system just to do internal distribution is unrealistic.

Agreed (and I speak as a packaging specialist!) We shouldn't be
promoting something as heavyweight as building wheels or freezing a
whole Python application just to share scripts between colleagues.

I think the advice to use shebang lines in scripts, and run those
scripts directly on Unix, and via the py launcher (or using the .py
filetype association with the launcher) is about right. It's not 100%
seamless, and it does need some level of configuration and setup on
the machines that are expected to run the scripts - and you need to
manually manage any package dependencies for yourself - but I think
it's sufficient.

On Tue, 24 Mar 2020 at 11:00, Frédéric De Jaeger
<fdejae...@novaquark.com> wrote:
> One of our constraint is that we use Cygwin's bash and now, every user relies 
> on the shebang.

Cygwin is an additional level of complexity. It attempts to provide a
"Unix-like" environment on Windows - and it does a very good job of
that! But it *isn't* Unix, and so there are differences. Expecting two
completely different operating systems to behave identically is, IMO,
a bit optimistic. You really need to be able to assume a base level of
knowledge from your users (or you have to go down the route of
bundling Python scripts into standalone "no knowledge required"
applications). To me, that base level of knowledge would be "the user
knows how to run a Python script". But I understand that this is
basically the point of your question.

Conversely, if I handed your users a Ruby script (or a Perl script, or
a Javascript program) - would they be able to run them with no
additional knowledge? I don't think the problem you have here is
unique to Python, it's equally applicable to any language with a
runtime that needs to be installed and invoked.

> The problem reduce to this.  Assuming you are in a bash window (whether on 
> cygwin or ubuntu 18, or mac os) and you do this:
>
>       > ./myScript.py
>
> How do you write the shebang so it runs reliably python3 with the minimal 
> amount of energy spent configuring the system.

If you're in a bash window on Cygwin, did you install Cygwin Python or
Windows native Python? The answer is probably different depending on
which scenario applies. And integrating Cygwin bash with native
Windows Python is always going to be a little clumsy, as you're
dealing with the differences with two environments that work very
differently.

Paul
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/HZKUJAQH7DJM5JUDZVBKH4WFJLNSAYBE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to