Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 509968

Summary: emerge doesn't call python_prepare
Product: Gentoo Linux Reporter: Helmut Jarausch <jarausch>
Component: EclassesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Helmut Jarausch 2014-05-10 13:48:09 UTC
I'm using sys-apps/portage-9999 (from 2014/05/09)

I have two ebuilds, the first of which calls python_prepare the second one
doesn't call it (checked by inserting a die command)
The only difference I see is that the first one inherits git-2 while the
second one inherits subversion.


This one works:

EAPI="5"
PYTHON_COMPAT=(python{2_7,3_3})
inherit distutils-r1 python-r1 git-2

DESCRIPTION="NodePy (Numerical ODEs in Python) is a Python package for designing, analyzing, and testing numerical methods for initial value ODEs"
HOMEPAGE="http://numerics.kaust.edu.sa/nodepy"
EGIT_REPO_URI="https://github.com/ketch/nodepy.git"
SRC_URI=""

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
python_prepare() {
	sed -i -e's/\t/        /g' **/*.py
	if python_is_python3; then
		2to3  -nw --no-diffs **/*.py || die
	fi
}



--------------------------

The next one doesn't call python_prepare and I have no idea why.
EAPI="5"

PYTHON_COMPAT=( python{2_7,3_3,3_4} )
inherit distutils-r1 python-r1 subversion

DESCRIPTION="pysftp is an easy to use sftp module that utilizes paramiko and pycrypto"
HOMEPAGE="https://code.google.com/p/pysftp"
ESVN_REPO_URI="http://pysftp.googlecode.com/svn/trunk"
SRC_URI=""

LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND="dev-python/pycrypto
	dev-python/paramiko"
DEPEND=${RDEPEND}

python_prepare() {
	sed -i -e's/\t/        /g' **/*.py
	if python_is_python3; then
		2to3  -nw --no-diffs **/*.py || die
	fi
}
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-10 14:33:49 UTC
Because both distutis-r1.eclass and subversion.eclass define src_prepare().
Comment 2 Helmut Jarausch 2014-05-10 16:02:10 UTC
(In reply to Jeroen Roovers from comment #1)
> Because both distutis-r1.eclass and subversion.eclass define src_prepare().

Thanks,

indeed, changing the order of inherits makes it work
inherit subversion distutils-r1 python-r1

Something like a re-definition warning wouldn't be bad.
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-21 14:54:50 UTC
(In reply to Helmut Jarausch from comment #2)
> Something like a re-definition warning wouldn't be bad.

If you have an idea how to do this, it's always welcome; I'm not sure if Bash provides a way to detect this, or whether Portage is able to do magic here...