rstudio / python-builds

an opinionated environment for compiling python
GNU General Public License v3.0
6 stars 2 forks source link

Remove test files from packages #94

Open bschwedler opened 4 months ago

bschwedler commented 4 months ago

see https://rstudioide.zendesk.com/agent/tickets/107245

We ran dpkg-query -L python-3.12.1 in one of our images and found those files in the manifest. They are indeed part of the Python package we build and distribute.

/opt/python/3.12.1/lib/python3.12/test/certdata/__pycache__
/opt/python/3.12.1/lib/python3.12/test/certdata/__pycache__/make_ssl_certs.cpython-312.opt-1.pyc
/opt/python/3.12.1/lib/python3.12/test/certdata/__pycache__/make_ssl_certs.cpython-312.opt-2.pyc
/opt/python/3.12.1/lib/python3.12/test/certdata/__pycache__/make_ssl_certs.cpython-312.pyc
/opt/python/3.12.1/lib/python3.12/test/certdata/allsans.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/badcert.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/badkey.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/capath
/opt/python/3.12.1/lib/python3.12/test/certdata/capath/4e1295a3.0
/opt/python/3.12.1/lib/python3.12/test/certdata/capath/5ed36f99.0
/opt/python/3.12.1/lib/python3.12/test/certdata/capath/6e88d7b8.0
/opt/python/3.12.1/lib/python3.12/test/certdata/capath/99d0fa06.0
/opt/python/3.12.1/lib/python3.12/test/certdata/capath/b1930218.0
/opt/python/3.12.1/lib/python3.12/test/certdata/capath/ceff1710.0
/opt/python/3.12.1/lib/python3.12/test/certdata/ffdh3072.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/idnsans.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/keycert.passwd.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/keycert.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/keycert2.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/keycert3.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/keycert4.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/keycertecc.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/make_ssl_certs.py
/opt/python/3.12.1/lib/python3.12/test/certdata/nokia.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/nosan.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/nullbytecert.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/nullcert.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/pycacert.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/pycakey.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/revocation.crl
/opt/python/3.12.1/lib/python3.12/test/certdata/secp384r1.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/selfsigned_pythontestdotnet.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/ssl_cert.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/ssl_key.passwd.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/ssl_key.pem
/opt/python/3.12.1/lib/python3.12/test/certdata/talos-2019-0758.pem

Per Python’s documentation, these files are bundled as part of Python for regression tests and should not be utilized in any downstream package as they are subject to change. I assume right now these tests are being utilized for testing the resulting build we compile from source for our Python distributions. If necessary, we could follow-up with that group to check if including those files is necessary.

ianpittwood commented 4 months ago

I would assume these tests, not just the certificates, can be removed as a whole from the final distribution since I don't see them present in other distributions like the deadsnakes ones for Ubuntu.