public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org
Subject: [gentoo-python] A virtual for argparse module
Date: Thu, 18 Oct 2012 00:07:16 +0200	[thread overview]
Message-ID: <20121018000716.2b8372c3@pomiocik.lan> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 838 bytes --]

Hi,

The argparse module is bundled with some Python implementations,
and some other require it being installed via dev-python/argparse. To
simplify handling that from ebuilds, I hereby suggest introducing
virtual/python-argparse -- a package based on PYTHON_TARGETS which
would simply install (or not) the actual argparse module as necessary.

I am attaching a simple implementation of that, using python-r1. It
simply requests (as a RDEP) the appropriate Python version (thus
requesting the module for implementations having it built-in)
and the dev-python/argparse package for the implementations missing it.

You can also note that the PYTHON_COMPAT misses pypy -- it's because I
simply have no idea whether they bundle it ;). Feel free to correct
that.

What are you thoughts?

-- 
Best regards,
Michał Górny

[-- Attachment #1.2: python-argparse-0.ebuild --]
[-- Type: text/plain, Size: 1139 bytes --]

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/argparse/argparse-1.2.1.ebuild,v 1.15 2012/08/05 14:08:38 ryao Exp $

EAPI=4
PYTHON_COMPAT=(
	python2_5 python2_6 python2_7
	python3_1 python3_2
	jython2_5
)
inherit python-r1

DESCRIPTION="A virtual for the Python argparse module"
HOMEPAGE="http://code.google.com/p/argparse/ http://pypi.python.org/pypi/argparse"
SRC_URI=""

LICENSE=""
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc
	x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd
	~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos
	~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x86-solaris"
IUSE=""

setup_globals() {
	local i

	RDEPEND=${PYTHON_DEPS}
	for i in "${PYTHON_COMPAT[@]}"; do
		case "${i}" in
			python2_7|python3*)
				;;
			*)
				# Note: add USE-deps when dev-python/argparse starts
				# supporting PYTHON_TARGETS
				RDEPEND+=" python_targets_${i}? ( dev-python/argparse )"
				;;
		esac
	done
}
setup_globals

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

                 reply	other threads:[~2012-10-17 22:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121018000716.2b8372c3@pomiocik.lan \
    --to=mgorny@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox