* [gentoo-python] New eclass for Python
@ 2012-02-28 21:13 Krzysztof Pawlik
2012-02-29 5:13 ` Mike Gilbert
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Krzysztof Pawlik @ 2012-02-28 21:13 UTC (permalink / raw
Cc: Gentoo Dev, gentoo-python
[-- Attachment #1.1: Type: text/plain, Size: 1403 bytes --]
Hello,
After some work during weekend on Python packages I've decided to start a
rewrite of Python/distutils eclass for installing Python packages. My main goal
was simplicity and functionality similar to ruby-ng.eclass (thanks Ruby team for
your great work!). Python team members already contributed comments and
suggestions and helped me to make the eclass better, thank you!
Highlights:
- *SIMPLE*next
- uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
- EAPI4 required, uses REQUIRED_USE
- <400 lines of code including documentation
- should work for >95% of packages (my educated guess)
- did I mention it's *SIMPLE*?
- easy to maintain & read so it's also easy to use
Important thing: I'm not aiming at having 100% functionality of current
python.eclass+distutils.eclass in the new one, I think that simplicity is more
important that supporting every possible, obscure case that's out there.
I'm attaching the eclass itself and two ebuilds using it, code is also available
in my overlay at http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=summary
If there are no objections then during the weekend (March 3, 4) I will add this
to portage (after finishing remaining TODO items, PyPy requires 4G of RAM(!!)).
--
Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...
[-- Attachment #1.2: xlwt-0.7.2-r256.ebuild --]
[-- Type: text/plain, Size: 735 bytes --]
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="4"
inherit python-distutils-ng
DESCRIPTION="Python library to create spreadsheet files compatible with Excel"
HOMEPAGE="http://pypi.python.org/pypi/xlwt"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc-aix ~hppa-hpux ~ia64-hpux ~x86-interix ~x86-linux ~sparc-solaris ~x86-solaris"
IUSE="examples"
DEPEND=""
RDEPEND=""
python_prepare_all() {
sed -i \
-e "s,'doc,# 'doc,g" \
-e "s,'exa,# 'exa,g" \
setup.py || die
}
python_install_all() {
dohtml xlwt/doc/*.html
if use examples; then
insinto "/usr/share/doc/${PF}"
doins -r xlwt/examples
fi
}
[-- Attachment #1.3: xlrd-0.7.1-r256.ebuild --]
[-- Type: text/plain, Size: 838 bytes --]
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="4"
inherit python-distutils-ng
DESCRIPTION="Library for developers to extract data from Microsoft Excel (tm) spreadsheet files"
HOMEPAGE="http://pypi.python.org/pypi/xlrd"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc-aix ~hppa-hpux ~ia64-hpux ~x86-interix ~x86-linux ~sparc-solaris ~x86-solaris"
IUSE="examples"
DEPEND=""
RDEPEND=""
python_prepare_all() {
sed -i \
-e "s,'doc,# 'doc,g" \
-e "s,'exa,# 'exa,g" \
setup.py || die
}
python_install_all() {
rm -f "${D}/usr/bin"/*.py || die
python-distutils-ng_doscript scripts/runxlrd.py
dohtml xlrd/doc/*.html
if use examples; then
insinto "/usr/share/doc/${PF}"
doins -r xlrd/examples
fi
}
[-- Attachment #1.4: python_targets.desc --]
[-- Type: text/plain, Size: 455 bytes --]
# Copyright 2009-2012 Gentoo Foundation.
# Distributed under the terms of the GNU General Public License v2
# $Header$
# This file contains descriptions of PYTHON_TARGETS USE_EXPAND flags.
python2_5 - Build with Python 2.5
python2_6 - Build with Python 2.6
python2_7 - Build with Python 2.7
python3_1 - Build with Python 3.1
python3_2 - Build with Python 3.2
jython2_5 - Build with Jython 2.5
pypy1_7 - Build with PyPy 1.7
pypy1_8 - Build with PyPy 1.8
[-- Attachment #1.5: python-distutils-ng.eclass --]
[-- Type: text/plain, Size: 11741 bytes --]
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
# @ECLASS: python-distutils-ng
# @MAINTAINER:
# Python herd <python@gentoo.org>
# @AUTHOR:
# Author: Krzysztof Pawlik <nelchael@gentoo.org>
# @BLURB: An eclass for installing Python packages using distutils with proper
# support for multiple Python slots.
# @DESCRIPTION:
# The Python eclass is designed to allow an easier installation of Python
# packages and their incorporation into the Gentoo Linux system.
#
# TODO: Document implementations!
# @ECLASS-VARIABLE: PYTHON_COMPAT
# @DESCRIPTION:
# This variable contains a space separated list of implementations (see above) a
# package is compatible to. It must be set before the `inherit' call. The
# default is to enable all implementations.
if [[ -z "${PYTHON_COMPAT}" ]]; then
# Default: pure python, support all implementations
PYTHON_COMPAT=" python2_5 python2_6 python2_7"
PYTHON_COMPAT+=" python3_1 python3_2"
PYTHON_COMPAT+=" jython2_5"
PYTHON_COMPAT+=" pypy1_7 pypy1_8"
fi
# @ECLASS-VARIABLE: PYTHON_OPTIONAL
# @DESCRIPTION:
# Set the value to "yes" to make the dependency on a Python interpreter
# optional.
# @ECLASS-VARIABLE: PYTHON_DISABLE_COMPILATION
# @DESCRIPTION:
# Set the value to "yes" to skip compilation and/or optimization of Python
# modules.
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install
case "${EAPI}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI} (too old) for python-distutils-ng.eclass" ;;
4)
# EAPI=4 needed for REQUIRED_USE
S="${S:-${WORKDIR}/${P}}"
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for python-distutils-ng.eclass" ;;
esac
# @FUNCTION: _python-distutils-ng_generate_depend
# @USAGE: implementation
# @RETURN: Package atom of a Python implementation for *DEPEND.
# @DESCRIPTION:
# This function returns the full package atom of a Python implementation.
#
# `implementation' has to be one of the valid values for PYTHON_COMPAT.
_python-distutils-ng_generate_depend() {
local impl="${1/_/.}"
case "${impl}" in
python?.?)
echo "dev-lang/${impl::-3}:${impl: -3}" ;;
jython?.?)
echo "dev-java/${impl::-3}:${impl: -3}" ;;
pypy?.?)
echo "dev-python/${impl::-3}:${impl: -3}" ;;
*)
die "Unsupported implementation: ${1}" ;;
esac
}
# @FUNCTION: _python-distutils-ng_get_binary_for_implementation
# @USAGE: implementation
# @RETURN: Full path to Python binary for given implementation.
# @DESCRIPTION:
# This function returns full path for Python binary for given implementation.
#
# Binary returned by this function should be used instead of simply calling
# `python'.
_python-distutils-ng_get_binary_for_implementation() {
local impl="${1/_/.}"
case "${impl}" in
python?.?|jython?.?)
echo "/usr/bin/${impl}" ;;
pypy?.?)
echo "TODO" ;;
*)
die "Unsupported implementation: ${1}" ;;
esac
}
required_use_str=" || (
python_targets_python2_5 python_targets_python2_6 python_targets_python2_7
python_targets_python3_1 python_targets_python3_2
python_targets_jython2_5
python_targets_pypy1_7 python_targets_pypy1_8 )"
if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
IUSE+="python"
REQUIRED_USE+=" python? ( ${required_use_str} )"
else
REQUIRED_USE+="${required_use_str}"
fi
for impl in ${PYTHON_COMPAT}; do
IUSE+=" python_targets_${impl} "
local dep_str="python_targets_${impl}? ( $(_python-distutils-ng_generate_depend "${impl}") )"
if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
RDEPEND="${RDEPEND} python? ( ${dep_str} )"
DEPEND="${DEPEND} python? ( ${dep_str} )"
else
RDEPEND="${RDEPEND} ${dep_str}"
DEPEND="${DEPEND} ${dep_str}"
fi
done
PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
# @FUNCTION: _python-distutils-ng_run_for_impl
# @USAGE: implementation command_to_run
# @DESCRIPTION:
# Run command_to_run using specified Python implementation.
#
# This will run the command_to_run in implementation-specific working directory.
_python-distutils-ng_run_for_impl() {
local impl="${1}"
local command="${2}"
S="${WORKDIR}/impl_${impl}/${PACKAGE_SPECIFIC_S}"
PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
einfo "Running ${command} in ${S} for ${impl}"
pushd "${S}" &> /dev/null
"${command}" "${impl}" "${PYTHON}"
popd &> /dev/null
}
# @FUNCTION: _python-distutils-ng_run_for_all_impls
# @USAGE: command_to_run
# @DESCRIPTION:
# Run command_to_run for all enabled Python implementations.
#
# See also _python-distutils-ng_run_for_impl
_python-distutils-ng_run_for_all_impls() {
local command="${1}"
for impl in ${PYTHON_COMPAT}; do
use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
_python-distutils-ng_run_for_impl "${impl}" "${command}"
done
}
# @FUNCTION: _python-distutils-ng_default_distutils_compile
# @DESCRIPTION:
# Default src_compile for distutils-based packages.
_python-distutils-ng_default_distutils_compile() {
"${PYTHON}" setup.py build || die
}
# @FUNCTION: _python-distutils-ng_default_distutils_install
# @DESCRIPTION:
# Default src_install for distutils-based packages.
_python-distutils-ng_default_distutils_install() {
"${PYTHON}" setup.py install --no-compile --root="${D}/" || die
}
# @FUNCTION: _python-distutils-ng_has_compileall
# @USAGE: implementation
# @RETURN: 0 if given implementation has compileall module
# @DESCRIPTION:
# This function is used to decide whenever to compile Python modules for given
# implementation.
_python-distutils-ng_has_compileall() {
case "${1}" in
python?_?|jython?_?)
return 0 ;;
*)
return 1 ;;
esac
}
# @FUNCTION: _python-distutils-ng_has_compileall_opt
# @USAGE: implementation
# @RETURN: 0 if given implementation has compileall module and supports # optimizations
# @DESCRIPTION:
# This function is used to decide whenever to compile and optimize Python
# modules for given implementation.
_python-distutils-ng_has_compileall_opt() {
case "${1}" in
python?_?)
return 0 ;;
*)
return 1 ;;
esac
}
# @FUNCTION: python-distutils-ng_doscript
# @USAGE: script_file_name
# @DESCRIPTION:
# Install given script file in /usr/bin/ for all enabled implementations using
# original script name as a base name.
#
# See also python-distutils-ng_newscript
python-distutils-ng_doscript() {
python-distutils-ng_newscript "${1}" "$(basename "${1}")"
}
# @FUNCTION: python-distutils-ng_newscript
# @USAGE: script_file_name new_file_name
# @DESCRIPTION:
# Install given script file in /usr/bin/ for all enabled implementations using
# new_file_name as a base name.
#
# Each script copy will have the name mangled to "new_file_name-IMPLEMENTATION"
# and new hash-bang line will be inserted to reference specific Python
# interpreter.
#
# There will be also a symlink with name equal to new_file_name that will be a
# symlink to default implementation, which defaults to value of
# PYTHON_DEFAULT_IMPLEMENTATION, if not specified the function will pick default
# implementation: it will the be first enabled from the following list:
# python2_7, python2_6, python2_5, python3_2, python3_1, pypy1_8, pypy1_7, jython2_5
python-distutils-ng_newscript() {
[[ -n "${1}" ]] || die "Missing source file name"
[[ -n "${2}" ]] || die "Missing destination file name"
local source_file="${1}"
local destination_file="${2}"
local default_impl="${PYTHON_DEFAULT_IMPLEMENTATION}"
if [[ -z "${default_impl}" ]]; then
# TODO: Pick default implementation
for impl in python{2_7,2_6,2_5,3_2,2_1} pypy{1_8,1_7} jython2_5; do
use "python_targets_${impl}" || continue
default_impl="${impl}"
break;
done
else
use "python_targets_${impl}" || \
die "default implementation ${default_impl} not enabled"
fi
[[ -n "${default_impl}" ]] || die "Could not select default implementation"
einfo "Installing ${source_file} for multiple implementations (default: ${default_impl})"
insinto /usr/bin
for impl in ${PYTHON_COMPAT}; do
use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
newins "${source_file}" "${destination_file}-${impl}"
fperms 755 "/usr/bin/${destination_file}-${impl}"
sed -i \
-e "1i#!$(_python-distutils-ng_get_binary_for_implementation "${impl}")" \
"${D}/usr/bin/${destination_file}-${impl}" || die
done
dosym "${destination_file}-${default_impl}" "/usr/bin/${destination_file}"
}
# Phase function: src_unpack
python-distutils-ng_src_unpack() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
if type python_unpack &> /dev/null; then
# This should not run anything specific to any single Python
# implementation, keep it generic:
python_unpack_all
else
[[ -n ${A} ]] && unpack ${A}
fi
}
# Phase function: src_prepare
python-distutils-ng_src_prepare() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
# Try to run binary for each implementation:
for impl in ${PYTHON_COMPAT}; do
use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
$(_python-distutils-ng_get_binary_for_implementation "${impl}") \
-c "import sys" || die
done
# Run prepare shared by all implementations:
if type python_prepare_all &> /dev/null; then
einfo "Running python_prepare_all in ${S} for all"
python_prepare_all
fi
# Create a copy of S for each implementation:
for impl in ${PYTHON_COMPAT}; do
use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
einfo "Creating copy for ${impl} in ${WORKDIR}/impl_${impl}"
mkdir -p "${WORKDIR}/impl_${impl}" || die
cp -pr "${S}" "${WORKDIR}/impl_${impl}/${PACKAGE_SPECIFIC_S}" || die
done
# Run python_prepare for each implementation:
if type python_prepare &> /dev/null; then
_python-distutils-ng_run_for_all_impls python_prepare
fi
}
# Phase function: src_configure
python-distutils-ng_src_configure() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
if type python_configure &> /dev/null; then
_python-distutils-ng_run_for_all_impls python_configure
fi
}
# Phase function: src_compile
python-distutils-ng_src_compile() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
if type python_compile &> /dev/null; then
_python-distutils-ng_run_for_all_impls python_compile
else
_python-distutils-ng_run_for_all_impls \
_python-distutils-ng_default_distutils_compile
fi
}
# Phase function: src_test
python-distutils-ng_src_test() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
if type python_test &> /dev/null; then
_python-distutils-ng_run_for_all_impls python_test
fi
}
# Phase function: src_install
python-distutils-ng_src_install() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
if type python_install &> /dev/null; then
_python-distutils-ng_run_for_all_impls python_install
else
_python-distutils-ng_run_for_all_impls \
_python-distutils-ng_default_distutils_install
fi
S="${WORKDIR}/${PACKAGE_SPECIFIC_S}"
if type python_install_all &> /dev/null; then
einfo "Running python_install_all in ${S} for all"
python_install_all
fi
for impl in ${PYTHON_COMPAT}; do
[[ "${PYTHON_DISABLE_COMPILATION}" = "yes" ]] && continue
use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
for accessible_path in $(${PYTHON} -c 'import sys; print " ".join(sys.path)'); do
[[ -d "${D}/${accessible_path}" ]] || continue
_python-distutils-ng_has_compileall "${impl}" || continue
ebegin "Compiling ${accessible_path} for ${impl}"
${PYTHON} \
-m compileall -q -f "${D}/${accessible_path}" || die
eend $?
_python-distutils-ng_has_compileall_opt "${impl}" || continue
ebegin "Optimizing ${accessible_path} for ${impl}"
PYTHONOPTIMIZE=1 ${PYTHON} \
-m compileall -q -f "${D}/${accessible_path}" || die
eend $?
done;
done
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-02-28 21:13 [gentoo-python] New eclass for Python Krzysztof Pawlik
@ 2012-02-29 5:13 ` Mike Gilbert
2012-02-29 8:11 ` Dirkjan Ochtman
` (3 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Mike Gilbert @ 2012-02-29 5:13 UTC (permalink / raw
To: Gentoo Dev, gentoo-python
On Tue, Feb 28, 2012 at 4:13 PM, Krzysztof Pawlik <nelchael@gentoo.org> wrote:
> Hello,
>
> After some work during weekend on Python packages I've decided to start a
> rewrite of Python/distutils eclass for installing Python packages. My main goal
> was simplicity and functionality similar to ruby-ng.eclass (thanks Ruby team for
> your great work!). Python team members already contributed comments and
> suggestions and helped me to make the eclass better, thank you!
>
> Highlights:
> - *SIMPLE*next
> - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
> - EAPI4 required, uses REQUIRED_USE
> - <400 lines of code including documentation
> - should work for >95% of packages (my educated guess)
> - did I mention it's *SIMPLE*?
> - easy to maintain & read so it's also easy to use
>
> Important thing: I'm not aiming at having 100% functionality of current
> python.eclass+distutils.eclass in the new one, I think that simplicity is more
> important that supporting every possible, obscure case that's out there.
>
> I'm attaching the eclass itself and two ebuilds using it, code is also available
> in my overlay at http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=summary
>
> If there are no objections then during the weekend (March 3, 4) I will add this
> to portage (after finishing remaining TODO items, PyPy requires 4G of RAM(!!)).
>
> --
> Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
> desktop-misc, java, vim, kernel, python, apache...
>
# Phase function: src_unpack
python-distutils-ng_src_unpack() {
[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
if type python_unpack &> /dev/null; then
# This should not run anything specific to any single Python
# implementation, keep it generic:
python_unpack_all
else
[[ -n ${A} ]] && unpack ${A}
fi
}
I think you meant to write "if type python_unpack_all".
More to the point, I don't actually understand why this function
exists. It doesn't actually do anything that default_src_unpack does
not do already. Exporting it will clobber any vcs eclasses if the
inherit order is wrong.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-02-28 21:13 [gentoo-python] New eclass for Python Krzysztof Pawlik
2012-02-29 5:13 ` Mike Gilbert
@ 2012-02-29 8:11 ` Dirkjan Ochtman
2012-03-03 7:59 ` Arfrever Frehtes Taifersar Arahesis
` (2 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Dirkjan Ochtman @ 2012-02-29 8:11 UTC (permalink / raw
To: Krzysztof Pawlik; +Cc: Gentoo Dev, gentoo-python
On Tue, Feb 28, 2012 at 22:13, Krzysztof Pawlik <nelchael@gentoo.org> wrote:
> If there are no objections then during the weekend (March 3, 4) I will add this
> to portage (after finishing remaining TODO items, PyPy requires 4G of RAM(!!)).
Can we perhaps just name it python-r2 rather than python-distutils-ng?
Seems descriptive enough...
Cheers,
Dirkjan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-02-28 21:13 [gentoo-python] New eclass for Python Krzysztof Pawlik
2012-02-29 5:13 ` Mike Gilbert
2012-02-29 8:11 ` Dirkjan Ochtman
@ 2012-03-03 7:59 ` Arfrever Frehtes Taifersar Arahesis
2012-03-25 18:56 ` [gentoo-python] Re: [gentoo-dev] " Krzysztof Pawlik
2012-05-12 9:19 ` [gentoo-python] " Nikolaj Sjujskij
4 siblings, 0 replies; 14+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-03-03 7:59 UTC (permalink / raw
To: Gentoo Development, Gentoo Python Development
[-- Attachment #1: Type: Text/Plain, Size: 241 bytes --]
2012-02-28 22:13:36 Krzysztof Pawlik napisał(a):
> - uses PYTHON_TARGETS use-expand
You cannot painlessly use USE flags for this purpose in gentoo-x86 without support for use.unsatisfiable.
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [gentoo-python] Re: [gentoo-dev] New eclass for Python
2012-02-28 21:13 [gentoo-python] New eclass for Python Krzysztof Pawlik
` (2 preceding siblings ...)
2012-03-03 7:59 ` Arfrever Frehtes Taifersar Arahesis
@ 2012-03-25 18:56 ` Krzysztof Pawlik
2012-05-12 9:19 ` [gentoo-python] " Nikolaj Sjujskij
4 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Pawlik @ 2012-03-25 18:56 UTC (permalink / raw
To: gentoo-dev; +Cc: gentoo-python
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
On 28/02/12 22:13, Krzysztof Pawlik wrote:
> If there are no objections then during the weekend (March 3, 4) I will add this
> to portage (after finishing remaining TODO items, PyPy requires 4G of RAM(!!)).
Hello,
Slightly late due to Real Life™ but finally it's in the main tree :)
(and yes - I've tested it with pypy - works as expected :)
--
Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-02-28 21:13 [gentoo-python] New eclass for Python Krzysztof Pawlik
` (3 preceding siblings ...)
2012-03-25 18:56 ` [gentoo-python] Re: [gentoo-dev] " Krzysztof Pawlik
@ 2012-05-12 9:19 ` Nikolaj Sjujskij
2012-05-12 10:04 ` Krzysztof Pawlik
4 siblings, 1 reply; 14+ messages in thread
From: Nikolaj Sjujskij @ 2012-05-12 9:19 UTC (permalink / raw
To: gentoo-python; +Cc: Krzysztof Pawlik
Den 2012-02-29 01:13:36 skrev Krzysztof Pawlik <nelchael@gentoo.org>:
> Hello,
>
> After some work during weekend on Python packages I've decided to start a
> rewrite of Python/distutils eclass for installing Python packages.
> ...
> Highlights:
> ...
> - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
Hm... Does it require users to maintain correct PYTHON_TARGETS in
make.conf? No default/fallback value? app-admin/eclean-kernel has just
switched to new eclass and...
!!! The ebuild selected to satisfy "app-admin/eclean-kernel" has unmet
requirements.
- app-admin/eclean-kernel-0.3::gentoo USE="(multilib)"
PYTHON_TARGETS="-python2_6 -python2_7"
The following REQUIRED_USE flag constraints are unsatisfied:
any-of ( python_targets_python2_6 python_targets_python2_7 )
It's not big deal, of course, but kind of annoying after so many years of
automatic "build for current Python version unless USE_PYTHON is set".
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-12 9:19 ` [gentoo-python] " Nikolaj Sjujskij
@ 2012-05-12 10:04 ` Krzysztof Pawlik
2012-05-12 17:20 ` Michał Górny
2012-05-13 6:55 ` Nikolaj Sjujskij
0 siblings, 2 replies; 14+ messages in thread
From: Krzysztof Pawlik @ 2012-05-12 10:04 UTC (permalink / raw
To: Nikolaj Sjujskij; +Cc: gentoo-python
[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]
On 12/05/12 11:19, Nikolaj Sjujskij wrote:
> Den 2012-02-29 01:13:36 skrev Krzysztof Pawlik <nelchael@gentoo.org>:
>
>> Hello,
>>
>> After some work during weekend on Python packages I've decided to start a
>> rewrite of Python/distutils eclass for installing Python packages.
>> ...
>> Highlights:
>> ...
>> - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
> Hm... Does it require users to maintain correct PYTHON_TARGETS in make.conf? No
> default/fallback value?
No, I'm a *HUGE* fan of free choice -- I don't know which Python version you
want, so select the correct one yourself. It's a one-time choice anyway.
> app-admin/eclean-kernel has just switched to new eclass
> and...
>
> !!! The ebuild selected to satisfy "app-admin/eclean-kernel" has unmet
> requirements.
> - app-admin/eclean-kernel-0.3::gentoo USE="(multilib)"
> PYTHON_TARGETS="-python2_6 -python2_7"
>
> The following REQUIRED_USE flag constraints are unsatisfied:
> any-of ( python_targets_python2_6 python_targets_python2_7 )
>
> It's not big deal, of course, but kind of annoying after so many years of
> automatic "build for current Python version unless USE_PYTHON is set".
To me it's an advantage :)
--
Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-12 10:04 ` Krzysztof Pawlik
@ 2012-05-12 17:20 ` Michał Górny
2012-05-12 20:32 ` Mike Gilbert
2012-05-13 6:55 ` Nikolaj Sjujskij
1 sibling, 1 reply; 14+ messages in thread
From: Michał Górny @ 2012-05-12 17:20 UTC (permalink / raw
To: Krzysztof Pawlik; +Cc: Nikolaj Sjujskij, gentoo-python
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
On Sat, 12 May 2012 12:04:36 +0200
Krzysztof Pawlik <nelchael@gentoo.org> wrote:
> On 12/05/12 11:19, Nikolaj Sjujskij wrote:
> > Den 2012-02-29 01:13:36 skrev Krzysztof Pawlik
> > <nelchael@gentoo.org>:
> >
> >> Hello,
> >>
> >> After some work during weekend on Python packages I've decided to
> >> start a rewrite of Python/distutils eclass for installing Python
> >> packages. ...
> >> Highlights:
> >> ...
> >> - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
> > Hm... Does it require users to maintain correct PYTHON_TARGETS in
> > make.conf? No default/fallback value?
>
> No, I'm a *HUGE* fan of free choice -- I don't know which Python
> version you want, so select the correct one yourself. It's a one-time
> choice anyway.
It's not a one-time choice. It's rather a new choice every time a new
major version is introduced, and all users who don't care have to
update the var to keep it up-to-date. Not that I care much, just
pointing out.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-12 17:20 ` Michał Górny
@ 2012-05-12 20:32 ` Mike Gilbert
2012-05-13 19:57 ` Dirkjan Ochtman
0 siblings, 1 reply; 14+ messages in thread
From: Mike Gilbert @ 2012-05-12 20:32 UTC (permalink / raw
To: gentoo-python
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
On 05/12/2012 01:20 PM, Michał Górny wrote:
> On Sat, 12 May 2012 12:04:36 +0200
> Krzysztof Pawlik <nelchael@gentoo.org> wrote:
>
>> On 12/05/12 11:19, Nikolaj Sjujskij wrote:
>>> Den 2012-02-29 01:13:36 skrev Krzysztof Pawlik
>>> <nelchael@gentoo.org>:
>>>
>>>> Hello,
>>>>
>>>> After some work during weekend on Python packages I've decided to
>>>> start a rewrite of Python/distutils eclass for installing Python
>>>> packages. ...
>>>> Highlights:
>>>> ...
>>>> - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
>>> Hm... Does it require users to maintain correct PYTHON_TARGETS in
>>> make.conf? No default/fallback value?
>>
>> No, I'm a *HUGE* fan of free choice -- I don't know which Python
>> version you want, so select the correct one yourself. It's a one-time
>> choice anyway.
>
> It's not a one-time choice. It's rather a new choice every time a new
> major version is introduced, and all users who don't care have to
> update the var to keep it up-to-date. Not that I care much, just
> pointing out.
>
Why not emulate php/ruby and set a default value in the base profile?
See profiles/base/make.defaults.
I think PYTHON_TARGETS="python2_7 python3_2" would be a reasonable choice.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-12 10:04 ` Krzysztof Pawlik
2012-05-12 17:20 ` Michał Górny
@ 2012-05-13 6:55 ` Nikolaj Sjujskij
1 sibling, 0 replies; 14+ messages in thread
From: Nikolaj Sjujskij @ 2012-05-13 6:55 UTC (permalink / raw
To: Krzysztof Pawlik; +Cc: gentoo-python
Den 2012-05-12 14:04:36 skrev Krzysztof Pawlik <nelchael@gentoo.org>:
>>> - uses PYTHON_TARGETS use-expand (no more python-updater, whoooo!)
>> Hm... Does it require users to maintain correct PYTHON_TARGETS in
>> make.conf? No default/fallback value?
>
> No, I'm a *HUGE* fan of free choice -- I don't know which Python version
> you want, so select the correct one yourself. It's a one-time choice
> anyway.
Just as Michał has pointed it, it is not.
>> It's not big deal, of course, but kind of annoying after so many years
>> of automatic "build for current Python version unless USE_PYTHON is
>> set".
> To me it's an advantage :)
Why? 90% of users just use latest Python available, i.e. 2.7 and 3.2 at
the moment, and don't really care about actual versions.
python.eclass handles this smoothly, probably using eselect'ed versions.
Only few people (like me) set USE_PYTHON to suit their needs. Why new
eclass cannot behave in a similar way? Where's the profit? There's open
bug already: https://bugs.gentoo.org/show_bug.cgi?id=415575
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-12 20:32 ` Mike Gilbert
@ 2012-05-13 19:57 ` Dirkjan Ochtman
2012-05-14 16:12 ` Krzysztof Pawlik
0 siblings, 1 reply; 14+ messages in thread
From: Dirkjan Ochtman @ 2012-05-13 19:57 UTC (permalink / raw
To: Mike Gilbert; +Cc: gentoo-python
On Sat, May 12, 2012 at 10:32 PM, Mike Gilbert <floppym@gentoo.org> wrote:
> Why not emulate php/ruby and set a default value in the base profile?
> See profiles/base/make.defaults.
>
> I think PYTHON_TARGETS="python2_7 python3_2" would be a reasonable choice.
Yeah, I think we should provide a default value, and this default
value looks good to me.
Cheers,
Dirkjan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-13 19:57 ` Dirkjan Ochtman
@ 2012-05-14 16:12 ` Krzysztof Pawlik
2012-05-14 17:42 ` Nikolaj Sjujskij
0 siblings, 1 reply; 14+ messages in thread
From: Krzysztof Pawlik @ 2012-05-14 16:12 UTC (permalink / raw
To: gentoo-python
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
On 13/05/12 21:57, Dirkjan Ochtman wrote:
> On Sat, May 12, 2012 at 10:32 PM, Mike Gilbert <floppym@gentoo.org> wrote:
>> Why not emulate php/ruby and set a default value in the base profile?
>> See profiles/base/make.defaults.
>>
>> I think PYTHON_TARGETS="python2_7 python3_2" would be a reasonable choice.
>
> Yeah, I think we should provide a default value, and this default
> value looks good to me.
Feel free to do so :) I would disagree with adding py3 to default, but it's only me.
--
Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-14 16:12 ` Krzysztof Pawlik
@ 2012-05-14 17:42 ` Nikolaj Sjujskij
2012-05-14 18:00 ` Krzysztof Pawlik
0 siblings, 1 reply; 14+ messages in thread
From: Nikolaj Sjujskij @ 2012-05-14 17:42 UTC (permalink / raw
To: gentoo-python; +Cc: Krzysztof Pawlik
Den 2012-05-14 20:12:51 skrev Krzysztof Pawlik <nelchael@gentoo.org>:
> On 13/05/12 21:57, Dirkjan Ochtman wrote:
>> On Sat, May 12, 2012 at 10:32 PM, Mike Gilbert <floppym@gentoo.org>
>> wrote:
>>> Why not emulate php/ruby and set a default value in the base profile?
>>> See profiles/base/make.defaults.
>>>
>>> I think PYTHON_TARGETS="python2_7 python3_2" would be a reasonable
>>> choice.
>>
>> Yeah, I think we should provide a default value, and this default
>> value looks good to me.
>
> Feel free to do so :) I would disagree with adding py3 to default, but
> it's only me.
It would be pretty strange if we had had Py3k as default Python (i.e. in
stage3) and PYTHON_TARGETS for another version altogether.
And how would new eclass behave in such case? Just-out-of-stage3 system
would have only Python 3.2 installed, but PYTHON_TARGETS="python2_7
python3_2". Let's say user tries to:
# emerge -av pygments
Of course, assuming dev-python/pygments had been ported to new eclass.
Would python-distutils-ng handle this correctly and transparently? Without
obscure errors like "You wants Python 2.7 but haz no Python 2.7"? Without
pulling dev-lang/python:2.7 in? If not, I call this serious usability
regression.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [gentoo-python] New eclass for Python
2012-05-14 17:42 ` Nikolaj Sjujskij
@ 2012-05-14 18:00 ` Krzysztof Pawlik
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Pawlik @ 2012-05-14 18:00 UTC (permalink / raw
To: Nikolaj Sjujskij; +Cc: gentoo-python
[-- Attachment #1: Type: text/plain, Size: 2168 bytes --]
On 14/05/12 19:42, Nikolaj Sjujskij wrote:
> Den 2012-05-14 20:12:51 skrev Krzysztof Pawlik <nelchael@gentoo.org>:
>
>> On 13/05/12 21:57, Dirkjan Ochtman wrote:
>>> On Sat, May 12, 2012 at 10:32 PM, Mike Gilbert <floppym@gentoo.org> wrote:
>>>> Why not emulate php/ruby and set a default value in the base profile?
>>>> See profiles/base/make.defaults.
>>>>
>>>> I think PYTHON_TARGETS="python2_7 python3_2" would be a reasonable choice.
>>>
>>> Yeah, I think we should provide a default value, and this default
>>> value looks good to me.
>>
>> Feel free to do so :) I would disagree with adding py3 to default, but it's
>> only me.
> It would be pretty strange if we had had Py3k as default Python (i.e. in
> stage3) and PYTHON_TARGETS for another version altogether.
I don't have Py3 installed at all on all my machines.
> And how would new eclass behave in such case? Just-out-of-stage3 system would
> have only Python 3.2 installed, but PYTHON_TARGETS="python2_7 python3_2". Let's
> say user tries to:
> # emerge -av pygments
> Of course, assuming dev-python/pygments had been ported to new eclass. Would
> python-distutils-ng handle this correctly and transparently? Without obscure
> errors like "You wants Python 2.7 but haz no Python 2.7"? Without pulling
> dev-lang/python:2.7 in? If not, I call this serious usability regression.
It seems you have no clue how this eclass works. If you have only py3 installed,
and you set PYTHON_TARGETS="python2_7" then dev-lang/python:2.7 will be added to
DEPEND and installed.
The user asked to install for py2:7 so he will get this done. It's not a
usability regression - it's expected behaviour: user wants to build for FOO:X.Y
then the eclass adds FOO:X.Y to DEPEND.
I fail to see how would you like to "correctly and transparently" (whatever it
means to you) do it. If you don't accept as a solution an error message or
pulling in py2:7 then there's no other way - you either install missing
dependencies or die with an error, no third way.
--
Krzysztof Pawlik <nelchael at gentoo.org> key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-05-14 18:00 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 21:13 [gentoo-python] New eclass for Python Krzysztof Pawlik
2012-02-29 5:13 ` Mike Gilbert
2012-02-29 8:11 ` Dirkjan Ochtman
2012-03-03 7:59 ` Arfrever Frehtes Taifersar Arahesis
2012-03-25 18:56 ` [gentoo-python] Re: [gentoo-dev] " Krzysztof Pawlik
2012-05-12 9:19 ` [gentoo-python] " Nikolaj Sjujskij
2012-05-12 10:04 ` Krzysztof Pawlik
2012-05-12 17:20 ` Michał Górny
2012-05-12 20:32 ` Mike Gilbert
2012-05-13 19:57 ` Dirkjan Ochtman
2012-05-14 16:12 ` Krzysztof Pawlik
2012-05-14 17:42 ` Nikolaj Sjujskij
2012-05-14 18:00 ` Krzysztof Pawlik
2012-05-13 6:55 ` Nikolaj Sjujskij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox