public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Re: [gentoo-python] Updates from Python team: python.eclass gone, gpyutils updates, incoming PYTHON_SINGLE_TARGET change
       [not found] <1492461568.12095.2.camel@gentoo.org>
@ 2017-04-20  6:28 ` grozin
  2017-04-20  6:47   ` Michał Górny
  0 siblings, 1 reply; 2+ messages in thread
From: grozin @ 2017-04-20  6:28 UTC (permalink / raw)
  To: gentoo-python, gentoo-dev

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?

Andrey


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-dev] Re: [gentoo-python] Updates from Python team: python.eclass gone, gpyutils updates, incoming PYTHON_SINGLE_TARGET change
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2017-04-20  6:47 UTC (permalink / raw)
  To: grozin, gentoo-python, gentoo-dev

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-20  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox