[OE-core] [PATCH v2] python/python3: Move test files to test package

Burton, Ross ross.burton at intel.com
Thu Sep 13 23:30:20 UTC 2018


A little oe-pkgdata-util[1] managed to give me a good review of some
missing entries here.

python3-asyncio: /usr/lib/python3.5/asyncio/test_utils.py
python3-2to3: /usr/lib/python3.5/lib2to3/tests/test_*.py
python3-tkinter: /usr/lib/python3.5/tkinter/test/
python3-unittest: /usr/lib/python3.5/unittest/test/ (the test suite
for unittest should be in python3-test)
python3-distutils: /usr/lib/python3.5/distutils/tests/test_*

I suspect simply adding python3.5/*/test/ will catch the bulk of this
now and in the future.

Ross

[1] oe-pkgdata-util find-path '/usr/lib/python*/**/test_*.py'

On 13 September 2018 at 20:49, Andrew Geissler <geissonator at 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
>
> Move the bsddb, ctypes, and email packages to the python-tests package
> to conserve some space.
>
> Packages not include in this patch:
> - sqlite3 has it's own -tests package
> - unittest is already a test package
> - lib-tk (tkinter) seems to have its own special installation and does
> not allow the manifest override for its test directory
> - bsddb is no longer in python3 so update for it was not needed there
>
> Just the ctypes and email change saved us ~150KB of read-only
> filesystem space in our embedded env.
>
> Changes since v1:
> - Used manifest file instead of python recipe to move files to -tests
> package
>
> Signed-off-by: Andrew Geissler <geissonator at gmail.com>
> ---
>  meta/recipes-devtools/python/python/python2-manifest.json  | 5 ++++-
>  meta/recipes-devtools/python/python3/python3-manifest.json | 4 +++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/python/python/python2-manifest.json b/meta/recipes-devtools/python/python/python2-manifest.json
> index 723e513..8db2afe 100644
> --- a/meta/recipes-devtools/python/python/python2-manifest.json
> +++ b/meta/recipes-devtools/python/python/python2-manifest.json
> @@ -925,7 +925,10 @@
>      },
>      "tests": {
>          "files": [
> -            "${libdir}/python2.7/test"
> +            "${libdir}/python2.7/test",
> +            "${libdir}/python2.7/email/test",
> +            "${libdir}/python2.7/ctypes/test",
> +            "${libdir}/python2.7/bsddb/test"
>          ],
>          "rdepends": [
>              "core"
> diff --git a/meta/recipes-devtools/python/python3/python3-manifest.json b/meta/recipes-devtools/python/python3/python3-manifest.json
> index 90a41fb..963140f 100644
> --- a/meta/recipes-devtools/python/python3/python3-manifest.json
> +++ b/meta/recipes-devtools/python/python3/python3-manifest.json
> @@ -1040,7 +1040,9 @@
>      "tests": {
>          "cached": [],
>          "files": [
> -            "${libdir}/python${PYTHON_MAJMIN}/test"
> +            "${libdir}/python${PYTHON_MAJMIN}/test",
> +            "${libdir}/python${PYTHON_MAJMIN}/email/test",
> +            "${libdir}/python${PYTHON_MAJMIN}/ctypes/test"
>          ],
>          "rdepends": [
>              "core",
> --
> 2.7.4
>



More information about the Openembedded-core mailing list