Bug 2466656 - python-hypothesmith fails to build with Python 3.15: AttributeError: 'int' object has no attribute '_codegen' and more (74 tests fail)
Summary: python-hypothesmith fails to build with Python 3.15: AttributeError: 'int' ob...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-hypothesmith
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michel Lind
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.15
TreeView+ depends on / blocked
 
Reported: 2026-05-05 07:25 UTC by Karolina Surma
Modified: 2026-05-05 07:25 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-05-05 07:25:17 UTC
python-hypothesmith fails to build with Python 3.15.0a8.

74 tests fail with the new Python, most commonly with "AttributeError: 'int' object has no attribute <foo>" buried somewhere in the traceback.

_______________________ test_from_node_always_compilable _______________________
  + Exception Group Traceback (most recent call last):
  |   File "/builddir/build/BUILD/python-hypothesmith-0.3.3-build/hypothesmith-0.3.3/tests/test_cst.py", line 78, in test_from_node_always_compilable
  |     def test_from_node_always_compilable(source_code):
  |                    ^^^
  |   File "/usr/lib/python3.15/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:
  |                3  (label='(hypothesmith from_node) number of unique ast node types')
  |                3  (label='(hypothesmith from_node) total number of ast nodes')
  |               10  (label='(hypothesmith from_node) instructions in bytecode')
  | 
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/builddir/build/BUILD/python-hypothesmith-0.3.3-build/BUILDROOT/usr/lib/python3.15/site-packages/hypothesmith/cst.py", line 123, in builds_filtering
    |     return draw(st.builds(t, **kwargs))
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/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.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/deferred.py", line 87, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/strategies.py", line 684, in do_draw
    |     return data.draw(strategy)
    |            ~~~~~~~~~^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/collections.py", line 196, in do_draw
    |     result.append(data.draw(self.element_strategy))
    |                   ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/strategies.py", line 684, in do_draw
    |     return data.draw(strategy)
    |            ~~~~~~~~~^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/core.py", line 1775, in do_draw
    |     return self.definition(data.draw, *self.args, **self.kwargs)
    |            ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/builddir/build/BUILD/python-hypothesmith-0.3.3-build/BUILDROOT/usr/lib/python3.15/site-packages/hypothesmith/cst.py", line 123, in builds_filtering
    |     return draw(st.builds(t, **kwargs))
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_draw
    |     return data.draw(self.wrapped_strategy)
    |            ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/lib/python3.15/site-packages/hypothesis/internal/conjecture/data.py", line 2503, in draw
    |     return strategy.do_draw(self)
    |            ~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib/python3.15/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.15/site-packages/libcst/_nodes/base.py", line 117, in __post_init__
    |     self._validate()
    |     ~~~~~~~~~~~~~~^^
    |   File "/usr/lib64/python3.15/site-packages/libcst/_nodes/statement.py", line 389, in _validate
    |     if small_stmt.semicolon is None:
    |        ^^^^^^^^^^^^^^^^^^^^
    | AttributeError: 'int' object has no attribute 'semicolon'
    | while generating 'source_code' from 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.15/site-packages/libcst/_nodes/statement.py:389
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "/builddir/build/BUILD/python-hypothesmith-0.3.3-build/BUILDROOT/usr/lib/python3.15/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.15/site-packages/libcst/_nodes/module.py", line 116, in code
    |     return self.code_for_node(self)
    |            ~~~~~~~~~~~~~~~~~~^^^^^^
    |   File "/usr/lib64/python3.15/site-packages/libcst/_nodes/module.py", line 136, in code_for_node
    |     node._codegen(state)
    |     ~~~~~~~~~~~~~^^^^^^^
    |   File "/usr/lib64/python3.15/site-packages/libcst/_nodes/base.py", line 299, in _codegen
    |     self._codegen_impl(state, **kwargs)
    |     ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
    |   File "/usr/lib64/python3.15/site-packages/libcst/_nodes/module.py", line 99, in _codegen_impl
    |     stmt._codegen(state)
    |     ~~~~~~~~~~~~~^^^^^^^
    |   File "/usr/lib64/python3.15/site-packages/libcst/_nodes/base.py", line 299, in _codegen
    |     self._codegen_impl(state, **kwargs)
    |     ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
    |   File "/usr/lib64/python3.15/site-packages/libcst/_nodes/module.py", line 99, in _codegen_impl
    |     stmt._codegen(state)
    |     ^^^^^^^^^^^^^
    | AttributeError: 'int' object has no attribute '_codegen'
    | while generating 'source_code' from builds_filtering(Module).map(lambda n: libcst.Module([n]).code).filter(compilable).map(record_targets)
    +------------------------------------
____________________ test_black_autoformatter_from_grammar _____________________
/usr/lib/python3.15/site-packages/black/__init__.py:1517: in assert_equivalent
    src_ast = parse_ast(src)
              ^^^^^^^^^^^^^^
/usr/lib/python3.15/site-packages/black/parsing.py:156: in parse_ast
    raise SyntaxError(first_error)
E   SyntaxError: unexpected EOF while parsing (<unknown>, line 1)

The above exception was the direct cause of the following exception:
tests/test_syntactic.py:64: in test_black_autoformatter_from_grammar
    @example("A#\r#", black.Mode())
                   ^^^
/usr/lib/python3.15/site-packages/hypothesis/core.py:1431: in _raise_to_user
    raise the_error_hypothesis_found
tests/test_syntactic.py:76: in test_black_autoformatter_from_grammar
    result = black.format_file_contents(source_code, fast=False, mode=mode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.15/site-packages/black/__init__.py:1085: in format_file_contents
    check_stability_and_equivalence(
/usr/lib/python3.15/site-packages/black/__init__.py:1059: in check_stability_and_equivalence
    assert_equivalent(src_contents, dst_contents)
/usr/lib/python3.15/site-packages/black/__init__.py:1519: in assert_equivalent
    raise ASTSafetyError(
E   black.parsing.ASTSafetyError: cannot use --safe with this file; failed to parse source file AST: unexpected EOF while parsing (<unknown>, line 1)
E   This could be caused by running Black with an older Python version that does not support new syntax used in your source file.
E   Falsifying explicit example: test_black_autoformatter_from_grammar(
E       source_code='\\',
E       mode=Mode(target_versions=set(),
E        line_length=88,
E        string_normalization=True,
E        is_pyi=False,
E        is_ipynb=False,
E        skip_source_first_line=False,
E        magic_trailing_comma=True,
E        python_cell_magics=set(),
E        preview=False,
E        unstable=False,
E        enabled_features=set()),
E   )

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/10398251-python-hypothesmith/

For all our attempts to build python-hypothesmith with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/python-hypothesmith/

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

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
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.


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