Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1899947

Summary: pcs fails to build with Python 3.10: AttributeError: type object '_FailedTest' has no attribute 'pcs_test'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: anprice, cfeist, fedora, idevat, mhroncok, mlisik, omular, thrnciar, tojeline
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.7-2.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-26 11:30:19 UTC Type: Bug
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:    
Bug Blocks: 1890881    

Description Tomáš Hrnčiar 2020-11-20 12:37:10 UTC
pcs fails to build with Python 3.10.0a2.

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

======================================================================
ERROR: test_has_all_subclasses_are_dataclasses (pcs_test.tier0.common.interface.test_dto.DatatransferObjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pcs-0.10.7/pcs_test/tier0/common/interface/test_dto.py", line 27, in test_has_all_subclasses_are_dataclasses
    _import_all(pcs.__path__)
  File "/builddir/build/BUILD/pcs-0.10.7/pcs_test/tier0/common/interface/test_dto.py", line 17, in _import_all
    loader.find_module(module_name).load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 470, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 970, in load_module
  File "<frozen importlib._bootstrap_external>", line 795, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 791, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/acl.py", line 1, in <module>
    from pcs import (
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/prop.py", line 4, in <module>
    from pcs import utils
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/utils.py", line 43, in <module>
    from pcs.cli.common import middleware
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/cli/common/middleware.py", line 4, in <module>
    from pcs.cli.reports.output import error
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/cli/reports/__init__.py", line 1, in <module>
    from . import messages, output
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/cli/reports/messages.py", line 447, in <module>
    REPORT_MSG_MAP = _create_report_msg_map()
  File "/builddir/build/BUILD/pcs-0.10.7/pcs/cli/reports/messages.py", line 437, in _create_report_msg_map
    code = report_msg_cls.__annotations__.get(
AttributeError: 'str' object has no attribute '_code'

======================================================================
ERROR: pcs_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
AttributeError: type object '_FailedTest' has no attribute 'pcs_test'

----------------------------------------------------------------------
Ran 4948 tests in 18.942s

FAILED (errors=13)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01772993-pcs/

For all our attempts to build pcs with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/pcs/

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

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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.