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

Re: Packaging python programs (with private modules) using the current Python version and binNMU:able when that changes



[Magnus Holmgren, 2011-04-25]
> (Hi, please keep me CC:d as I'm not subscribed (yet).)

done
 
> dh_python2 will, unless told otherwise, and if modules are installed in the 
> standard location, create symlinks in the module trees of all supported Python 
> versions, which is a bit pointless for modules used only by the application in 
> question. AFAIU the Python policy such private modules should not be installed 
> in the standard location though, but in a private directory. All right, I just 
> have to patch the scripts to add that directory to the search path and make 
> sure that the modules are still bytecompiled in the postinst and recompiled 
> when the default python version changes, right?

* you don't have to patch it, just install it into private directory
  and `dh_link /usr/share/yourpackage/script /usr/bin/script`
* dh_python2 will take care or byte-compilation (including rtupdate hook
  to handle change of default Python version), all you have to do is to
  follow /usr/$share_or_lib/$binary_package_name/ schema for private dir
  location or adding path to that dir to dh_python2 call in debian/rules

see also http://lists.debian.org/debian-python/2009/03/msg00091.html
(search for "Python application") or http://wiki.debian.org/Python/Packaging

> In either case, it seems that I would like to "fix" the package to the current 
> default Python version, but preferably a simple rebuild should be enough when 
> the default version changes. If the package depends on a single Python version 
> it can also depend on the corresponding pythonX.Y-foo virtual module packages, 
> which _should_ be good because how can you otherwise be sure that python-foo 
> actually provides modules for the current Python version? (For example, 
> python-zodb retracted support for Python 2.5 in Lenny, which I didn't notice).

yeah, pythonX.Y-foo/Python-Depends was a good idea but... well, it was
never used properly and since Python 2.7 is the last Python 2.X version
- we don't have to care about it anymore
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


Reply to: