Bug 2328016 - python-mccabe fails to build with Python 3.14: test_idempotent_any_syntatically_valid_python fails
Summary: python-mccabe fails to build with Python 3.14: test_idempotent_any_syntatical...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-mccabe
Version: 43
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-22 11:22 UTC by Karolina Surma
Modified: 2025-08-27 21:38 UTC (History)
5 users (show)

Fixed In Version: python-mccabe-0.7.0-13.fc43
Clone Of:
Environment:
Last Closed: 2025-08-27 21:38:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github PyCQA mccabe issues 113 0 None open Test failure on 3.14 2024-11-22 16:04:48 UTC

Description Karolina Surma 2024-11-22 11:22:14 UTC
python-mccabe fails to build with Python 3.14.0a2.

==================================== ERRORS ====================================
_______________________ ERROR collecting test_mccabe.py ________________________
test_mccabe.py:11: in <module>
    import hypothesmith
/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'
=========================== short test summary info ============================
ERROR test_mccabe.py - AttributeError: module 'typing' has no attribute 'Byte...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.46s ===============================

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/08300773-python-mccabe/

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

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 Tom.Rix 2024-11-22 14:41:39 UTC
There is no more recent release than 0.7
The github https://github.com/pycqa/mccabe, has had no recent update than a year.

Comment 2 Karolina Surma 2025-01-29 14:10:35 UTC
With Python 3.14.0a4 the failure is different and goes through hypothesis, hypothesmith to libcst.
The issue will likely be in the used libraries.

=================================== FAILURES ===================================
________________ test_idempotent_any_syntatically_valid_python _________________
  + Exception Group Traceback (most recent call last):
  |   File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 341, in from_call
  |     result: TResult | None = func()
  |                              ~~~~^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 242, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_hooks.py", line 513, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_manager.py", line 120, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 182, in _multicall
  |     return outcome.get_result()
  |            ~~~~~~~~~~~~~~~~~~^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_result.py", line 100, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 167, in _multicall
  |     teardown.throw(outcome._exception)
  |     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/usr/lib/python3.14/site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
  |     yield
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 167, in _multicall
  |     teardown.throw(outcome._exception)
  |     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/usr/lib/python3.14/site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
  |     yield
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 167, in _multicall
  |     teardown.throw(outcome._exception)
  |     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/logging.py", line 846, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/usr/lib/python3.14/site-packages/_pytest/logging.py", line 829, in _runtest_for
  |     yield
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 167, in _multicall
  |     teardown.throw(outcome._exception)
  |     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/capture.py", line 880, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 167, in _multicall
  |     teardown.throw(outcome._exception)
  |     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/usr/lib/python3.14/site-packages/_pytest/runner.py", line 174, in pytest_runtest_call
  |     item.runtest()
  |     ~~~~~~~~~~~~^^
  |   File "/usr/lib/python3.14/site-packages/_pytest/python.py", line 1627, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_hooks.py", line 513, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_manager.py", line 120, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/usr/lib/python3.14/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/usr/lib/python3.14/site-packages/_pytest/python.py", line 159, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |   File "/builddir/build/BUILD/python-mccabe-0.7.0-build/mccabe-0.7.0/test_mccabe.py", line 245, in test_idempotent_any_syntatically_valid_python
  |     max_examples=1000,  # roughly 1k tests/minute, or half that under coverage
  |                ^^^
  |   File "/usr/lib/python3.14/site-packages/hypothesis/core.py", line 1787, in wrapped_test
  |     raise the_error_hypothesis_found
  | ExceptionGroup: Hypothesis found 2 distinct failures. (2 sub-exceptions)
  | Highest target scores:
  |                1  (label='(hypothesmith from_node) number of unique ast node types')
  |                1  (label='(hypothesmith from_node) total number of ast nodes')
  |                1  (label='(hypothesmith) number of unique ast node types')
  |                1  (label='(hypothesmith) total number of ast nodes')
  |                3  (label='(hypothesmith from_node) instructions in bytecode')
  |                3  (label='(hypothesmith) instructions in bytecode')
  | 
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/lib/python3.14/site-packages/hypothesmith/cst.py", line 123, in builds_filtering
    |     return draw(st.builds(t, **kwargs))
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/core.py", line 987, in do_draw
    |     kwargs = {k: data.draw(v) for k, v in self.kwargs.items()}
    |                  ~~~~~~~~~^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/deferred.py", line 87, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/strategies.py", line 684, in do_draw
    |     return data.draw(strategy)
    |            ~~~~~~~~~^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/collections.py", line 196, in do_draw
    |     result.append(data.draw(self.element_strategy))
    |                   ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/strategies.py", line 684, in do_draw
    |     return data.draw(strategy)
    |            ~~~~~~~~~^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/core.py", line 1775, in do_draw
    |     return self.definition(data.draw, *self.args, **self.kwargs)
    |            ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesmith/cst.py", line 123, in builds_filtering
    |     return draw(st.builds(t, **kwargs))
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/core.py", line 987, in do_draw
    |     kwargs = {k: data.draw(v) for k, v in self.kwargs.items()}
    |                  ~~~~~~~~~^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/deferred.py", line 87, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/strategies.py", line 684, in do_draw
    |     return data.draw(strategy)
    |            ~~~~~~~~~^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/core.py", line 1775, in do_draw
    |     return self.definition(data.draw, *self.args, **self.kwargs)
    |            ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesmith/cst.py", line 123, in builds_filtering
    |     return draw(st.builds(t, **kwargs))
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.14/site-packages/hypothesis/strategies/_internal/core.py", line 989, in do_draw
    |     obj = self.target(*args, **kwargs)
    |   File "<string>", line 6, in __init__
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/base.py", line 117, in __post_init__
    |     self._validate()
    |     ~~~~~~~~~~~~~~^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/statement.py", line 390, in _validate
    |     if small_stmt.semicolon is None:
    |        ^^^^^^^^^^^^^^^^^^^^
    | AttributeError: 'int' object has no attribute 'semicolon'
    | while generating 'src_contents' from one_of(<hypothesmith.syntactic.GrammarStrategy object at 0x7f5d9c53dbe0>, builds_filtering(Module).map(lambda n: libcst.Module([n]).code).filter(compilable).map(record_targets))
    | Explanation:
    |     These lines were always and only run by failing examples:
    |         /usr/lib64/python3.14/site-packages/libcst/_nodes/statement.py:388
    |         /usr/lib64/python3.14/site-packages/libcst/_nodes/whitespace.py:130
    |         /usr/lib64/python3.14/site-packages/libcst/_nodes/whitespace.py:93
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/usr/lib/python3.14/site-packages/hypothesmith/cst.py", line 278, in <lambda>
    |     code = st.from_type(node).map(lambda n: libcst.Module([n]).code).filter(compilable)
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/module.py", line 116, in code
    |     return self.code_for_node(self)
    |            ~~~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/module.py", line 136, in code_for_node
    |     node._codegen(state)
    |     ~~~~~~~~~~~~~^^^^^^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/base.py", line 300, in _codegen
    |     self._codegen_impl(state, **kwargs)
    |     ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/module.py", line 99, in _codegen_impl
    |     stmt._codegen(state)
    |     ~~~~~~~~~~~~~^^^^^^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/base.py", line 300, in _codegen
    |     self._codegen_impl(state, **kwargs)
    |     ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
    |   File "/usr/lib64/python3.14/site-packages/libcst/_nodes/module.py", line 99, in _codegen_impl
    |     stmt._codegen(state)
    |     ^^^^^^^^^^^^^
    | AttributeError: 'int' object has no attribute '_codegen'
    | while generating 'src_contents' from one_of(<hypothesmith.syntactic.GrammarStrategy object at 0x7f5d9c53dbe0>, builds_filtering(Module).map(lambda n: libcst.Module([n]).code).filter(compilable).map(record_targets))
    +------------------------------------
=============================== warnings summary ===============================
test_mccabe.py:248
  /builddir/build/BUILD/python-mccabe-0.7.0-build/mccabe-0.7.0/test_mccabe.py:248: HypothesisDeprecationWarning: `HealthCheck.all()` is deprecated; use `list(HealthCheck)` instead.
      The `hypothesis codemod` command-line tool can automatically refactor your code to fix this warning.
    suppress_health_check=HealthCheck.all(),  # this is slow and filter-heavy.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED test_mccabe.py::test_idempotent_any_syntatically_valid_python - Except...
=================== 1 failed, 15 passed, 1 warning in 5.32s ====================

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

Comment 4 Karolina Surma 2025-03-07 12:29:03 UTC
Reported to LibCST https://github.com/Instagram/LibCST/issues/1302, in the meanwhile I've got a successful build of mccabe without tests.


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