python-django fails to build with Python 3.10.0a2. FAIL: test_memoryview_content (httpwrappers.tests.HttpResponseTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.1.2/tests/httpwrappers/tests.py", line 372, in test_memoryview_content self.assertEqual(r.content, b'memoryview') AssertionError: b'109101109111114121118105101119' != b'memoryview' This has been fixed upstream: https://github.com/django/django/pull/13648 For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01756925-python-django/ For all our attempts to build python-django with Python 3.10, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-django/ 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.
I tried to build python-django with 4th alpha and it seems like the above problem is not present anymore. But I ran to another test failure: ====================================================================== ERROR: model_enums.tests (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: model_enums.tests Traceback (most recent call last): File "/usr/lib64/python3.10/unittest/loader.py", line 436, in _find_test_path module = self._get_module_from_name(name) File "/usr/lib64/python3.10/unittest/loader.py", line 377, in _get_module_from_name __import__(name) File "/builddir/build/BUILD/Django-3.1.5/tests/model_enums/tests.py", line 225, in <module> class IPv4Network(ipaddress.IPv4Network, models.Choices): File "/builddir/build/BUILD/Django-3.1.5/django/db/models/enums.py", line 28, in __new__ cls = super().__new__(metacls, classname, bases, classdict) File "/usr/lib64/python3.10/enum.py", line 239, in __new__ enum_class.__bases__ = enum_class.__bases__[1:] #or (object, ) File "/usr/lib64/python3.10/enum.py", line 483, in __setattr__ super().__setattr__(name, value) TypeError: __bases__ assignment: 'IPv4Network' object layout differs from '_NoInitSubclass' https://download.copr.fedorainfracloud.org/results/@python/python3.10/fedora-rawhide-x86_64/01863009-python-django/builder-live.log.gz
Here are new failures with 5th alpha of Python 3.10 (last one should be fixed in upstream). ====================================================================== ERROR: test_integerchoices_functional_api (model_enums.tests.ChoicesTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.1.6/tests/model_enums/tests.py", line 74, in test_integerchoices_functional_api Place = models.IntegerChoices('Place', 'FIRST SECOND THIRD') File "/usr/lib64/python3.10/enum.py", line 598, in __call__ return cls._create_( File "/usr/lib64/python3.10/enum.py", line 738, in _create_ return metacls.__new__(metacls, class_name, bases, classdict, boundary=boundary) TypeError: ChoicesMeta.__new__() got an unexpected keyword argument 'boundary' ====================================================================== ERROR: test_textchoices_functional_api (model_enums.tests.ChoicesTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.1.6/tests/model_enums/tests.py", line 115, in test_textchoices_functional_api Medal = models.TextChoices('Medal', 'GOLD SILVER BRONZE') File "/usr/lib64/python3.10/enum.py", line 598, in __call__ return cls._create_( File "/usr/lib64/python3.10/enum.py", line 738, in _create_ return metacls.__new__(metacls, class_name, bases, classdict, boundary=boundary) TypeError: ChoicesMeta.__new__() got an unexpected keyword argument 'boundary' ====================================================================== FAIL: test_memoryview_content (httpwrappers.tests.HttpResponseTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.1.6/tests/httpwrappers/tests.py", line 372, in test_memoryview_content self.assertEqual(r.content, b'memoryview') AssertionError: b'109101109111114121118105101119' != b'memoryview' ----------------------------------------------------------------------
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34.
I still only see: ====================================================================== FAIL: test_memoryview_content (httpwrappers.tests.HttpResponseTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.1.6/tests/httpwrappers/tests.py", line 372, in test_memoryview_content self.assertEqual(r.content, b'memoryview') AssertionError: b'109101109111114121118105101119' != b'memoryview' ---------------------------------------------------------------------- Ran 13829 tests in 527.276s In the latest Copr build. The upstream fix is included in 3.2a1, bz1917820.
There are some new failures present in first beta. ====================================================================== FAIL: test_dumpdata_proxy_with_concrete (fixtures.tests.FixtureLoadingTests) A warning isn't displayed if a proxy model is dumped with its concrete ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/fixtures/tests.py", line 622, in test_dumpdata_proxy_with_concrete self.assertEqual(len(warning_list), 0) AssertionError: 2 != 0 ====================================================================== FAIL: test_repr_with_deferrable (constraints.tests.UniqueConstraintTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/constraints/tests.py", line 246, in test_repr_with_deferrable self.assertEqual( AssertionError: "<Uni[28 chars], 'bar') name='unique_fields' deferrable=IMMEDIATE>" != "<Uni[28 chars], 'bar') name='unique_fields' deferrable=Deferrable.IMMEDIATE>" - <UniqueConstraint: fields=('foo', 'bar') name='unique_fields' deferrable=IMMEDIATE> + <UniqueConstraint: fields=('foo', 'bar') name='unique_fields' deferrable=Deferrable.IMMEDIATE> ? +++++++++++ ====================================================================== FAIL: test_validators (validators.tests.TestValidators) [URLValidator] (value='http://www.djangoproject.com/\n') ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/validators/tests.py", line 327, in test_validators with self.assertRaises(expected): AssertionError: ValidationError not raised ====================================================================== FAIL: test_validators (validators.tests.TestValidators) [URLValidator] (value='http://[::ffff:192.9.5.5]\n') ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/validators/tests.py", line 327, in test_validators with self.assertRaises(expected): AssertionError: ValidationError not raised ====================================================================== FAIL: test_integerchoices (model_enums.tests.ChoicesTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/model_enums/tests.py", line 51, in test_integerchoices self.assertEqual(repr(Suit.DIAMOND), '<Suit.DIAMOND: 1>') AssertionError: 'Suit.DIAMOND' != '<Suit.DIAMOND: 1>' - Suit.DIAMOND + <Suit.DIAMOND: 1> ? + ++++ ====================================================================== FAIL: test_textchoices (model_enums.tests.ChoicesTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/model_enums/tests.py", line 92, in test_textchoices self.assertEqual(repr(YearInSchool.FRESHMAN), "<YearInSchool.FRESHMAN: 'FR'>") AssertionError: 'YearInSchool.FRESHMAN' != "<YearInSchool.FRESHMAN: 'FR'>" - YearInSchool.FRESHMAN + <YearInSchool.FRESHMAN: 'FR'> ? + +++++++ ---------------------------------------------------------------------- Ran 14608 tests in 553.444s FAILED (failures=6, skipped=1166, expected failures=4)
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla. The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide. You can either build the package in the side tag, with: $ fedpkg build --target=f35-python Or you can the build and we will eventually build it for you. Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away. Thanks. See also https://fedoraproject.org/wiki/Changes/Python3.10 If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.
Enum related changes were reverted in Python 3.10 : https://mail.python.org/archives/list/python-dev@python.org/thread/ZMC67QA2JVQJSWSFWRS6IM6ZX4EK277G/#LSTMFAPSPD3BGZ4D6HQFODXZVB3PLYKF
Django will use the 3.10 repr format irrespective of the revert in stdlib enum : https://github.com/django/django/pull/14624
A new test failure showed up with Python 3.10.0rc1. ====================================================================== FAIL: test_subparser_invalid_option (user_commands.tests.CommandTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib64/python3.10/argparse.py", line 1853, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/usr/lib64/python3.10/argparse.py", line 2065, in _parse_known_args stop_index = consume_positionals(start_index) File "/usr/lib64/python3.10/argparse.py", line 2021, in consume_positionals take_action(action, args) argparse.ArgumentError: argument {foo}: invalid choice: 'test' (choose from 'foo') During handling of the above exception, another exception occurred: django.core.management.base.CommandError: Error: argument {foo}: invalid choice: 'test' (choose from 'foo') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/builddir/build/BUILD/Django-3.2.1/tests/user_commands/tests.py", line 338, in test_subparser_invalid_option with self.assertRaisesMessage(CommandError, msg): File "/usr/lib64/python3.10/contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "/builddir/build/BUILD/Django-3.2.1/django/test/testcases.py", line 693, in _assert_raises_or_warns_cm self.assertIn(expected_message, str(getattr(cm, cm_attr))) AssertionError: "Error: invalid choice: 'test' (choose from 'foo')" not found in "Error: argument {foo}: invalid choice: 'test' (choose from 'foo')"
FEDORA-2022-0cba1bd104 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-0cba1bd104
FEDORA-2022-0cba1bd104 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.