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 1949381 - python-traitlets fails to build with Python 3.10: AssertionError: 'red' != 'Color.red'
Summary: python-traitlets fails to build with Python 3.10: AssertionError: 'red' != 'C...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-traitlets
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-04-14 07:28 UTC by Tomáš Hrnčiar
Modified: 2021-05-30 18:21 UTC (History)
4 users (show)

Fixed In Version: 5.0.5-3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-30 18:21:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ipython traitlets issues 661 0 None open Test fails with python 3.10 2021-04-20 01:55:57 UTC
Github ipython traitlets pull 663 0 None closed Fix string assertion for python3.10 2021-05-12 20:42:49 UTC

Description Tomáš Hrnčiar 2021-04-14 07:28:42 UTC
python-traitlets fails to build with Python 3.10.0a7.

=================================== FAILURES ===================================
________________ TestUseEnum.test_assign_scoped_enum_value_name ________________

self = <traitlets.tests.test_traitlets_enum.TestUseEnum testMethod=test_assign_scoped_enum_value_name>

    def test_assign_scoped_enum_value_name(self):
        # -- CONVERT: string => Enum value (item)
        scoped_names = ["Color.red", "Color.green", "Color.blue", "Color.yellow"]
        for value in scoped_names:
            example = self.Example()
            example.color = value
            self.assertIsInstance(example.color, Color)
>           self.assertEqual(str(example.color), value)
E           AssertionError: 'red' != 'Color.red'
E           - red
E           + Color.red

traitlets/tests/test_traitlets_enum.py:90: AssertionError

There were some changes in repr() in latest alpha of Python 3.10.
https://docs.python.org/3.10/whatsnew/changelog.html#python-3-10-0-alpha-7

bpo-40066: Enum: adjust repr() to show only enum and member name (not value, nor angle brackets) and str() to show only member name. Update and improve documentation to match.

bpo-40066: Enum’s repr() and str() have changed: repr() is now EnumClass.MemberName and str() is MemberName. Additionally, stdlib Enum’s whose contents are available as module attributes, such as RegexFlag.IGNORECASE, have their repr() as module.name, e.g. re.IGNORECASE.
https://bugs.python.org/issue40066

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

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

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.

Comment 1 Miro Hrončok 2021-05-12 20:42:53 UTC
Fix merged upstream: https://github.com/ipython/traitlets/pull/663


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