On May 25, 2013, at 03:12 AM, Chris McDonough wrote:

>You probably already know this, but I'll mention it anyway.  This
>probably matters a lot for nose and pyflakes, but I'd say that for tox
>it should not, it basically just scripts execution of shell commands.
>I'd think maybe in cases like tox (and others that are compatible with
>both Python 2 and 3) the hashbang should just be set to
>"#!/usr/bin/python" unconditionally.

Unfortunately, not entirely so:

https://bitbucket.org/hpk42/tox/issue/96/cant-have-a-python-3-setuppy

>Maybe we could also think about modifying pyflakes so that it can
>validate both 2 and 3 code (choosing one or the other based on a header
>line in the validated files and defaulting to the version of Python
>being run).  This is kind of the right thing anyway.

Agreed.  Auto-detection may need to be accompanied by a command line option to
override in some cases.  But I agree, that in general, it would be very nice
if the script itself were actually bilingual.  (But then, see my previous
comment about cross-interpreter dependencies.)

>Nose is a bit of a special case.  I personally never run nosetests
>directly, I always use setup.py nosetests, which makes it not matter.

Which is morally equivalent to `$python -m nose`.

>In general, I'd like to think that scripts that get installed to global
>bindirs will execute utilities that are useful independent of the
>version of Python being used to execute them.

Agreed.  I'm trying to tease out some conventions we can recommend for when
this can't be the case for whatever reason.

-Barry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to