Ubuntu python version

Matthias Klose m at klose.in-berlin.de
Thu Feb 3 02:23:04 CST 2005


On Do, 2005-02-03 at 02:19 +0100, Vincenzo Di Massa wrote:
> Alle 19:15, mercoledì 02 febbraio 2005, Matt Zimmerman ha scritto:
> > On Wed, Feb 02, 2005 at 11:36:53AM +0100, Vincenzo Di Massa wrote:
> > > Please tell me if I understand how it works.
> > >
> > > If I want to develop a package MyPackage wihch depends on AnotherPackage
> > > and there are packagesAnotherPackage AnotherPackage1.0 AnotherPackage2.0:
> > > - if I want to depend on >=1 I just depend on AnotherPackage
> > > - if I want to dependo on <=1  I must depend on AnotherPackage1.0
> >
> > The "python2.3" package provides /usr/bin/python2.3.  If your package uses
> > #!/usr/bin/python2.3, you should depend on this package.
> >
> > The "python2.4" package provides /usr/bin/python2.4.  If your package uses
> > #!/usr/bin/python2.4, you should depend on this package.
> >
> > The "python" package provides /usr/bin/python.  If your package uses
> > #!/usr/bin/python, you should depend on this package.
> 
> Are you sure? The current python package (wich is a dependency package) does 
> not (and should not IMHO) provide /usr/bin/python.
> 
> #dpkg -L python | grep bin
> 
> /usr/bin
> /usr/bin/pydoc
> /usr/bin/pygettext
> /usr/bin/pdb

it's in python-minimal, which python depends on.

> > In all of these cases, you may use inequalities to declare a dependency on
> > particular versions of these packages.  If your package contains a
> > #!/usr/bin/python program which only works with python 2.4 or later, you
> > could use Depends: python (>= 2.4).  If your package contains a
> > #!/usr/bin/python2.3 program which only works with python 2.3.3 or later,
> > you could use Depends: python2.3 (>= 2.3.3).
> >
> > I hope this clarifies things for you.
> 
> Just one more question: what if my program does *not* work with python 2.4 
> because it requires python2.3 ?
> There are two ways:
>  1) depend on python2.3
>  2) depend on python (<=2.3) or (=2.3)
> 
> IMHO 2) is the wrong way because, to satisfy this dependency, you can't 
> upgrade python. You can install python2.4, but python (and packages requiring 
> newer versions of python) can't be installed.
> 
> If you go with 1) there should be no problem: I just need to change references 
> to /usr/bin/python to /usr/bin/python2.3.

yes, 1) is the way to go.

> > > There should be a rule preventing confusion so that packages that just
> > > want mysql or python must not depend on version number with <=, if they
> > > want to depend on something with <= they should depend on the right
> > > vesion.
> >
> > In the case of Python programs, dependencies with <= or << don't seem to
> > make much sense to me.  Matthias, can you explain the reasons why many
> > packages are made this way?

consider a package foo, depending on a package python-foo, which
contains /usr/lib/python2.3/site-packages/foo.py. either python-foo or
foo needs to have the (<< 2.4) dependency, or else foo will break. As it
looks it's sufficient if python-foo has this dependency.

if foo does contain some python modules, which are byte-compiled with
2.3, these should be recompiled for 2.4, such that the files can be
written to the disk, or else these files will be recompiled on each
invocation. That may be neglectable for small modules, but consider a
large python application called as cgi script. the python/python2.4
package could take care of recompiling the module files for such
applications, but some applications still break on upgrade. For these
cases a package maintainer has to manually check and update the package.

the current policy seems to be too strict for python programs, which are
upgradeable across python versions.

> Python programs can stop working when using a newer python version. Blender 
> for same time worked only with 2.3.

yes, other programs which broke were

- using assignments to None
- imports in nested scopes (from foo import *)

    Matthias





More information about the ubuntu-devel mailing list