public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Peter Volkov <pva@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Versioning of Python scripts
Date: Tue, 22 Dec 2009 12:04:49 +0300	[thread overview]
Message-ID: <1261472689.4326.25.camel@tablet> (raw)
In-Reply-To: <200912191624.55244.Arfrever@gentoo.org>

В Сбт, 19/12/2009 в 16:24 +0100, Arfrever Frehtes Taifersar Arahesis
пишет:
>   - Scripts of packages supporting only e.g. Python 2 can be executed (without necessity
>     of using of e.g. "python2 /usr/bin/${script}") after activating of e.g. Python 3.
>   - Scripts of packages supporting multiple Python versions ignore active Python version.

> The best solution, which removes these 2 disadvantages and preserves the advantage, seems
> to be to rename Python scripts to include Python version [1] in filenames, and create wrapper
> scripts, which call appropriate target scripts [2].

But still additional wrapper scripts and increased number of scripts in
total is not really nice. What do you think about another solution:

Separate possible script's python API versions into database, e.g.
in /var/db/pyabi/${CATEGORY}/${PN}-${SLOT}. Create python wrapper only
for unmerged but still in use (found from pyabi db) python versions,
e.g. /usr/bin/python3.2 in case you've unmerged python, but scripts
still reference python3.2.

This way scripts that use python versions that are still in the tree
will work without any overhead, fewer scripts in /{usr,}bin and during
python merge/unmerge it is possible to warn user about scripts that use
unmerged python versions (and thus run with some overhead). I guess
still we can add some user defined variable to prefer some python
versions over another...

>   - Scripts of packages supporting multiple Python versions cannot be easily (without
>     necessity of using of e.g. "python3.1 /usr/bin/${script}") executed with a Python
>     version different than active Python version.

If you develop on python then... write your own wrappers or
use /usr/bin/python and that's it! In case you are not I'm not sure why
such switching is useful. Could you elaborate?

-- 
Peter.




      parent reply	other threads:[~2009-12-22  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-19 15:24 [gentoo-dev] Versioning of Python scripts Arfrever Frehtes Taifersar Arahesis
2009-12-21 10:50 ` Brian Harring
2009-12-23  0:50   ` Arfrever Frehtes Taifersar Arahesis
2009-12-22  9:04 ` Peter Volkov [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=1261472689.4326.25.camel@tablet \
    --to=pva@gentoo.org \
    --cc=gentoo-dev@lists.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