Bug 2026248 - python-autopep8 fails to build with Python 3.11: AssertionError: b'/builddir/build/BUILD/autopep8-1.5.4/auto[160 chars]ze\n' != b''
Summary: python-autopep8 fails to build with Python 3.11: AssertionError: b'/builddir/...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: python-autopep8
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ali Erdinc Koroglu
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2098828 (view as bug list)
Depends On:
Blocks: PYTHON3.11 F37FTBFS F37FailsToInstall 2098899 2098992 2098993
TreeView+ depends on / blocked
 
Reported: 2021-11-24 07:55 UTC by Tomáš Hrnčiar
Modified: 2022-07-04 09:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-04 09:17:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-24 07:55:36 UTC
python-autopep8 fails to build with Python 3.11.0a2.

======================================================================
FAIL: test_in_place_no_modifications_no_writes (test.test_autopep8.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/autopep8-1.5.4/test/test_autopep8.py", line 5570, in test_in_place_no_modifications_no_writes
    self.assertEqual(err, b'')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'/builddir/build/BUILD/autopep8-1.5.4/auto[160 chars]ze\n' != b''

======================================================================
FAIL: test_in_place_no_modifications_no_writes_with_empty_file (test.test_autopep8.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/autopep8-1.5.4/test/test_autopep8.py", line 5582, in test_in_place_no_modifications_no_writes_with_empty_file
    self.assertEqual(err, b'')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'/builddir/build/BUILD/autopep8-1.5.4/auto[160 chars]ze\n' != b''

----------------------------------------------------------------------
Ran 578 tests in 13.605s

FAILED (failures=2, skipped=4)

Removed many old deprecated unittest features:

    TestCase method aliases failUnlessEqual, failIfEqual, failUnless, failIf, failUnlessRaises, failUnlessAlmostEqual, failIfAlmostEqual (deprecated in Python 3.1), assertEquals, assertNotEquals, assert_, assertAlmostEquals, assertNotAlmostEquals, assertRegexpMatches, assertRaisesRegexp (deprecated in Python 3.2), and assertNotRegexpMatches (deprecated in Python 3.5).

    Undocumented and broken TestCase method assertDictContainsSubset (deprecated in Python 3.2).

    Undocumented <unittest.TestLoader.loadTestsFromModule> TestLoader.loadTestsFromModule() parameter use_load_tests (deprecated and ignored since Python 3.2).

    An alias of the TextTestResult class: _TextTestResult (deprecated in Python 3.2).

(Contributed by Serhiy Storchaka in bpo-45162.)

https://bugs.python.org/issue45162
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02984523-python-autopep8/

For all our attempts to build python-autopep8 with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-autopep8/

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

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 2022-02-08 21:26:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Miro Hrončok 2022-06-20 10:17:02 UTC
*** Bug 2098828 has been marked as a duplicate of this bug. ***

Comment 3 Miro Hrončok 2022-06-27 14:52:41 UTC
Hello,

This is the first reminder (step 3 from https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs).

If you know about this problem and are planning on fixing it, please acknowledge so by setting the bug status to ASSIGNED. If you don't have time to maintain this package, consider orphaning it, so maintainers of dependent packages realize the problem.

Comment 4 Matthias Runge 2022-07-01 05:54:12 UTC
Unfortunately, I do not have the time to work on this.

Comment 5 Fedora Admin user for bugzilla script actions 2022-07-01 06:28:21 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 6 Miro Hrončok 2022-07-01 10:43:06 UTC
Hello,

This is the first reminder (step 3 from https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs).

If you know about this problem and are planning on fixing it, please acknowledge so by setting the bug status to ASSIGNED. If you don't have time to maintain this package, consider orphaning it, so maintainers of dependent packages realize the problem.

Comment 7 Ali Erdinc Koroglu 2022-07-01 15:21:27 UTC
Hi, autopep8 returns lib2to3.pgen2 deprecation warning instead of empty bytes-like object in test_in_place_no_modifications_no_write and test_in_place_no_modifications_no_writes_with_empty_file tests.

You can see simple test results below and my patch for pytest and If it's ok I can merge into rawhide.

Patch: https://aekoroglu.fedorapeople.org/python-autopep8/fedora-rawhide/SOURCES/autopep8-lib2to3-deprecation-pytest.patch
COPR: https://copr.fedorainfracloud.org/coprs/aekoroglu/fedora/build/4590300
SPEC: https://download.copr.fedorainfracloud.org/results/aekoroglu/fedora/fedora-rawhide-x86_64/04590332-python-autopep8/python-autopep8.spec

test.py: https://aekoroglu.fedorapeople.org/python-autopep8/fedora-rawhide/SOURCES/test.py

Rawhide
[aekoroglu@rawhide autopep8-1.6.0]$ python test.py 
None b'/home/aekoroglu/rpmbuild/SOURCES/autopep8-1.6.0/autopep8.py:198: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+\n  from lib2to3.pgen2 import tokenize as lib2to3_tokenize\n'

F36
[akoroglu@i9 autopep8-1.6.0]$ python test.py 
None b''

Comment 8 Mamoru TASAKA 2022-07-03 11:17:27 UTC
This issue now causes some chain dependency breakage.

Ali, would you apply your fix and build this package for rawhide?

Comment 9 Mamoru TASAKA 2022-07-03 11:19:27 UTC
c.f. https://github.com/hhatto/autopep8/issues/581
Upstream seems slowly working on this, however I think we Fedora side should add workaround for this if possible.

Comment 10 Ali Erdinc Koroglu 2022-07-04 07:01:47 UTC
Hi Mamoru, it's done.
https://koji.fedoraproject.org/koji/buildinfo?buildID=1996300

Comment 11 Mamoru TASAKA 2022-07-04 08:54:22 UTC
Thank you! Now python-lsp-server is built.

Comment 12 Miro Hrončok 2022-07-04 09:17:04 UTC
Hello,

Please note that this comment was generated automatically. If you feel that this output has mistakes, please contact me via email (mhroncok).

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 37.

Thanks for taking care of it!


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