-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --disable-test-modules configure option to not build nor install tests #71827
Comments
Do not install the Python test suite when configure is run with '--disable-test-suite'. This about divides by two the size of the installed standard library. Related to bpo-26852: add the '--enable-legacy-pyc-files' option to configure. The attached listdirs.py script may be used to check that the set of sub-directories in the std library is not changed by the patch. |
We have a similar patch in Buildroot (see https://git.buildroot.org/buildroot/tree/package/python3/0017-Add-an-option-to-disable-installation-of-test-module.patch) so we would be very happy to see this patch merged. Note that we also have many more patches to disable various parts of the Python standard installation (https://git.buildroot.org/buildroot/tree/package/python3/). So either we have one option for each feature (like we have implemented), or a more general config option --disable-feature=test,this,that. See also bug http://bugs.python.org/issue20210 which is related, and was also proposing a patch to disable the test suite. |
Thanks for the review Martin. I will update the patch accordingly later. |
I'm in favor of allowing to build a "subset" of Python. Not only it makes sense for embedded devices, but in many cases it's even not possible to do otherwise: "full" Python is too big for small devices. But I would prefer to see a public discussion on python-dev before going into this direction. The previous attempt failed because some core developers were opposed to support officially a "subset of Python". But since this previous discussion (two years ago? longer?), MicroPython became popular, and this implementation of Python has a small subset of the stdlib (but it supports asyncio ;-)) Maybe it's time for a new attempt :-) Oh, and the meanwhile we also made progress on the Android port, which is now an important platform. In short, I would like to official support Python subsets ;-) At least, add options for that. |
Ah, the discussion restarted on the other issue: |
bpo-20210 has ended up as a change in the build system eventually and not the installation process, only a tiny step towards the configuration of a smaller Python distribution :( After browsing again the last discussion on "[Python-ideas] size of the installation of Python on mobile devices" [1], I find all the arguments in favor of such changes still relevant. I would also add the following new arguments:
But it fails to not install also: This is not consistent and should be fixed by a proper (endorsed by Python) installation process. [1] https://mail.python.org/pipermail/python-ideas/2016-July/ |
I modified setup.py to add a new TEST_EXTENSIONS which allows to not build test extensions: New changeset cfe172d by Victor Stinner in branch 'master': setup.py should be modified manually, but it's a small step towards be able to build Python without tests ;-) |
pr23886_files.diff: see #23886 (comment) |
Thanks all, it's now fixed in the master branch, the future Python 3.10. Thanks Xavier de Gaye for the initial patch and reported the issue. Thanks Peixing Xin for the final change which is now even better! Thanks also Thomas Petazzoni who maintained the downstream patch in buildroot. See also discussion on PR 23886 about the technical change and the different tests that we run to ensure that the change doesn't break anything, and that it works as expected. I'm really not comfortable at all to change the Python build system. It's very complex and fragile, I don't know it very well, so I'm not confident in what I am doing. For these reasons, I'm strongly against backporting the change to stable branches (3.8 and 3.9) and so I close the issue |
I have a slightly different interest in declining to install tests... Arch Linux provides the tests as a split subpackage with currently some hacky shell globbing to delete the tests after make install, then do a second libinstall and delete everything but the tests. It would be more convenient if we had a Makefile option to install the tests separately. It's now possible to disable installing tests with a filthy hack: make install TEST_MODULES= TESTSUBDIRS= However, it's not possible to similarly hack make libinstall LIBSUBDIRS= Thoughts on maybe splitting this up at install time? Would probably mean duplicating some of libinstall as testinstall... |
While this use case is tighly coupled to this feature, would you mind to open a separate issue for your use case? IMO it makes sense and it sounds easy to implement it (especially after --disable-test-modules feature has been implemented). |
I filed bpo-43282 for this. |
Thanks ;-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: