All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] python/python3: Remove trailing white spaces
@ 2018-09-12 20:40 Andrew Geissler
  2018-09-12 20:40 ` [PATCH 2/2] python/python3: Add option to remove test files Andrew Geissler
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Geissler @ 2018-09-12 20:40 UTC (permalink / raw)
  To: openembedded-core; +Cc: Andrew Geissler, alejandro.enedino.hernandez-samaniego

Noticed these in my diff when adding some new changes
to these files.

Signed-off-by: Andrew Geissler <geissonator@gmail.com>
---
 meta/recipes-devtools/python/python3_3.5.5.bb | 2 +-
 meta/recipes-devtools/python/python_2.7.15.bb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
index 40896db..c919a97 100644
--- a/meta/recipes-devtools/python/python3_3.5.5.bb
+++ b/meta/recipes-devtools/python/python3_3.5.5.bb
@@ -137,7 +137,7 @@ do_compile() {
 		-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
 		-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
 		Makefile
-	# save copy of it now, because if we do it in do_install and 
+	# save copy of it now, because if we do it in do_install and
 	# then call do_install twice we get Makefile.orig == Makefile.sysroot
 	install -m 0644 Makefile Makefile.sysroot
 
diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb
index 43d9ff5..82b65d2 100644
--- a/meta/recipes-devtools/python/python_2.7.15.bb
+++ b/meta/recipes-devtools/python/python_2.7.15.bb
@@ -75,7 +75,7 @@ do_compile() {
 		-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
 		-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
 		Makefile
-	# save copy of it now, because if we do it in do_install and 
+	# save copy of it now, because if we do it in do_install and
 	# then call do_install twice we get Makefile.orig == Makefile.sysroot
 	install -m 0644 Makefile Makefile.sysroot
 
@@ -107,7 +107,7 @@ do_install() {
 		STAGING_INCDIR=${STAGING_INCDIR} \
 		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
 		DESTDIR=${D} LIBDIR=${libdir}
-	
+
 	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
 		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
 		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] python/python3: Add option to remove test files
  2018-09-12 20:40 [PATCH 1/2] python/python3: Remove trailing white spaces Andrew Geissler
@ 2018-09-12 20:40 ` Andrew Geissler
  2018-09-12 21:10   ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Geissler @ 2018-09-12 20:40 UTC (permalink / raw)
  To: openembedded-core; +Cc: Andrew Geissler, alejandro.enedino.hernandez-samaniego

A quick search in the python package shows the following test
directories being included in the python image:
./Python-2.7.14/Lib/bsddb/test
./Python-2.7.14/Lib/sqlite3/test
./Python-2.7.14/Lib/ctypes/test
./Python-2.7.14/Lib/unittest/test
./Python-2.7.14/Lib/lib-tk/test
./Python-2.7.14/Lib/email/test

In some distributions, the extra space taken up by these test files
is very valuable.

The default is to still include the test files.

Signed-off-by: Andrew Geissler <geissonator@gmail.com>
---
 meta/recipes-devtools/python/python3_3.5.5.bb | 9 +++++++++
 meta/recipes-devtools/python/python_2.7.15.bb | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
index c919a97..5d1397a 100644
--- a/meta/recipes-devtools/python/python3_3.5.5.bb
+++ b/meta/recipes-devtools/python/python3_3.5.5.bb
@@ -160,6 +160,11 @@ EOF
 	fi
 }
 
+# Some packages include test/ directories and files. Provide option
+# to not include them.
+
+INCLUDE_TESTS ?= "1"
+
 do_install() {
 	# make install needs the original Makefile, or otherwise the inclues would
 	# go to ${D}${STAGING...}/...
@@ -189,6 +194,10 @@ do_install() {
 	fi
 
 	oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
+
+    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
+        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
+    fi
 }
 
 do_install_append_class-nativesdk () {
diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb
index 82b65d2..1839624 100644
--- a/meta/recipes-devtools/python/python_2.7.15.bb
+++ b/meta/recipes-devtools/python/python_2.7.15.bb
@@ -90,6 +90,11 @@ do_compile() {
 		OPT="${CFLAGS}"
 }
 
+# Some packages include test/ directories and files. Provide option
+# to not include them.
+
+INCLUDE_TESTS ?= "1"
+
 do_install() {
 	# make install needs the original Makefile, or otherwise the inclues would
 	# go to ${D}${STAGING...}/...
@@ -127,6 +132,10 @@ do_install() {
     if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
         rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
     fi
+
+    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
+        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
+    fi
 }
 
 do_install_append_class-nativesdk () {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] python/python3: Add option to remove test files
  2018-09-12 20:40 ` [PATCH 2/2] python/python3: Add option to remove test files Andrew Geissler
@ 2018-09-12 21:10   ` Burton, Ross
  2018-09-13  0:46     ` Andrew Geissler
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2018-09-12 21:10 UTC (permalink / raw)
  To: Andrew Geissler; +Cc: Alejandro Enedino Hernandez Samaniego, OE-core

What are these files?  Are they needed by the test suite?  If so, lets
just put them into python-tests along with the test suite.

Ross

On 12 September 2018 at 21:40, Andrew Geissler <geissonator@gmail.com> wrote:
> A quick search in the python package shows the following test
> directories being included in the python image:
> ./Python-2.7.14/Lib/bsddb/test
> ./Python-2.7.14/Lib/sqlite3/test
> ./Python-2.7.14/Lib/ctypes/test
> ./Python-2.7.14/Lib/unittest/test
> ./Python-2.7.14/Lib/lib-tk/test
> ./Python-2.7.14/Lib/email/test
>
> In some distributions, the extra space taken up by these test files
> is very valuable.
>
> The default is to still include the test files.
>
> Signed-off-by: Andrew Geissler <geissonator@gmail.com>
> ---
>  meta/recipes-devtools/python/python3_3.5.5.bb | 9 +++++++++
>  meta/recipes-devtools/python/python_2.7.15.bb | 9 +++++++++
>  2 files changed, 18 insertions(+)
>
> diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
> index c919a97..5d1397a 100644
> --- a/meta/recipes-devtools/python/python3_3.5.5.bb
> +++ b/meta/recipes-devtools/python/python3_3.5.5.bb
> @@ -160,6 +160,11 @@ EOF
>         fi
>  }
>
> +# Some packages include test/ directories and files. Provide option
> +# to not include them.
> +
> +INCLUDE_TESTS ?= "1"
> +
>  do_install() {
>         # make install needs the original Makefile, or otherwise the inclues would
>         # go to ${D}${STAGING...}/...
> @@ -189,6 +194,10 @@ do_install() {
>         fi
>
>         oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
> +
> +    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
> +        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
> +    fi
>  }
>
>  do_install_append_class-nativesdk () {
> diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb
> index 82b65d2..1839624 100644
> --- a/meta/recipes-devtools/python/python_2.7.15.bb
> +++ b/meta/recipes-devtools/python/python_2.7.15.bb
> @@ -90,6 +90,11 @@ do_compile() {
>                 OPT="${CFLAGS}"
>  }
>
> +# Some packages include test/ directories and files. Provide option
> +# to not include them.
> +
> +INCLUDE_TESTS ?= "1"
> +
>  do_install() {
>         # make install needs the original Makefile, or otherwise the inclues would
>         # go to ${D}${STAGING...}/...
> @@ -127,6 +132,10 @@ do_install() {
>      if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
>          rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
>      fi
> +
> +    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
> +        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
> +    fi
>  }
>
>  do_install_append_class-nativesdk () {
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] python/python3: Add option to remove test files
  2018-09-12 21:10   ` Burton, Ross
@ 2018-09-13  0:46     ` Andrew Geissler
  2018-09-13  9:32       ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Geissler @ 2018-09-13  0:46 UTC (permalink / raw)
  To: ross.burton; +Cc: alejandro.enedino.hernandez-samaniego, openembedded-core

On Wed, Sep 12, 2018 at 4:11 PM Burton, Ross <ross.burton@intel.com> wrote:
>
> What are these files?  Are they needed by the test suite?  If so, lets
> just put them into python-tests along with the test suite.

I did have a brief email exchange with Alejandro in
http://lists.openembedded.org/pipermail/openembedded-core/2018-September/155471.html
where we talked about how certain packages require the test files
during build, so they'd need to be removed during install.   I figured
it was easiest to just do them all during install.

I see that python2-manifest.json does have a sqlite3 and sqlite3-tests
entry.  Is that the type of thing I should try with the other packages
or were you thinking something else?

I'm definitely very new to the python recipe, but willing to try out
whatever you guys think best.

Thanks!
Andrew
>
> Ross
>
> On 12 September 2018 at 21:40, Andrew Geissler <geissonator@gmail.com> wrote:
> > A quick search in the python package shows the following test
> > directories being included in the python image:
> > ./Python-2.7.14/Lib/bsddb/test
> > ./Python-2.7.14/Lib/sqlite3/test
> > ./Python-2.7.14/Lib/ctypes/test
> > ./Python-2.7.14/Lib/unittest/test
> > ./Python-2.7.14/Lib/lib-tk/test
> > ./Python-2.7.14/Lib/email/test
> >
> > In some distributions, the extra space taken up by these test files
> > is very valuable.
> >
> > The default is to still include the test files.
> >
> > Signed-off-by: Andrew Geissler <geissonator@gmail.com>
> > ---
> >  meta/recipes-devtools/python/python3_3.5.5.bb | 9 +++++++++
> >  meta/recipes-devtools/python/python_2.7.15.bb | 9 +++++++++
> >  2 files changed, 18 insertions(+)
> >
> > diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
> > index c919a97..5d1397a 100644
> > --- a/meta/recipes-devtools/python/python3_3.5.5.bb
> > +++ b/meta/recipes-devtools/python/python3_3.5.5.bb
> > @@ -160,6 +160,11 @@ EOF
> >         fi
> >  }
> >
> > +# Some packages include test/ directories and files. Provide option
> > +# to not include them.
> > +
> > +INCLUDE_TESTS ?= "1"
> > +
> >  do_install() {
> >         # make install needs the original Makefile, or otherwise the inclues would
> >         # go to ${D}${STAGING...}/...
> > @@ -189,6 +194,10 @@ do_install() {
> >         fi
> >
> >         oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
> > +
> > +    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
> > +        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
> > +    fi
> >  }
> >
> >  do_install_append_class-nativesdk () {
> > diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb
> > index 82b65d2..1839624 100644
> > --- a/meta/recipes-devtools/python/python_2.7.15.bb
> > +++ b/meta/recipes-devtools/python/python_2.7.15.bb
> > @@ -90,6 +90,11 @@ do_compile() {
> >                 OPT="${CFLAGS}"
> >  }
> >
> > +# Some packages include test/ directories and files. Provide option
> > +# to not include them.
> > +
> > +INCLUDE_TESTS ?= "1"
> > +
> >  do_install() {
> >         # make install needs the original Makefile, or otherwise the inclues would
> >         # go to ${D}${STAGING...}/...
> > @@ -127,6 +132,10 @@ do_install() {
> >      if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
> >          rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
> >      fi
> > +
> > +    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
> > +        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
> > +    fi
> >  }
> >
> >  do_install_append_class-nativesdk () {
> > --
> > 2.7.4
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] python/python3: Add option to remove test files
  2018-09-13  0:46     ` Andrew Geissler
@ 2018-09-13  9:32       ` Burton, Ross
  0 siblings, 0 replies; 5+ messages in thread
From: Burton, Ross @ 2018-09-13  9:32 UTC (permalink / raw)
  To: Andrew Geissler; +Cc: Alejandro Enedino Hernandez Samaniego, OE-core

I'd just say that if those files are only needed by the test suite
(python3 -mtest), it's easy to move them into the python-tests package
by editing the manifest.   If they're not part of the test suite then
what are they?

I can't recall why there's a python3-sqlite3-tests package instead of
just putting those tests into python3-tests and don't want to see more
python3-[module]-tests packages.

Ross

On 13 September 2018 at 01:46, Andrew Geissler <geissonator@gmail.com> wrote:
> On Wed, Sep 12, 2018 at 4:11 PM Burton, Ross <ross.burton@intel.com> wrote:
>>
>> What are these files?  Are they needed by the test suite?  If so, lets
>> just put them into python-tests along with the test suite.
>
> I did have a brief email exchange with Alejandro in
> http://lists.openembedded.org/pipermail/openembedded-core/2018-September/155471.html
> where we talked about how certain packages require the test files
> during build, so they'd need to be removed during install.   I figured
> it was easiest to just do them all during install.
>
> I see that python2-manifest.json does have a sqlite3 and sqlite3-tests
> entry.  Is that the type of thing I should try with the other packages
> or were you thinking something else?
>
> I'm definitely very new to the python recipe, but willing to try out
> whatever you guys think best.
>
> Thanks!
> Andrew
>>
>> Ross
>>
>> On 12 September 2018 at 21:40, Andrew Geissler <geissonator@gmail.com> wrote:
>> > A quick search in the python package shows the following test
>> > directories being included in the python image:
>> > ./Python-2.7.14/Lib/bsddb/test
>> > ./Python-2.7.14/Lib/sqlite3/test
>> > ./Python-2.7.14/Lib/ctypes/test
>> > ./Python-2.7.14/Lib/unittest/test
>> > ./Python-2.7.14/Lib/lib-tk/test
>> > ./Python-2.7.14/Lib/email/test
>> >
>> > In some distributions, the extra space taken up by these test files
>> > is very valuable.
>> >
>> > The default is to still include the test files.
>> >
>> > Signed-off-by: Andrew Geissler <geissonator@gmail.com>
>> > ---
>> >  meta/recipes-devtools/python/python3_3.5.5.bb | 9 +++++++++
>> >  meta/recipes-devtools/python/python_2.7.15.bb | 9 +++++++++
>> >  2 files changed, 18 insertions(+)
>> >
>> > diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
>> > index c919a97..5d1397a 100644
>> > --- a/meta/recipes-devtools/python/python3_3.5.5.bb
>> > +++ b/meta/recipes-devtools/python/python3_3.5.5.bb
>> > @@ -160,6 +160,11 @@ EOF
>> >         fi
>> >  }
>> >
>> > +# Some packages include test/ directories and files. Provide option
>> > +# to not include them.
>> > +
>> > +INCLUDE_TESTS ?= "1"
>> > +
>> >  do_install() {
>> >         # make install needs the original Makefile, or otherwise the inclues would
>> >         # go to ${D}${STAGING...}/...
>> > @@ -189,6 +194,10 @@ do_install() {
>> >         fi
>> >
>> >         oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
>> > +
>> > +    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
>> > +        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
>> > +    fi
>> >  }
>> >
>> >  do_install_append_class-nativesdk () {
>> > diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb
>> > index 82b65d2..1839624 100644
>> > --- a/meta/recipes-devtools/python/python_2.7.15.bb
>> > +++ b/meta/recipes-devtools/python/python_2.7.15.bb
>> > @@ -90,6 +90,11 @@ do_compile() {
>> >                 OPT="${CFLAGS}"
>> >  }
>> >
>> > +# Some packages include test/ directories and files. Provide option
>> > +# to not include them.
>> > +
>> > +INCLUDE_TESTS ?= "1"
>> > +
>> >  do_install() {
>> >         # make install needs the original Makefile, or otherwise the inclues would
>> >         # go to ${D}${STAGING...}/...
>> > @@ -127,6 +132,10 @@ do_install() {
>> >      if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
>> >          rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
>> >      fi
>> > +
>> > +    if [ "${INCLUDE_TESTS}" -ne "1" ]; then
>> > +        find ${D}${libdir}/python${PYTHON_MAJMIN} -name test -exec rm -rf {} +;
>> > +    fi
>> >  }
>> >
>> >  do_install_append_class-nativesdk () {
>> > --
>> > 2.7.4
>> >
>> > --
>> > _______________________________________________
>> > Openembedded-core mailing list
>> > Openembedded-core@lists.openembedded.org
>> > http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-13  9:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12 20:40 [PATCH 1/2] python/python3: Remove trailing white spaces Andrew Geissler
2018-09-12 20:40 ` [PATCH 2/2] python/python3: Add option to remove test files Andrew Geissler
2018-09-12 21:10   ` Burton, Ross
2018-09-13  0:46     ` Andrew Geissler
2018-09-13  9:32       ` Burton, Ross

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.