Bug 2254185 - python-BTrees fails to build with Python 3.13: AttributeError: 'TestResult' object has no attribute '_test_state'
Summary: python-BTrees fails to build with Python 3.13: AttributeError: 'TestResult' o...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: python-zope-testrunner
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-12-12 15:05 UTC by Karolina Surma
Modified: 2024-02-15 23:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-12-12 15:05:58 UTC
python-BTrees fails to build with Python 3.13.0a2.

+ /usr/bin/python3 -m tox --current-env -q --recreate -e py313
/usr/lib/python3.13/site-packages/pkg_resources/__init__.py:2866: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/usr/lib/python3.13/site-packages/pkg_resources/__init__.py:2866: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('repoze')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/usr/lib/python3.13/site-packages/pkg_resources/__init__.py:2866: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('repoze.sphinx')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/usr/lib/python3.13/site-packages/pkg_resources/__init__.py:2345: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('repoze')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(parent)
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
..Traceback (most recent call last):
  File "/usr/bin/zope-testrunner", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/usr/lib/python3.13/site-packages/zope/testrunner/__init__.py", line 31, in run
    failed = run_internal(defaults, args, script_parts=script_parts, cwd=cwd,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/zope/testrunner/__init__.py", line 55, in run_internal
    runner.run()
  File "/usr/lib/python3.13/site-packages/zope/testrunner/runner.py", line 191, in run
    self.run_tests()
  File "/usr/lib/python3.13/site-packages/zope/testrunner/runner.py", line 292, in run_tests
    self.ran += run_layer(self.options, layer_name, layer, tests,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/zope/testrunner/runner.py", line 473, in run_layer
    return run_tests(options, tests, layer_name, failures, errors, skipped,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/zope/testrunner/runner.py", line 399, in run_tests
    test(result)
  File "/usr/lib64/python3.13/unittest/case.py", line 692, in __call__
    return self.run(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 662, in run
    result.stopTest(self)
  File "/usr/lib/python3.13/site-packages/zope/testrunner/runner.py", line 1023, in stopTest
    test.__dict__.update(self._test_state)
                         ^^^^^^^^^^^^^^^^
AttributeError: 'TestResult' object has no attribute '_test_state'
......py313: exit 1 (0.96 seconds) /builddir/build/BUILD/BTrees-5.1> zope-testrunner --test-path=src -vc pid=2189
  py313: FAIL code 1 (0.97 seconds)
  evaluation failed :( (1.02 seconds)

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06726418-python-BTrees/

For all our attempts to build python-BTrees with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-BTrees/

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

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Jerry James 2023-12-12 16:29:12 UTC
The backtrace points to python-zope-testrunner.  Reassigning.

Comment 2 Jerry James 2023-12-12 16:34:17 UTC
Upstream has a partial fix: https://github.com/zopefoundation/zope.testrunner/pull/158.  However, it causes other problems that will need to be addressed.  See https://github.com/zopefoundation/zope.testrunner/issues/157.

Also, even once that is fixed there are other problems: https://github.com/zopefoundation/zope.testrunner/issues/155.

It may be a little while before upstream has fixes for these issues.  In the meantime, test suites that use python-zope-testrunner may fail.  These packages consume python-zope-testrunner:

- python-BTrees
- python-ZConfig
- python-ZEO
- python-ZODB
- python-flexmock
- python-lazr-config
- python-lazr-delegates
- python-persistent
- python-zodbpickle
- python-zope-event
- python-zope-schema
- python-zopeundo

Comment 3 Jerry James 2023-12-12 18:22:41 UTC
I started with upstream's patch and put together a patch that lets python-BTrees build successfully with python 3.13.  Further work may be required, so I will leave this bug open for now, but this should let us make some progress.  Please note any further test failures that look like issues with python-zope-testrunner.

Comment 4 Aoife Moloney 2024-02-15 23:07:42 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.


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