Bug 2328019 - python-libcst fails to build with Python 3.14: AttributeError: module 'typing' has no attribute 'ByteString'
Summary: python-libcst fails to build with Python 3.14: AttributeError: module 'typing...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-libcst
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michel Lind
QA Contact:
URL:
Whiteboard:
Depends On: 2295872
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-22 11:37 UTC by Karolina Surma
Modified: 2025-03-04 15:28 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-03-04 15:28:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-11-22 11:37:57 UTC
python-libcst fails to build with Python 3.14.0a2.

__________________ ERROR collecting libcst/tests/test_fuzz.py __________________
libcst/tests/test_fuzz.py:19: in <module>
    from hypothesmith import from_grammar
/usr/lib/python3.14/site-packages/hypothesmith/__init__.py:3: in <module>
    from hypothesmith.cst import from_node
/usr/lib/python3.14/site-packages/hypothesmith/cst.py:20: in <module>
    from hypothesis.strategies._internal.types import _global_type_lookup
/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/types.py:708: in <module>
    typing.ByteString: st.binary(),  # type: ignore
/usr/lib64/python3.14/typing.py:3831: in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
E   AttributeError: module 'typing' has no attribute 'ByteString'

According to https://docs.python.org/dev/whatsnew/3.14.html#typing

ByteString has been removed from both typing and collections.abc modules.
It had previously raised a DeprecationWarning since Python 3.12.


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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08293438-python-libcst/

For all our attempts to build python-libcst with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-libcst/

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

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Michel Lind 2024-12-04 00:17:05 UTC
Looks like the issue is actually in python-hypothesis, we just triggered it

__________________ ERROR collecting libcst/tests/test_fuzz.py __________________
libcst/tests/test_fuzz.py:19: in <module>
    from hypothesmith import from_grammar
/usr/lib/python3.14/site-packages/hypothesmith/__init__.py:3: in <module>
    from hypothesmith.cst import from_node
/usr/lib/python3.14/site-packages/hypothesmith/cst.py:20: in <module>
    from hypothesis.strategies._internal.types import _global_type_lookup
/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/types.py:708: in <module>
    typing.ByteString: st.binary(),  # type: ignore
/usr/lib64/python3.14/typing.py:3831: in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
E   AttributeError: module 'typing' has no attribute 'ByteString'

Comment 3 Michel Lind 2024-12-04 20:00:32 UTC
(In reply to Miro Hrončok from comment #2)
> https://github.com/HypothesisWorks/hypothesis/commit/
> f34ac1cfb3b972a070a22afcba0f40f2ed455f5a

thanks! I was at an event yesterday and cloning the git repo for hypothesis to triage this kept timing out :)

Comment 4 Aoife Moloney 2025-02-26 13:17:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 5 Karolina Surma 2025-03-04 15:28:36 UTC
python-hypothesis builds successfully now, libcst builds successfully now. Let me close this as notabug.


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