Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1817678

Summary: python-astunparse fails to build with Python 3.9: Test failures, different dumps?
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-astunparseAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, igor.raits, mhroncok, mplch, python-sig, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-astunparse-1.6.3-3.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-05 13:42:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1803234, 1803235, 1785415, 1817713, 1844891    

Description Miro Hrončok 2020-03-26 18:35:01 UTC
python-astunparse fails to build with Python 3.9.0a5.

AIL: test_annotations (tests.test_dump.DumpTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/astunparse-1.6.2/tests/common.py", line 331, in test_annotations
    self.check_roundtrip("def f(a : int): pass")
  File "/builddir/build/BUILD/astunparse-1.6.2/tests/test_dump.py", line 24, in check_roundtrip
    self.assertASTEqual(dump1, dump2)
  File "/builddir/build/BUILD/astunparse-1.6.2/tests/test_dump.py", line 18, in assertASTEqual
    self.assertEqual(dump1, dump2)
AssertionError: "Modu[113 chars]ad()), type_comment=None)], vararg=None, kwonl[133 chars]=[])" != "Modu[113 chars]ad()))], kwonlyargs=[], kw_defaults=[], defaul[56 chars]=[])"
Diff is 1031 characters long. Set self.maxDiff to None to see it.

And more similar test failures


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01321080-python-astunparse/

For all our attempts to build python-astunparse with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-astunparse/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-05-25 13:01:19 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.


The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 2 Victor Stinner 2020-05-27 12:27:55 UTC
Python 3.9 has a new ast.unparse() function:
https://docs.python.org/dev/library/ast.html#ast.unparse

This function was Tools/parser/unparse.py script in Python 3.8

https://pypi.org/project/astunparse/ is package based on Tools/parser/unparse.py:
"This is a factored out version of unparse found in the Python source distribution; under Demo/parser in Python 2 and under Tools/parser in Python 3."

It means that ast.unparse() can be used instead of python-astunparse on Python 3.9 and newer. Maybe python-astunparse can be removed once https://fedoraproject.org/wiki/Changes/Python3.9 is implemented.

Comment 3 Miro Hrončok 2020-05-29 07:11:23 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 4 Miro Hrončok 2020-05-29 15:04:10 UTC
*** Bug 1841678 has been marked as a duplicate of this bug. ***

Comment 6 Miro Hrončok 2020-05-29 19:44:07 UTC
I'll work on this later.

Comment 7 Miro Hrončok 2020-06-07 20:54:09 UTC
Reported to upstream https://github.com/simonpercivall/astunparse/issues/56

Comment 8 Miro Hrončok 2020-08-05 13:42:19 UTC
No upstream response so far, backported my fix.