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 1929197 - python-black fails to build with Python 3.10: AssertionError: 123 != 0
Summary: python-black fails to build with Python 3.10: AssertionError: 123 != 0
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-black
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Christian Heimes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-02-16 12:49 UTC by Tomáš Hrnčiar
Modified: 2021-04-28 16:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-28 16:53:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-02-16 12:49:26 UTC
python-black fails to build with Python 3.10.0a5.

======================================================================
FAIL: test_check_diff_use_together (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/builddir/build/BUILD/black-20.8b1/tests/test_black.py", line 1483, in test_check_diff_use_together
    self.invokeBlack([str(src1), "--diff", "--check"], exit_code=1)
  File "/builddir/build/BUILD/black-20.8b1/tests/test_black.py", line 196, in invokeBlack
    self.assertEqual(
AssertionError: 123 != 1 : Failed with args: ['--verbose', '--config', '/builddir/build/BUILD/black-20.8b1/tests/empty.toml', '/builddir/build/BUILD/black-20.8b1/tests/data/string_quotes.py', '--diff', '--check']
stdout: ''
stderr: 'Traceback (most recent call last):\n  File "/builddir/build/BUILD/black-20.8b1/src/black/__init__.py", line 670, in reformat_one\n    if changed is not Changed.CACHED and format_file_in_place(\n  File "/builddir/build/BUILD/black-20.8b1/src/black/__init__.py", line 826, in format_file_in_place\n    if write_back == write_back.COLOR_DIFF:\n  File "/usr/lib64/python3.10/enum.py", line 146, in __get__\n    raise AttributeError(\nAttributeError: WriteBack: no attribute \'COLOR_DIFF\'\nerror: cannot format /builddir/build/BUILD/black-20.8b1/tests/data/string_quotes.py: WriteBack: no attribute \'COLOR_DIFF\'\nOh no! 💥 💔 💥\n1 file would fail to reformat.\n'
exception: 123

======================================================================
FAIL: test_expression_diff (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/black-20.8b1/tests/test_black.py", line 441, in test_expression_diff
    self.assertEqual(result.exit_code, 0)
AssertionError: 123 != 0

======================================================================
FAIL: test_expression_diff_with_color (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/black-20.8b1/tests/test_black.py", line 469, in test_expression_diff_with_color
    self.assertIn("\033[1;37m", actual)
AssertionError: '\x1b[1;37m' not found in ''

======================================================================
FAIL: test_no_cache_when_writeback_diff (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/black-20.8b1/tests/test_black.py", line 1392, in test_no_cache_when_writeback_diff
    self.invokeBlack([str(src), "--diff"])
  File "/builddir/build/BUILD/black-20.8b1/tests/test_black.py", line 196, in invokeBlack
    self.assertEqual(
AssertionError: 123 != 0 : Failed with args: ['--verbose', '--config', '/builddir/build/BUILD/black-20.8b1/tests/empty.toml', '/tmp/tmpkj6asb6m/test.py', '--diff']
stdout: ''
stderr: 'Traceback (most recent call last):\n  File "/builddir/build/BUILD/black-20.8b1/src/black/__init__.py", line 670, in reformat_one\n    if changed is not Changed.CACHED and format_file_in_place(\n  File "/builddir/build/BUILD/black-20.8b1/src/black/__init__.py", line 826, in format_file_in_place\n    if write_back == write_back.COLOR_DIFF:\n  File "/usr/lib64/python3.10/enum.py", line 146, in __get__\n    raise AttributeError(\nAttributeError: WriteBack: no attribute \'COLOR_DIFF\'\nerror: cannot format /tmp/tmpkj6asb6m/test.py: WriteBack: no attribute \'COLOR_DIFF\'\nOh no! 💥 💔 💥\n1 file would fail to reformat.\n'
exception: 123

----------------------------------------------------------------------
Ran 142 tests in 29.672s

FAILED (failures=4, expected failures=3)
Test failed: <unittest.runner.TextTestResult run=142 errors=0 failures=4>
error: Test failed: <unittest.runner.TextTestResult run=142 errors=0 failures=4>

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

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

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.


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