public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-python <gentoo-python@lists.gentoo.org>
Subject: [gentoo-python] [PATCH] distutils-r1.eclass: Reverse order of esetup.py arguments and clarify documentation
Date: Mon, 11 Mar 2013 16:27:13 -0400	[thread overview]
Message-ID: <513E3E21.8010605@gentoo.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

I ran into some trouble with net-misc/flexget, and it is probably an
issue for other paver-based python packages as well.

Basically, if the build options are passed after the install options,
they are ignored and the default build directory (build/lib) is used
instead. This causes some interesting failures when building in parallel.

An easy workaround is to pass the build command and options before the
install command and options. This requires a small modification to
esetup.py. See attached patch.

This also makes the esetup.py function more flexible in general since it
allows options to be passed both before and after the build command.

The patch also removes a duplicate 'build' command from
distutils-r1_python_compile, which may also cause problems for paver.

I do plan to look into the paver issue further, but I would like to make
this adjustment anyway.

[-- Attachment #2: distutils-r1.patch --]
[-- Type: text/plain, Size: 1572 bytes --]

Index: distutils-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v
retrieving revision 1.63
diff -u -B -r1.63 distutils-r1.eclass
--- distutils-r1.eclass	9 Mar 2013 13:13:02 -0000	1.63
+++ distutils-r1.eclass	11 Mar 2013 20:04:15 -0000
@@ -209,11 +209,13 @@
 # @FUNCTION: esetup.py
 # @USAGE: [<args>...]
 # @DESCRIPTION:
-# Run the setup.py using currently selected Python interpreter
-# (if ${PYTHON} is set; fallback 'python' otherwise). The setup.py will
-# be passed default ${mydistutilsargs[@]}, then any parameters passed
-# to this command and optionally a standard option set (e.g. the build
-# directory in an ebuild using out-of-source builds).
+# Run setup.py using currently selected Python interpreter
+# (if ${PYTHON} is set; fallback 'python' otherwise).
+#
+# setup.py will be passed the following, in order:
+# 1. ${mydistutilsargs[@]}
+# 2. The 'build' command and standard build options including ${BUILD_DIR}
+# 3. Any additional arguments passed to the esetup.py function.
 #
 # This command dies on failure.
 esetup.py() {
@@ -242,7 +244,7 @@
 	fi
 
 	set -- "${PYTHON:-python}" setup.py \
-		"${mydistutilsargs[@]}" "${@}" "${add_args[@]}"
+		"${mydistutilsargs[@]}" "${add_args[@]}" "${@}"
 
 	echo "${@}" >&2
 	"${@}" || die
@@ -353,7 +355,7 @@
 distutils-r1_python_compile() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	esetup.py build "${@}"
+	esetup.py "${@}"
 }
 
 # @FUNCTION: distutils-r1_python_test

                 reply	other threads:[~2013-03-11 20:27 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=513E3E21.8010605@gentoo.org \
    --to=floppym@gentoo.org \
    --cc=gentoo-python@lists.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