Bug 2078414 - python-parso fails to build with Python 3.11: NameError: name 'STRING' is not defined
Summary: python-parso fails to build with Python 3.11: NameError: name 'STRING' is not...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-parso
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2078744
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-04-25 09:25 UTC by Tomáš Hrnčiar
Modified: 2022-04-26 20:23 UTC (History)
5 users (show)

Fixed In Version: python-parso-0.8.3-2.fc37
Clone Of:
Environment:
Last Closed: 2022-04-26 20:23:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2022-04-25 09:25:43 UTC
python-parso fails to build with Python 3.11.0a7.

=================================== FAILURES ===================================
________________ [doctest] parso.python.token.PythonTokenTypes _________________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> PythonTokenTypes(TokenType(STRING))
UNEXPECTED EXCEPTION: NameError("name 'STRING' is not defined")
Traceback (most recent call last):
  File "/usr/lib64/python3.11/doctest.py", line 1346, in __run
    exec(compile(example.source, filename, "single",
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<doctest parso.python.token.PythonTokenTypes[1]>", line 1, in <module>
NameError: name 'STRING' is not defined
/builddir/build/BUILD/parso-0.8.3/parso/python/token.py:None: UnexpectedException

https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04304224-python-parso/

For all our attempts to build python-parso with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-parso/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Carl George 🤠 2022-04-25 23:56:21 UTC
I was thinking that removing the `--doctest-modules` flag [0] would be sufficient to resolve this.  I did that in a PR [1], but the resulting COPR build [2] failed.  The normal scratch build (using Python 3.10) [3] failed also.  A Python 3.10 local build is working for me.  I'm not sure what's going on here.


[0] https://github.com/davidhalter/parso/blob/v0.8.3/pytest.ini#L2
[1] https://src.fedoraproject.org/rpms/python-parso/pull-request/4
[2] https://copr.fedorainfracloud.org/coprs/g/python/python3.11/build/4325970/
[3] https://koji.fedoraproject.org/koji/taskinfo?taskID=86228456

Comment 2 Miro Hrončok 2022-04-26 06:40:13 UTC
(In reply to Carl George 🤠 from comment #1)
> ...I did that in a PR [1], but the resulting COPR
> build [2] failed.  The normal scratch build (using Python 3.10) [3] failed
> also.  A Python 3.10 local build is working for me.  I'm not sure what's
> going on here.
> 
> 
> [1] https://src.fedoraproject.org/rpms/python-parso/pull-request/4
> [2]
> https://copr.fedorainfracloud.org/coprs/g/python/python3.11/build/4325970/
> [3] https://koji.fedoraproject.org/koji/taskinfo?taskID=86228456

IMHO this is an RPM 4.18 regression wrt %generate_buildrequires.

Comment 3 Miro Hrončok 2022-04-26 06:41:38 UTC
Try (even on branch rawhide, without your PR):

$ mock -r fedora-rawhide-x86_64 clean 
$ mock -r fedora-rawhide-x86_64 --scrub=all
$ fedpkg --release rawhide mockbuild -N --enablerepo=local

Or see https://koschei.fedoraproject.org/package/python-parso

Comment 4 Fedora Update System 2022-04-26 20:12:36 UTC
FEDORA-2022-9295c2519a has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-9295c2519a

Comment 5 Fedora Update System 2022-04-26 20:23:54 UTC
FEDORA-2022-9295c2519a has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.