Bug 2261579

Summary: python-mccabe: FTBFS in Fedora rawhide/f40: E NameError: name 'settings' is not defined
Product: [Fedora] Fedora Reporter: Fedora Release Engineering <releng>
Component: python-mccabeAssignee: Orphan Owner <extras-orphan>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gwync, mhroncok, python-packagers-sig, trix
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-mccabe-0.7.0-7.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-02-01 10:50:28 UTC Type: ---
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: 2261945    
Bug Blocks: 2231791    
Attachments:
Description Flags
build.log
none
root.log
none
state.log none

Description Fedora Release Engineering 2024-01-29 21:48:00 UTC
python-mccabe failed to build from source in Fedora rawhide/f40

https://koji.fedoraproject.org/koji/taskinfo?taskID=112391160


For details on the mass rebuild see:

https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
Please fix python-mccabe at your earliest convenience and set the bug's status to
ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks,
python-mccabe will be orphaned. Before branching of Fedora 41,
python-mccabe will be retired, if it still fails to build.

For more details on the FTBFS policy, please visit:
https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/

Comment 1 Fedora Release Engineering 2024-01-29 21:48:06 UTC
Created attachment 2013225 [details]
build.log

file build.log too big, will only attach last 32768 bytes

Comment 2 Fedora Release Engineering 2024-01-29 21:48:11 UTC
Created attachment 2013226 [details]
root.log

file root.log too big, will only attach last 32768 bytes

Comment 3 Fedora Release Engineering 2024-01-29 21:48:14 UTC
Created attachment 2013227 [details]
state.log

Comment 4 Miro Hrončok 2024-01-30 13:42:30 UTC
+ /usr/bin/pytest -v
============================= test session starts ==============================
platform linux -- Python 3.12.1, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/builddir/build/BUILD/mccabe-0.7.0/.hypothesis/examples'))
rootdir: /builddir/build/BUILD/mccabe-0.7.0
plugins: hypothesis-6.96.1
collecting ... collected 0 items / 1 error
==================================== ERRORS ====================================
_______________________ ERROR collecting test_mccabe.py ________________________
/usr/lib/python3.12/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.12/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.12/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/usr/lib/python3.12/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.12/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/usr/lib/python3.12/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/usr/lib/python3.12/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.12/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib64/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
/usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
test_mccabe.py:244: in <module>
    @settings(
E   NameError: name 'settings' is not defined
=========================== short test summary info ============================
ERROR test_mccabe.py - NameError: name 'settings' is not defined
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.74s ===============================


Looking at https://koschei.fedoraproject.org/package/python-mccabe it seems like hypothesis was updated in https://src.fedoraproject.org/rpms/python-hypothesis/c/6f3a3835d18a27efaa5302cba883912502ee1d5c?branch=rawhide without checking for impact.

Comment 5 Miro Hrončok 2024-01-30 13:49:55 UTC
https://github.com/PyCQA/mccabe/blob/0.7.0/test_mccabe.py has:

try:
    import hypothesmith
    from hypothesis import HealthCheck, given, settings, strategies as st
except ImportError:
    hypothesmith = None


Later it has tests decorated with @settings which fails if it was not imported.


The real error is:


>>> import hypothesmith
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.12/site-packages/hypothesmith/__init__.py", line 3, in <module>
    from hypothesmith.cst import from_node
  File "/usr/lib/python3.12/site-packages/hypothesmith/cst.py", line 24, in <module>
    from hypothesmith.syntactic import identifiers
  File "/usr/lib/python3.12/site-packages/hypothesmith/syntactic.py", line 12, in <module>
    from hypothesis.internal.charmap import _union_intervals
ImportError: cannot import name '_union_intervals' from 'hypothesis.internal.charmap' (/usr/lib/python3.12/site-packages/hypothesis/internal/charmap.py)

Comment 6 Miro Hrončok 2024-01-30 14:00:18 UTC
I don't have the capacity for this.

1. upstream should be told about their broken conditional import
2. hypothesmith needs to be fixed/updated/whatever

I orphaned the package.

Comment 7 Gwyn Ciesla 2024-01-30 22:18:54 UTC
1. So upstream apparently knows and isn't concerned.
2. To update hypothesmith requires updating python-libcst. To do so requires either updating the disablement of the rust native library, or unretiring at least one rust crate RPM. I'm working out what to do.

Comment 8 Miro Hrončok 2024-02-01 10:50:28 UTC
Nothing happening here, the package builds fine now when hypothesmith works.

*** This bug has been marked as a duplicate of bug 2261945 ***