Bug 1789213

Summary: python-nbformat fails to build with Python 3.9
Product: [Fedora] Fedora Reporter: Charalampos Stratakis <cstratak>
Component: python-nbformatAssignee: Orion Poplawski <orion>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, mhroncok, orion, python-sig, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-nbformat-5.0.3-1.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-12 00:57:07 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: 1785415    

Description Charalampos Stratakis 2020-01-09 04:32:03 UTC
python-nbformat fails to build with Python 3.9.0a2.

ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.9/collections/__init__.py)

This is due to Mapping being accessible only from collections.abc with Python 3.9

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

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

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, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 1 Charalampos Stratakis 2020-01-09 04:32:27 UTC
A potential fix:

diff --git a/nbformat/notebooknode.py b/nbformat/notebooknode.py
index 5e1fded..b8b59fa 100644
--- a/nbformat/notebooknode.py
+++ b/nbformat/notebooknode.py
@@ -1,7 +1,7 @@
 """NotebookNode - adding attribute access to dicts"""
 
 from ipython_genutils.ipstruct import Struct
-from collections import Mapping
+from collections.abc import Mapping
 
 
 class NotebookNode(Struct):

Comment 2 Orion Poplawski 2020-01-12 00:57:07 UTC
Looks like this was addressed in 5.0.0.  So hopefully fixed now.

Comment 3 Charalampos Stratakis 2020-01-13 23:35:32 UTC
The issue has been fixed, thanks Orion!