[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Program shebang line with specific ‘/usr/bin/pythonX.Y’ interpreter (was: Bug#635476: current packaging work for Coverage)



Dmitry Shachnev <mitya57@gmail.com> writes:

> In your particular case, python3-coverage depends on 'python3 (<<
> 3.4), python3 (>= 3.3)', so when it is installed /usr/bin/python3 will
> be always a link to python3.3, so the shebang doesn't matter here. But
> in general, I recommend people to use non-versioned shebangs in their
> packages.

For dependencies, the ‘debian/control’ has:

=====
…
Package: python-coverage
Depends:
    ${python:Depends},
…
Package: python3-coverage
Depends:
    …
    ${python3:Depends},
…
=====

The dependencies in the resulting binary packages are created by the
Debhelper tools for Python.

The shebang is created by the Distribute tools that install the program
for the ‘entry_points’ option in ‘setup.py’.

So that's why the binary package is matching the shebang line to the
Python dependency in each binary package.


This is conforming with the current Python policy §1.4.1: if the program
isn't designed to work with the default Python (currently Python 2.7),
it must specify ‘/usr/bin/pythonX.Y’ as the interpreter name.

I don't know the rationale for that dichotomy – only ‘/usr/bin/python’
or ‘/usr/bin/pythonX.Y’ – but I also don't know why you recommend
against it. What is your reason for wanting that policy changed?

-- 
 \        “Spam will be a thing of the past in two years' time.” —Bill |
  `\                                                 Gates, 2004-01-24 |
_o__)                                                                  |
Ben Finney


Reply to: