python3-100-optional-test-modules.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Add an option to disable installation of test modules
  2. The Python standard distribution comes with many test modules, that
  3. are not necessarly useful on embedded targets.
  4. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  5. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  6. ---
  7. Makefile.pre.in | 50 ++++++++++++++++++++++++++++++++------------------
  8. configure.ac | 6 ++++++
  9. 2 files changed, 38 insertions(+), 18 deletions(-)
  10. Index: cpython/Makefile.pre.in
  11. ===================================================================
  12. --- cpython.orig/Makefile.pre.in
  13. +++ cpython/Makefile.pre.in
  14. @@ -976,8 +976,26 @@
  15. EXTRAPLATDIR= @EXTRAPLATDIR@
  16. MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
  17. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  18. -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  19. - tkinter/test/test_ttk site-packages test \
  20. +LIBSUBDIRS= tkinter \
  21. + site-packages \
  22. + collections concurrent concurrent/futures encodings \
  23. + email email/mime \
  24. + html json http dbm xmlrpc \
  25. + sqlite3 \
  26. + logging csv wsgiref urllib \
  27. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  28. + ctypes ctypes/macholib idlelib idlelib/Icons \
  29. + distutils distutils/command $(XMLLIBSUBDIRS) \
  30. + importlib \
  31. + turtledemo \
  32. + multiprocessing multiprocessing/dummy \
  33. + unittest \
  34. + venv venv/scripts venv/scripts/posix \
  35. + curses pydoc_data $(MACHDEPS)
  36. +
  37. +ifeq (@TEST_MODULES@,yes)
  38. +LIBSUBDIRS += tkinter/test tkinter/test/test_tkinter \
  39. + tkinter/test/test_ttk test \
  40. test/capath test/data \
  41. test/cjkencodings test/decimaltestdata test/xmltestdata \
  42. test/subprocessdata test/sndhdrdata \
  43. @@ -1000,26 +1018,22 @@
  44. test/namespace_pkgs/project3 \
  45. test/namespace_pkgs/project3/parent \
  46. test/namespace_pkgs/project3/parent/child \
  47. - test/namespace_pkgs/module_and_namespace_package \
  48. - test/namespace_pkgs/module_and_namespace_package/a_test \
  49. - collections concurrent concurrent/futures encodings \
  50. - email email/mime test/test_email test/test_email/data \
  51. - html json test/json_tests http dbm xmlrpc \
  52. - sqlite3 sqlite3/test \
  53. - logging csv wsgiref urllib \
  54. - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  55. + test/namespace_pkgs/module_and_namespace_package \
  56. + test/namespace_pkgs/module_and_namespace_package/a_test \
  57. + test/test_email test/test_email/data \
  58. + test/json_tests \
  59. + sqlite3/test \
  60. + lib2to3/tests \
  61. lib2to3/tests/data lib2to3/tests/data/fixers \
  62. lib2to3/tests/data/fixers/myfixes \
  63. - ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
  64. - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  65. - importlib test/test_importlib test/test_importlib/builtin \
  66. + ctypes/test \
  67. + distutils/tests \
  68. + test/test_importlib test/test_importlib/builtin \
  69. test/test_importlib/extension test/test_importlib/frozen \
  70. test/test_importlib/import_ test/test_importlib/source \
  71. - turtledemo \
  72. - multiprocessing multiprocessing/dummy \
  73. - unittest unittest/test unittest/test/testmock \
  74. - venv venv/scripts venv/scripts/posix \
  75. - curses pydoc_data $(MACHDEPS)
  76. + unittest unittest/test unittest/test/testmock
  77. +endif
  78. +
  79. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  80. @for i in $(SCRIPTDIR) $(LIBDEST); \
  81. do \
  82. Index: cpython/configure.ac
  83. ===================================================================
  84. --- cpython.orig/configure.ac
  85. +++ cpython/configure.ac
  86. @@ -2449,6 +2449,12 @@
  87. fi
  88. +AC_SUBST(TEST_MODULES)
  89. +
  90. +AC_ARG_ENABLE(test-modules,
  91. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  92. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  93. +
  94. # Check for enable-ipv6
  95. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  96. AC_MSG_CHECKING([if --enable-ipv6 is specified])