Bug 2019408

Summary: python-uri-templates fails to build with Python 3.11: AttributeError: 'VariablesTests' object has no attribute 'assertEquals'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-uri-templatesAssignee: Michele Baldessari <michele>
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: hugovk+redhatbugzilla, mhroncok, michele, sanjay.ankur, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-10 14:17:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1992484, 2016048, 2045102    

Description Tomáš Hrnčiar 2021-11-02 13:55:37 UTC
python-uri-templates fails to build with Python 3.11.0a1.

=================================== FAILURES ===================================
_____________________ VariablesTests.test_explode_modifier _____________________

self = <variables_test.VariablesTests testMethod=test_explode_modifier>

    def test_explode_modifier(self):
        template = 'http://example.com{/x*,y*}/page{/z*}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:63: AttributeError
_________________________ VariablesTests.test_fragment _________________________

self = <variables_test.VariablesTests testMethod=test_fragment>

    def test_fragment(self):
        template = 'http://example.com/{#x,y},{#z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:28: AttributeError
__________________________ VariablesTests.test_label ___________________________

self = <variables_test.VariablesTests testMethod=test_label>

    def test_label(self):
        template = 'http://{.x,y,z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:33: AttributeError
__________________ VariablesTests.test_mixed_expansion_types ___________________

self = <variables_test.VariablesTests testMethod=test_mixed_expansion_types>

    def test_mixed_expansion_types(self):
        template = 'http://{a,b}.com{;c,d}{/e,f}/page{?g,h}{&i,j}{#k,l}'
        vars = uritemplate.variables(template)
        expected_vars = set('abcdefghijkl')
>       self.assertEquals(vars, expected_vars)
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:69: AttributeError
__________________ VariablesTests.test_overlapping_expansion ___________________

self = <variables_test.VariablesTests testMethod=test_overlapping_expansion>

    def test_overlapping_expansion(self):
        template = 'http://{a,b}.com{;a,b}{/a,b}/page{?a,b}{&a,b}{#a,b}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['a', 'b']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:74: AttributeError
________________________ VariablesTests.test_parameter _________________________

self = <variables_test.VariablesTests testMethod=test_parameter>

    def test_parameter(self):
        template = 'http://example.com{;x,y}{;z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:43: AttributeError
__________________ VariablesTests.test_partially_overlapping ___________________

self = <variables_test.VariablesTests testMethod=test_partially_overlapping>

    def test_partially_overlapping(self):
        template = 'http://{.a,b}{/b,c}/{c,d}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['a', 'b', 'c', 'd']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:79: AttributeError
_______________________ VariablesTests.test_path_segment _______________________

self = <variables_test.VariablesTests testMethod=test_path_segment>

    def test_path_segment(self):
        template = 'http://example.com{/x,y}/w{/z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:38: AttributeError
_____________________ VariablesTests.test_prefix_modifier ______________________

self = <variables_test.VariablesTests testMethod=test_prefix_modifier>

    def test_prefix_modifier(self):
        template = 'http://example.com{/x:5,y:7}{/z:2}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:58: AttributeError
__________________________ VariablesTests.test_query ___________________________

self = <variables_test.VariablesTests testMethod=test_query>

    def test_query(self):
        template = 'http://example.com{?x,y,z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:48: AttributeError
____________________ VariablesTests.test_query_continuation ____________________

self = <variables_test.VariablesTests testMethod=test_query_continuation>

    def test_query_continuation(self):
        template = 'http://example.com?a=1&b=2{&x,y}&r=13{&z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:53: AttributeError
_________________________ VariablesTests.test_reserved _________________________

self = <variables_test.VariablesTests testMethod=test_reserved>

    def test_reserved(self):
        template = 'http://example.com/{+x,y}/{+z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:23: AttributeError
__________________________ VariablesTests.test_simple __________________________

self = <variables_test.VariablesTests testMethod=test_simple>

    def test_simple(self):
        template = 'http://example.com/{x,y}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:13: AttributeError
_________________________ VariablesTests.test_simple2 __________________________

self = <variables_test.VariablesTests testMethod=test_simple2>

    def test_simple2(self):
        template = 'http://example.com/{x,y}/{z}'
        vars = uritemplate.variables(template)
>       self.assertEquals(vars, set(['x', 'y', 'z']))
E       AttributeError: 'VariablesTests' object has no attribute 'assertEquals'

test/variables_test.py:18: AttributeError
=========================== short test summary info ============================
FAILED test/variables_test.py::VariablesTests::test_explode_modifier - Attrib...
FAILED test/variables_test.py::VariablesTests::test_fragment - AttributeError...
FAILED test/variables_test.py::VariablesTests::test_label - AttributeError: '...
FAILED test/variables_test.py::VariablesTests::test_mixed_expansion_types - A...
FAILED test/variables_test.py::VariablesTests::test_overlapping_expansion - A...
FAILED test/variables_test.py::VariablesTests::test_parameter - AttributeErro...
FAILED test/variables_test.py::VariablesTests::test_partially_overlapping - A...
FAILED test/variables_test.py::VariablesTests::test_path_segment - AttributeE...
FAILED test/variables_test.py::VariablesTests::test_prefix_modifier - Attribu...
FAILED test/variables_test.py::VariablesTests::test_query - AttributeError: '...
FAILED test/variables_test.py::VariablesTests::test_query_continuation - Attr...
FAILED test/variables_test.py::VariablesTests::test_reserved - AttributeError...
FAILED test/variables_test.py::VariablesTests::test_simple - AttributeError: ...
FAILED test/variables_test.py::VariablesTests::test_simple2 - AttributeError:...
============================== 14 failed in 0.06s ==============================

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).

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/02910777-python-uri-templates/

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

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 Hugo van Kemenade 2022-01-06 13:59:29 UTC
I believe this is the upstream project:

https://github.com/uri-templates/uritemplate-py

And here's the failing code:

https://github.com/uri-templates/uritemplate-py/blob/8e13d804ac8641f3b5948eb208c75465ad649da1/test/variables_test.py#L13

In May 2018 the README was updated to say:

"This repo has been archived; see python-hyper/uritemplate for its replacement."

--> https://github.com/python-hyper/uritemplate (`tox -e py311` passes here)

Comment 2 Ben Cotton 2022-02-08 21:16:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 3 Tomáš Hrnčiar 2022-02-10 14:17:51 UTC
Removal of unittest aliases was reverted in Python 3.11 and will be part of Python 3.12, so the above failure is not present anymore, thus I am closing this bugzilla. However, this will be needed next year though so I encourage you to communicate with the upstream about it.

Comment 4 Tomáš Hrnčiar 2022-02-10 14:18:24 UTC
Removal of unittest aliases was reverted in Python 3.11 and will be part of Python 3.12, so the above failure is not present anymore, thus I am closing this bugzilla. However, this will be needed next year though so I encourage you to communicate with the upstream about it.