pypy3compile errors during postinst confuses user

Bug #1962018 reported by Robert C Jennings
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dh-python (Ubuntu)
New
Undecided
Unassigned

Bug Description

Could you add some clarifying output in the postinst around pypy3compile failures to give context to an end user? The errors as they stand don't indicate that this is pyp3 specific and can be concerning (they also give the impression that QA isn't catching basic python bugs which isn't the case).

pypy3 support was added to dh-python3 towards the end of 2018 as "WIP" such that postinst will call `pypy3compile $PACKAGE || true` to ignore errors if pypy3 is installed. I was talking with a user that saw this fail when installing an update for python3-software-properties and the error message was cause for concern and confusion, for that package it looked like this:

Setting up python3-software-properties (0.99.19) ...
Failed to byte-compile /usr/lib/python3/dist-packages/softwareproperties/extendedsourceslist.py: File "/usr/lib/python3/dist-packages/softwareproperties/extendedsourceslist.py", line 436
    def __init__(self, sourceslist=None, /, files=None):
                                         ^
SyntaxError: invalid syntax (expected ')')

That's all fine, the author has introduced the positional-only parameter (PEP570) new to python 3.8 and that's supported in cpython shipped by default in the distro, but it isn't supported by pypy3. I think it's reasonable for the maintainer of a package to decide that they want to use new features and that they might not have testing with pypy3 installed as a requirement.

The fact that the failure is pypy3compile and not python3compile isn't communicated for the failure nor that it's optional. The user might think that the package is broken for the default interpreter.

Would you consider adding a message before each compilation step to call out which interpreter is byte-compiling the module as well as pypy3 being optional/best-effort and may fail? Preferably you might also indicate the impact (i.e. the package is usable with the system python3 interpreter but pypy3) to set expectations with the end user. Thank you Piotr!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.