Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234039 - dev-python/ctypes should be useable by all installed versions of dev-lang/python
Summary: dev-python/ctypes should be useable by all installed versions of dev-lang/python
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-05 23:31 UTC by Garrett Cooper
Modified: 2008-08-08 19:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Garrett Cooper 2008-08-05 23:31:46 UTC
In order to properly develop for my work environment I need access to Python 2.4.x as well as 2.5.

I'm using ctypes for improved visibility into C libs and apps. Ctypes was included in the main python distro as of 2.5.x.

However, when I install ctypes, it installs it in the site-python area (!). Why doesn't it expand it to all python versions' site-packages locations?

Reproducible: Always

Steps to Reproduce:
emerge ctypes
Actual Results:  
>>> /usr/lib/python2.5/site-packages/ctypes/macholib/
>>> /usr/lib/python2.5/site-packages/ctypes/macholib/dyld.py
>>> /usr/lib/python2.5/site-packages/ctypes/macholib/framework.py
>>> /usr/lib/python2.5/site-packages/ctypes/macholib/dylib.py
>>> /usr/lib/python2.5/site-packages/ctypes/macholib/__init__.py
>>> /usr/lib/python2.5/site-packages/ctypes/_endian.py
>>> /usr/lib/python2.5/site-packages/ctypes/wintypes.py
>>> /usr/lib/python2.5/site-packages/ctypes/util.py
>>> /usr/lib/python2.5/site-packages/ctypes/__init__.py
>>> /usr/lib/python2.5/site-packages/ctypes-1.0.1-py2.5.egg-info
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/ctypes-1.0.1-r1/
>>> /usr/share/doc/ctypes-1.0.1-r1/README.CVS.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/ACKS.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/PKG-INFO.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/README.txt.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/ANNOUNCE.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/MANIFEST.in.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/MANIFEST.bz2
>>> /usr/share/doc/ctypes-1.0.1-r1/ChangeLog.bz2
 * Byte compiling python modules for python-2.5 .. ...                    [ ok ]
>>> dev-python/ctypes-1.0.1-r1 merged.

Expected Results:  
Installed a copy of ctypes into the site-packages dir for 2.4.x, and possibly not for 2.5.

headless-horseman gcooper # emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-3.4.6, glibc-2.6.1-r0, 2.6.23.17 i686)
=================================================================
System uname: 2.6.23.17 i686 Intel(R) Xeon(R) CPU 5140 @ 2.33GHz
Timestamp of tree: Tue, 05 Aug 2008 00:35:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r14, 2.5.2-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X berkdb cli cracklib crypt divx dri gdbm gtk java kqemu multitarget ncurses nls nptl nptlonly nsplugin nvidia oss pam pcre perl python quicktime readline session ssl unicode x86 xforms xorg zlib" ALSA_CARDS="hda-intel intel8x0 intel8x0m" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm dummy nv nvidia vesa vga"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Garrett Cooper 2008-08-05 23:33:35 UTC
I filed this under Eclasses and profiles because I think the issue is in the fact that there isn't really a profiling system setup for python yet, and this should be addressed.

The site-packages vs dist included copy of ctypes is another issue..
Comment 2 Rob Cakebread (RETIRED) gentoo-dev 2008-08-08 19:03:15 UTC
> However, when I install ctypes, it installs it in the site-python area (!). 
> Why  doesn't it expand it to all python versions' site-packages locations?

There are many reasons, a few being:

1) There is no way to tell portage which versions of Python the user wants a pacakge installed for. This isn't limited to Python (or just portage, see pkgcore, paludis etc.). Nor a way to just un-merge a particular version.

2) We'd have to patch every Python package that has duplicate files. For example if a package has /usr/bin/a /usr/bin/b and /usr/bin/c we'd have to install at least 9 versions if you have 3 versions of Python, with unique names for them (/usr/bin/a-2.4, /usr/bin/a-2.5 etc.)

3) Most users don't need this feature, it's something only developers would use and it's nearly impossible to implement without changing the package manager

I assume you only want to do this for packages you do development work on, so you have a couple of choices:

1) Check out dev-python/virtualenv, it gives you isolated Python environments and uses easy_install to manage the packages. I use this, it's awesome.

2) When we had to have packages installed for more than one version of Python we had to use special names[1] for the packages (pkgfoo-py21-1.0.ebuild). This was for Zope when it only worked with older versions of python. Currently we have no packages using that scheme in the tree but you can certainly do this in your overlay yourself by adding -py24 suffix.

[1] http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/psycopg-py21/psycopg-py21-1.1.2.ebuild?hideattic=0&view=markup

If I'm missing something that is specific to ctypes, please re-open and explain.