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


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

Re: Python package providing both modules and an app

Path csiph.com!goblin3!goblin1!goblin2!goblin.stu.neva.ru!news.unit0.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Ben Finney <ben+debian@benfinney.id.au>
Newsgroups linux.debian.maint.python
Subject Re: Python package providing both modules and an app
Date Wed, 22 Jun 2016 03:30:01 +0200
Message-ID <rMF9n-57L-25@gated-at.bofh.it> (permalink)
References <rMBfr-2Hb-9@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Wed Jun 22 01:26:13 2016
Old-Return-Path <debian-python@m.gmane.org>
X-Amavis-Spam-Status No, score=-8.075 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, HEADER_FROM_DIFFERENT_DOMAINS=0.001, LDO_WHITELIST=-5, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-1.426, SARE_TOWRITE=1.05] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -6.1
X-Injected-Via-Gmane http://gmane.org/
Lines 43
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
Cancel-Lock sha1:Cu7+H6fXDnQfrLZQ5J5bDbMnc4A=
X-Mailing-List <debian-python@lists.debian.org> archive/latest/13940
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/8537o6xbf6.fsf@benfinney.id.au
Approved robomod@news.nic.it
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Wed, 22 Jun 2016 11:25:01 +1000
X-Original-Message-ID <8537o6xbf6.fsf@benfinney.id.au>
X-Original-References <20160621211338.GC2172@hle.local>
X-Original-X-Complaints-To usenet@ger.gmane.org
Xref csiph.com linux.debian.maint.python:8608

Show key headers only | View raw


Hugo Lefeuvre <hle@debian.org> writes:

> I'm currently packaging python-slugify[0], a Python application for
> slugifying unicode strings.

Thank you for considering the issues and asking for advice.

> Like here[1] upstream decided to write everything as a python module
> with an entry script placed in /usr/bin that calls main(). So we can
> consider python-slugify as both an application and a library.

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.

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.

> The package is originally requested as a Python module[2] and it seems 
> clear to me that the whole thing is only useful as a library

I don't understand this statement. If it is *only* useful as a library,
why install the command-line entry point?

> Everything is working well. However, I'm not really satisfied by the way I 
> solved the problem in debian/rules[4]. Does anybody know a better way 
> of doing that ?

Why not install the command by using the configuration files for
‘dh_install(1)’; that is, specify in ‘debian/slugify.install’ the files
to install.

-- 
 \         “If you can do no good, at least do no harm.” —_Slapstick_, |
  `\                                                     Kurt Vonnegut |
_o__)                                                                  |
Ben Finney

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