Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8613

Re: Python package providing both modules and an app

Path csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Ian Cordasco <graffatcolmingov@gmail.com>
Newsgroups linux.debian.maint.python
Subject Re: Python package providing both modules and an app
Date Thu, 23 Jun 2016 03:30:02 +0200
Message-ID <rN1CW-2Rr-11@gated-at.bofh.it> (permalink)
References <rMBfr-2Hb-9@gated-at.bofh.it> <rMF9n-57L-25@gated-at.bofh.it> <rN19U-2q7-13@gated-at.bofh.it>
X-Original-To debian-python@lists.debian.org
X-Mailbox-Line From debian-python-request@lists.debian.org Thu Jun 23 01:27:09 2016
Old-Return-Path <graffatcolmingov@gmail.com>
X-Amavis-Spam-Status No, score=-0.799 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate: -7
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=e0+e5SCsXh/QO22aCAVcurfIQhf8WUHsJdOJelkrFEU=; b=jSSdzRSbHpLX9Nhk0lwratsA+xvaC6QpyvxvurNaeeIx5jrn+k5LVcOEYJbr84MwGe bvggCfKEAcoWyvbnRMQjAFV7yTzifSbd2CyLUBfs1ruY4HEyIgf09HUUoEAjfUPrMt/k 2kKAsoz2q4WB6Zw+r81cLTjZHpHfpdJ0X18Z64K7lwOaTZHuuFfAdA6cosFx0V/X6rBS VvQEtLds1ySEE68WdlAD01YWlAhiZff1CHTffBEpIL46enPGuFh5zvKkou14PA2Nwfg0 BDsK2F9VyXxIvhooxy33kMvu/K6PVljNsEZ7tIIQZfCTfgnBSnXEjN2o+mcGlfjaNY+k S9Lg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=e0+e5SCsXh/QO22aCAVcurfIQhf8WUHsJdOJelkrFEU=; b=Bk5Vp0fovneFfVNlodGUKiPRWtuhe41Ad9RsTJ52JLEBTqHB76rsAJ/b9sH5wQtpYB NLXmqE5zzNCrMnhxrlLoc9pG2TsXelK/l4JkuYNcAtrNxQ5RmbcnDq3YIo8pKQfEo00O STXMwuK/22uTFqWJG2s6lP/0CHDz94CSSC0K5bAOOlsupFAb/ZEj8Zghw3Cw+AJSqtz2 s5mVNXSnLlMT67n9QHBj4giSVW7lt3efWdH5j94jMUxYK3rnVg8oS0ehCO5xrzhLEKAO tUDPSbfmnKPlA9QAA7Hej6/5Ot2UtFJuCaoY7LvJuc/anUwWuGyXI00Xjy/TZGe9JGhU NRDg==
X-Gm-Message-State ALyK8tIdfZYucvuqflzu7LKKpP/ZMOSD3dDpbkjtUmO1YH4oxYKkhjDDePz0D+ogf/uAVfrfJ5cf3/ho3DWrFA==
MIME-Version 1.0
X-Received by 10.237.47.1 with SMTP id l1mr41112779qtd.38.1466644140817; Wed, 22 Jun 2016 18:09:00 -0700 (PDT)
Content-Type multipart/alternative; boundary=94eb2c1252f20686570535e7b32c
X-Mailing-List <debian-python@lists.debian.org> archive/latest/13946
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/CAN-Kwu04viPuPPM+V4A5-eYXGup1Xtn0u2=VzZ8_e64akjzuRA@mail.gmail.com
Approved robomod@news.nic.it
Lines 129
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Wed, 22 Jun 2016 20:09:00 -0500
X-Original-Message-ID <CAN-Kwu04viPuPPM+V4A5-eYXGup1Xtn0u2=VzZ8_e64akjzuRA@mail.gmail.com>
X-Original-References <20160621211338.GC2172@hle.local> <8537o6xbf6.fsf@benfinney.id.au> <20160622205419.2f58379f.barry@wooz.org>
Xref csiph.com linux.debian.maint.python:8613

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Jun 22, 2016 7:54 PM, "Barry Warsaw" <barry@debian.org> wrote:
>
> On Jun 22, 2016, at 11:25 AM, Ben Finney wrote:
>
> >This seems to be more common now that command-line invocation is
> >becoming even more discouraged. When the upstream documentation
> >recommends ‘python3 -m foo.bar’ as the primary means of invoking the
> >command line functionality, that really blurs the line between
> >command-line application versus library.
>
> Indeed.  It's true that -m invocation isn't as pretty as a /usr/bin
script,
> but it does have the advantage of unambiguously choosing the Python
version
> you want to run the script with.  How important that is depends on the
> application of course.
>
> >There is a compounding tendency to disparage ‘python3 ./foo/bar.py’,
> >which is subject to weird hacks and incomplete workarounds like
> ><URL:https://www.python.org/dev/peps/pep-0366/>. I wish this trend could
> >be effectively reversed, because IMO this is a serious impediment to
> >considering Python a good choice for command-line scripting. But this is
> >all a digression, my apologies.
>
> Sorry, I don't quite understand the above.  Do you mean that you would
rather
> use `python3 ./foo/bar.py` more often and `python3 -m foo.bar` less often?
>
> In any case, thanks Hugo for choosing Python 3 as the version to use for
the
> /usr/bin script. :)

Speaking with my application developer hat on, the latter invocation
ideally helps the user be more aware of what version of Python they're
using.

This is beneficial in a couple cases:

- pip installing something: it's important for the user to know which
version of Python they're using

- running flake8 against a codebase. Flake8 relies on the version of
Python's AST for certain things. If the user is writing code with async
keywords but running Flake8 on Python 2.7, then they'll be in for a world
of unpleasantness.

By extension the same logic applies to any application that supports
multiple versions of Python but depends on things like the stdlib AST
module.

It's certainly a hideous invocation, but it has it's benefits.

Cheers,
Ian

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Python package providing both modules and an app Hugo Lefeuvre <hle@debian.org> - 2016-06-21 23:20 +0200
  Re: Python package providing both modules and an app Ben Finney <ben+debian@benfinney.id.au> - 2016-06-22 03:30 +0200
    Re: Python package providing both modules and an app Hugo Lefeuvre <hle@debian.org> - 2016-06-22 22:00 +0200
      Re: Python package providing both modules and an app Ben Finney <ben+debian@benfinney.id.au> - 2016-06-23 03:10 +0200
        Re: Python package providing both modules and an app Hugo Lefeuvre <hle@debian.org> - 2016-06-23 18:40 +0200
          Re: Python package providing both modules and an app Hugo Lefeuvre <hle@debian.org> - 2016-06-30 08:30 +0200
      Re: Python package providing both modules and an app Thomas Goirand <zigo@debian.org> - 2016-07-05 10:50 +0200
    Re: Python package providing both modules and an app Barry Warsaw <barry@debian.org> - 2016-06-23 03:00 +0200
      Python program as a command-line program (was: Python package providing both modules and an app) Ben Finney <ben+debian@benfinney.id.au> - 2016-06-23 03:20 +0200
        Re: Python program as a command-line program (was: Python package  providing both modules and an app) Barry Warsaw <barry@debian.org> - 2016-06-24 21:30 +0200
          Re: Python program as a command-line program Ben Finney <ben+debian@benfinney.id.au> - 2016-06-27 09:00 +0200
      Re: Python package providing both modules and an app Ian Cordasco <graffatcolmingov@gmail.com> - 2016-06-23 03:30 +0200
  Re: Python package providing both modules and an app Thomas Goirand <zigo@debian.org> - 2016-07-05 10:40 +0200
    Re: Python package providing both modules and an app Hugo Lefeuvre <hle@debian.org> - 2016-07-05 16:50 +0200
      Re: Python package providing both modules and an app Thomas Goirand <zigo@debian.org> - 2016-07-05 21:00 +0200

csiph-web