Bug 1908278 - python-sybil fails to build with Python 3.10
Summary: python-sybil fails to build with Python 3.10
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sybil
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-12-16 10:03 UTC by Tomáš Hrnčiar
Modified: 2021-02-09 16:24 UTC (History)
3 users (show)

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


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-12-16 10:03:32 UTC
python-sybil fails to build with Python 3.10.0a3.

=================================== FAILURES ===================================
_____________________________ test_future_imports ______________________________

    def test_future_imports():
        document = document_from_sample('codeblock_future_imports.txt')
        regions = list(CodeBlockParser(['print_function'])(document))
        assert len(regions) == 2
        buffer = StringIO()
        namespace = {'buffer': buffer}
        assert evaluate_region(regions[0], namespace) is None
        assert buffer.getvalue() == (
            'pathalogical worst case for line numbers\n'
        )
        # the future import line drops the firstlineno by 1
        code = compile_codeblock(regions[0].parsed, document.path)
>       assert code.co_firstlineno == 2
E       assert 1 == 2
E         +1
E         -2

tests/test_codeblock.py:47: AssertionError
_________________________________ test_pytest __________________________________

capsys = <_pytest.capture.CaptureFixture object at 0x7f14488a47f0>

    def test_pytest(capsys):
    
        class CollectResults:
            def pytest_sessionfinish(self, session):
                self.session = session
    
        results = CollectResults()
        return_code = pytest_main(['-vvs', join(functional_test_dir, 'pytest')],
                                  plugins=[results])
        assert return_code == 1
        assert results.session.testsfailed == 4
        assert results.session.testscollected == 10
    
        out, err = capsys.readouterr()
        # check we're trimming tracebacks:
        index = out.find('sybil/example.py')
        if index > -1:  # pragma: no cover
            raise AssertionError('\n'+out[index-500:index+500])
    
        out = Finder(out)
        out.then_find('fail.rst::line:1,column:1')
        out.then_find('fail.rst::line:1,column:1 sybil setup session_fixture setup\n'
                      'module_fixture setup\n'
                      'class_fixture setup\n'
                      'function_fixture setup\n'
                      'x is currently: 0\n'
                      'FAILED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('fail.rst::line:6,column:1')
        out.then_find('fail.rst::line:6,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '0smcf PASSED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('fail.rst::line:8,column:1')
        out.then_find('fail.rst::line:8,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '1smcf FAILED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('fail.rst::line:10,column:1')
        out.then_find('fail.rst::line:10,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '2smcf FAILED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('fail.rst::line:12,column:1')
        out.then_find('fail.rst::line:12,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '3smcf PASSED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('fail.rst::line:14,column:1')
        out.then_find('fail.rst::line:14,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      'FAILED function_fixture teardown\n'
                      'class_fixture teardown\n'
                      'module_fixture teardown\n'
                      'sybil teardown 5')
        out.then_find('pass.rst::line:1,column:1')
        out.then_find('pass.rst::line:1,column:1 sybil setup module_fixture setup\n'
                      'class_fixture setup\n'
                      'function_fixture setup\n'
                      '0smcf PASSED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('pass.rst::line:3,column:1')
        out.then_find('pass.rst::line:3,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '1smcf PASSED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('pass.rst::line:5,column:1')
        out.then_find('pass.rst::line:5,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '2smcf PASSED function_fixture teardown\n'
                      'class_fixture teardown')
        out.then_find('pass.rst::line:7,column:1')
        out.then_find('pass.rst::line:7,column:1 class_fixture setup\n'
                      'function_fixture setup\n'
                      '3smcf PASSED function_fixture teardown\n'
                      'class_fixture teardown\n'
                      'module_fixture teardown\n'
                      'sybil teardown 4\n'
                      'session_fixture teardown')
        out.then_find('_ fail.rst line=1 column=1 _')
>       out.then_find(  ">   raise Exception('the start!')")

tests/test_functional.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_functional.Finder object at 0x7f14486290d0>
substring = ">   raise Exception('the start!')"

    def then_find(self, substring):
>       assert substring in self.text[self.index:]
E       assert ">   raise Exception('the start!')" in '_ fail.rst line=1 column=1 ___________________________\n\nexample = <Example path=/builddir/build/BUILD/sybil-2.0.1/t...ine:14,column:1 - Exception: boom!\n========================= 4 failed, 6 passed in 0.03s ==========================\n'

tests/test_functional.py:18: AssertionError
=========================== short test summary info ============================
FAILED tests/test_codeblock.py::test_future_imports - assert 1 == 2
FAILED tests/test_functional.py::test_pytest - assert ">   raise Exception('t...
========================= 2 failed, 46 passed in 0.41s =========================

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

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

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 Ben Cotton 2021-02-09 15:34:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


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