public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: grozin@gentoo.org, gentoo-python <gentoo-python@lists.gentoo.org>,
	 gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Re: [gentoo-python] Updates from Python team: python.eclass gone, gpyutils updates, incoming PYTHON_SINGLE_TARGET change
Date: Thu, 20 Apr 2017 08:47:12 +0200	[thread overview]
Message-ID: <1492670832.1654.1.camel@gentoo.org> (raw)
In-Reply-To: <alpine.LRH.2.20.1704201314340.29204@star.inp.nsk.su>

[-- Attachment #1: Type: text/plain, Size: 2262 bytes --]

On czw, 2017-04-20 at 13:28 +0700, grozin@gentoo.org wrote:
> Many thanks to the python team for good work.
> 
> In some cases a package installs some script(s) which run python 
> interpreter. I mean IDE-like packages, e.g., spyder, bpython, ptpython, 
> etc. A user may want to run either python2 or python3 using such IDE. The 
> "standard" behaviour is to install a single script which runs python2 or 
> python3 depending on eselect python. In the case of spyder, there was a 
> user who insisted that he wants to use spyder for python2 *and* python3, 
> without changing the global eselect python setting. I've changed the 
> ebuild to install 3 scripts: spyder (behaves as above), spyder2, and 
> spyder3. The same may be useful for bpython, ptpython, and, maybe, some 
> other packages. Are there plans to make this task easy and systematic, 
> without re-inventing the wheel in each ebuild?
> 

Well, your explanation seemed a little bit unclear to me, so I'd like to
clarify first. I presume you mean creating additional 'wrappers' that
start the package with a specific implementation; i.e. in spyder, you
have:

  python_newscript scripts/${PN} ${PN}${EPYTHON:6:1}

For this thing, I don't think it really beneficial to provide additional
methods. In most cases where this is really useful, upstream already
creates additional names, and the eclasses handle wrapping them just
fine.

Doing it causes a few problems: how to name them? How detailed should
they be? I.e. if it should be just spyder2 and spyder3, or maybe
spyder2.7, spyder3.4, spyder3.5... How to handle pypy/pypy3? This
usually quite sucks, and I don't want the eclass to make arbitrary
guesses about that.

That said, you could make your code pypy-safer if you did:

  local suffix
  python_is_python3 && suffix=3 || suffix=2
  python_newscript scripts/${PN} ${PN}${suffix}

Plus, the user can set EPYTHON to alter the implementation without using
eselect. Or run scripts directly from /usr/lib/python-exec/*. I should
probably add that to the python-exec doc [1]. It's possible it's already
somewhere in the docs but I can't find it ;-).

[1]:https://wiki.gentoo.org/wiki/Project:Python/python-exec

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

      reply	other threads:[~2017-04-20  6:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1492461568.12095.2.camel@gentoo.org>
2017-04-20  6:28 ` [gentoo-dev] Re: [gentoo-python] Updates from Python team: python.eclass gone, gpyutils updates, incoming PYTHON_SINGLE_TARGET change grozin
2017-04-20  6:47   ` Michał Górny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492670832.1654.1.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=grozin@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox