All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/python-aenum: drop test_v3.py file for python 2.x to fix pycompile issue
Date: Sat, 03 Oct 2020 08:57:56 +0200	[thread overview]
Message-ID: <878scnyex7.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20201002134048.24473-1-peter@korsgaard.com> (Peter Korsgaard's message of "Fri, 2 Oct 2020 15:40:47 +0200")

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 > Fixes:
 > http://autobuild.buildroot.net/results/4ca459d54545c0e20b0f0cdc63bd81844ecd7f36/

 > aenum has conditional logic to load python 3.x code located in test_v3.py:

 > if pyver >= 3.0:
 >     from aenum.test_v3 import TestEnumV3, TestOrderV3, TestNamedTupleV3

 > And contains logic in setup.py to drop that file during setup.py install if
 > building for python 2.x:

 > py3_only = ('aenum/test_v3.py', )
 > ..
 > if __name__ == '__main__':
 >     if 'install' in sys.argv:
 >         import os, sys
 > 	..
 >         if sys.version_info[0] != 3:
 >             for file in py3_only:
 >                 try:
 >                     os.unlink(file)

 > But this doesn't work in Buildroot as pkg-python.dk first does setup.py
 > build (which copies test_v3.py to the build directory) before setup.py
 > install, so test_v3.py gets installed, leading to errors from pycompile:

 > error:   File "/usr/lib/python2.7/site-packages/aenum/test_v3.py", line 12
 >     class MagicAutoNumberEnum(Enum, settings=AutoNumber):
 >                                             ^
 > SyntaxError: invalid syntax

 > As a workaround, add a hook to drop it from the target directory when
 > building for python 2.x.

 > Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

  parent reply	other threads:[~2020-10-03  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 13:40 [Buildroot] [PATCH 1/2] package/python-aenum: drop test_v3.py file for python 2.x to fix pycompile issue Peter Korsgaard
2020-10-02 13:40 ` [Buildroot] [PATCH 2/2] package/python-fire.mk: drop test_components_py3.py file for python 2.x to fix pyfile issue Peter Korsgaard
2020-10-03  6:58   ` Peter Korsgaard
2020-10-05  6:04   ` Peter Korsgaard
2020-10-03  6:57 ` Peter Korsgaard [this message]
2020-10-05  6:04 ` [Buildroot] [PATCH 1/2] package/python-aenum: drop test_v3.py file for python 2.x to fix pycompile issue Peter Korsgaard

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=878scnyex7.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.