1 Add an option to disable pydoc
3 It removes 0.5 MB of data from the target plus the pydoc script
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
10 Makefile.pre.in | 8 +++++++-
11 configure.ac | 5 +++++
12 setup.py | 9 +++++++--
13 3 files changed, 19 insertions(+), 3 deletions(-)
15 Index: b/Makefile.pre.in
16 ===================================================================
20 -rm -f $(DESTDIR)$(BINDIR)/idle3
21 (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
22 -rm -f $(DESTDIR)$(BINDIR)/pydoc3
24 (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
26 -rm -f $(DESTDIR)$(BINDIR)/2to3
27 (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
28 -rm -f $(DESTDIR)$(BINDIR)/pyvenv
30 multiprocessing multiprocessing/dummy \
32 venv venv/scripts venv/scripts/posix \
33 - curses pydoc_data $(MACHDEPS)
36 TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
37 test test/test_asyncio \
38 @@ -1198,6 +1200,10 @@
39 test/test_importlib/import_ test/test_importlib/source \
40 unittest/test unittest/test/testmock
43 +LIBSUBDIRS += pydoc_data
46 ifeq (@TEST_MODULES@,yes)
47 LIBSUBDIRS += $(TESTSUBDIRS)
50 ===================================================================
53 @@ -2675,6 +2675,11 @@
54 AC_CHECK_FUNCS(pthread_atfork)
60 + AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
61 + [ PYDOC="${enableval}" ], [ PYDOC=yes ])
63 AC_SUBST(TEST_MODULES)
66 ===================================================================
69 @@ -2200,6 +2200,12 @@
70 # turn off warnings when deprecated modules are imported
72 warnings.filterwarnings("ignore",category=DeprecationWarning)
74 + scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3',
76 + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
77 + scripts += [ 'Tools/scripts/pydoc3' ]
79 setup(# PyPI Metadata (PEP 301)
81 version = sys.version.split()[0],
83 # If you change the scripts installed here, you also need to
84 # check the PyBuildScripts command above, and change the links
85 # created by the bininstall target in Makefile.pre.in
86 - scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
87 - "Tools/scripts/2to3", "Tools/scripts/pyvenv"]