bpo-27640: Add --disable-test-modules configure option#23886
Conversation
|
Parts of the testsuite are used by third party packages. Even if you don't want to install test modules, you should install those. However that list might be incomplete. For packaging purposes I think it's better to remove those files which you don't want to ship after the installation. |
Sorry, something went wrong.
doko42
left a comment
There was a problem hiding this comment.
Parts of the testsuite are used by third party packages. Even if you don't want to install test modules, you should install those.
This is what I identify as part of the test framework:
test/{libregrtest,support}
test/{ann_module,ann_module2,ann_module3}.py
test/{regrtest,test_support,init,main}.py
However that list might be incomplete.
For packaging purposes I think it's better to remove those files which you don't want to ship after the installation.
Sorry, something went wrong.
|
@doko42 Thanks for your review. After I installed the Python3.8 distribution for Ubuntu, it indeed has the regression test framework shipped but with all other test stuffs removed. So always shipping test framework skeleton regardless of the option value of --enable-test-modules could be a good idea. Could we do the same thing like Ubuntu does as shown below? Under the directory /usr/lib/python3.8/test, Ubuntu ships: In addition, Ubuntu doesn't ship test/{ann_module,ann_module2,ann_module3}.py. How are these used by 3rd-party? |
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
https://bugs.python.org/issue31904 is a meta-issue about VxWorks, but I would prefer to have a dedicated issue for this change.
The good news is that it already exists: https://bugs.python.org/issue27640 Please reuse this BPO.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
|
The buildroot project has the following patch on Python which adds |
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
https://bugs.debian.org/944303 showed that python-typing-extensions uses the ann* modules. Now that's integrated in upstream cpython, but still shipped on PyPi: https://pypi.org/project/typing-extensions/. So yes, I think these could be removed as well. Please note that Debian/Ubuntu packaging doesn't remove any of these files, but just ships them in a separate binary package, e.g. libpython3.8-testsuite. |
Sorry, something went wrong.
|
@vstinner Regarding the regression test framework(see below for files and directories) what is your opinion? Keeping it or removing it entirely when disabling test suites? Looks buildroot removes it while Ubuntu keeps it. If we decide keeping it, some of the test extension modules(_testcapi and _testinternalcapi) have to be kept as well because test.support needs to import them.
|
Sorry, something went wrong.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
Sorry, something went wrong.
|
The Fedora package put the following files/directories in the python3-test binary RPM: https://src.fedoraproject.org/rpms/python3.10/blob/master/f/python3.10.spec#_1429 |
Sorry, something went wrong.
|
With the PR and With the PR and Install in Install in Remove Compare the content of the two directories: I atttached the full pr23886_files.diff to https://bugs.python.org/issue27640 |
Sorry, something went wrong.
|
Good: this PR does not remove any file/directory by default (compared to the master branch). It works as expected. |
Sorry, something went wrong.
|
On Fedora, the The
|
Sorry, something went wrong.
On Debian, Ubuntu or Fedora, it's just a matter of putting the right dependency on the libpython3.8-testsuite (python3-test on Fedora) package.
This PR is not intended for general Linux distributions like Debian or Fedora, but specialized embedded devices. Xavier created https://bugs.python.org/issue27640 when he worked on putting Python on Android. The buildroot is also intended to be used to produce an image for an embedded devices. The use case is to ship an image for end users who will not run any test but use a "finished" product. For developers, well, just don't use |
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-Authored-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
I tested again the PR, at commit 9e5dada. I rebased locally the PR on master. The PR works as expected! Install Python 3 times:
First test: ensure that the PR still copy exactly the same files: good, there is zero difference! Second test: check that --disable-test-modules don't install tests. Good! Test C extension are not built nor installed and test subdirectories are not installed, as expected. |
Sorry, something went wrong.
|
Thank you @pxinwr for your multiple updates, the final PR is much better. The change is now properly documented (NEWS entry, What's New in Python 3.10 entry), the option is properly documented directly in configure (it says exactly what it does), it's better than Xavier's initial patch and the Thoma's buildbroot patch since it also doesn't build test extensions. And overall, I think that it's a reasonable build option, it makes sense to not install tests on a small "embedded device". |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot s390x Fedora 3.x has failed when building commit 277ce30. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/223/builds/528 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/asyncio/unix_events.py", line 1302, in _do_waitpid
loop, callback, args = self._callbacks.pop(pid)
KeyError: 3703654
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_asyncio/test_subprocess.py", line 169, in test_start_new_session
self.assertEqual(exitcode, 8)
AssertionError: 255 != 8
|
Sorry, something went wrong.
Added --disable-test-modules option to the configure script: don't build nor install test modules. Patch by Xavier de Gaye, Thomas Petazzoni and Peixing Xin. Co-Authored-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
Test modules under Lib directory are used for internal CPython regression testing. Shipping them in formal release is not necessary. So to reduce package size and build and installation time, we should provide an option in configure to disable them.
https://bugs.python.org/issue27640