public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] Wrapping scripts for multiple Python implementations: executable wrapper or symlinks?
@ 2012-09-29 20:46 Michał Górny
  2012-09-30  3:42 ` Mike Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2012-09-29 20:46 UTC (permalink / raw
  To: gentoo-python

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

Hello,

Right now we have two different ways of 'wrapping' Python scripts
'converted' for various Python implementations. One of them
is the wrapper script installed by python.eclass, the other symlinking
done by python-distutils-ng.eclass.

I would like to ask you which one do you consider better, and thus
which one should I use for python-r1/distutils-r1.

A quick summary of possibilities:

1/ executable wrapper:

  A wrapper script (or executable) will be installed by a common
  package in the system. The various Python scripts will be symlinked
  to it, e.g.:

    /usr/bin/flaggie -> python-wrapper

  When run, the script will check the currently selected ABI (via
  eselect-python) and run the script using it if possible. Otherwise,
  it will try the best implementation available on the system
  and supported by the package.

Advantages:
- respects eselect-python (when possible).

Disadvantages:
- more complex,
- slows down script startup.

2/ symlink:

  When the package is installed, a symlink is created to the version
  for the preferred Python implementation. If it is not supported,
  the symlink points to the 'best' implementation supported.

    /usr/bin/flaggie -> flaggie-python2_7

Advantages:
- simple,
- resolution handled directly.

Disadvantages:
- the preferred implementation can not be changed at runtime.

3/ partially-shebanged copy of the script:

  One more copy of the script is installed, with a more general shebang
  like:

    #!/usr/bin/env python

  or:

    #!/usr/bin/env python2

Advantages:
- respects eselect-python.

Disadvantages:
- limited use (only simple version ranges),
- yet one more copy of the same script...

What do you think?

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

end of thread, other threads:[~2012-09-30  5:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-29 20:46 [gentoo-python] Wrapping scripts for multiple Python implementations: executable wrapper or symlinks? Michał Górny
2012-09-30  3:42 ` Mike Gilbert
2012-09-30  5:21   ` Ben de Groot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox