0013-Add-an-option-to-disable-installation-of-test-module.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. From bba0896a05e6406076893dd2f4c3b330e41082a6 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 17:01:18 -0800
  4. Subject: [PATCH] Add an option to disable installation of test modules
  5. The Python standard distribution comes with many test modules, that
  6. are not necessarly useful on embedded targets.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  9. [ Andrey Smirnov: ported to Python 3.6 ]
  10. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  11. [aduskett@gmail.com: Update for python 3.6.4]
  12. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  13. ---
  14. Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++-------------------
  15. configure.ac | 5 +++++
  16. 2 files changed, 41 insertions(+), 19 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index 4ce917ab8d..4110fff4ac 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1226,8 +1226,28 @@ maninstall: altmaninstall
  22. # Install the library
  23. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  24. -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  25. - tkinter/test/test_ttk site-packages test \
  26. +
  27. +LIBSUBDIRS= tkinter site-packages \
  28. + asyncio \
  29. + collections concurrent concurrent/futures encodings \
  30. + email email/mime \
  31. + ensurepip ensurepip/_bundled \
  32. + html json http dbm xmlrpc \
  33. + sqlite3 \
  34. + logging csv wsgiref urllib \
  35. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  36. + ctypes ctypes/macholib \
  37. + idlelib idlelib/Icons \
  38. + distutils distutils/command $(XMLLIBSUBDIRS) \
  39. + importlib \
  40. + turtledemo \
  41. + multiprocessing multiprocessing/dummy \
  42. + unittest \
  43. + venv venv/scripts venv/scripts/common venv/scripts/posix \
  44. + curses pydoc_data
  45. +
  46. +TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  47. + tkinter/test/test_ttk test \
  48. test/audiodata \
  49. test/capath test/data \
  50. test/cjkencodings test/decimaltestdata test/xmltestdata \
  51. @@ -1263,29 +1283,26 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  52. test/test_importlib/namespace_pkgs/project3/parent/child \
  53. test/test_importlib/namespace_pkgs/module_and_namespace_package \
  54. test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
  55. - asyncio \
  56. test/test_asyncio \
  57. - collections concurrent concurrent/futures encodings \
  58. - email email/mime test/test_email test/test_email/data \
  59. - ensurepip ensurepip/_bundled \
  60. - html json test/test_json http dbm xmlrpc \
  61. - sqlite3 sqlite3/test \
  62. - logging csv wsgiref urllib \
  63. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  64. + test/test_email test/test_email/data \
  65. + test/test_json \
  66. + sqlite3/test \
  67. + lib2to3/tests \
  68. lib2to3/tests/data lib2to3/tests/data/fixers \
  69. lib2to3/tests/data/fixers/myfixes \
  70. - ctypes ctypes/test ctypes/macholib \
  71. - idlelib idlelib/Icons idlelib/idle_test \
  72. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  73. - importlib test/test_importlib test/test_importlib/builtin \
  74. + ctypes/test \
  75. + idlelib/idle_test \
  76. + distutils/tests \
  77. + test/test_importlib test/test_importlib/builtin \
  78. test/test_importlib/extension test/test_importlib/frozen \
  79. test/test_importlib/import_ test/test_importlib/source \
  80. test/test_tools test/test_warnings test/test_warnings/data \
  81. - turtledemo \
  82. - multiprocessing multiprocessing/dummy \
  83. - unittest unittest/test unittest/test/testmock \
  84. - venv venv/scripts venv/scripts/common venv/scripts/posix \
  85. - curses pydoc_data
  86. + unittest/test unittest/test/testmock
  87. +
  88. +ifeq (@TEST_MODULES@,yes)
  89. +LIBSUBDIRS += $(TESTSUBDIRS)
  90. +endif
  91. +
  92. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  93. @for i in $(SCRIPTDIR) $(LIBDEST); \
  94. do \
  95. diff --git a/configure.ac b/configure.ac
  96. index d5ee2aedfb..f924937fe1 100644
  97. --- a/configure.ac
  98. +++ b/configure.ac
  99. @@ -3112,6 +3112,11 @@ if test "$posix_threads" = "yes"; then
  100. AC_CHECK_FUNCS(pthread_atfork)
  101. fi
  102. +AC_SUBST(TEST_MODULES)
  103. +
  104. +AC_ARG_ENABLE(test-modules,
  105. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  106. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  107. # Check for enable-ipv6
  108. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  109. --
  110. 2.13.5