Bug 2270950

Summary: python-argcomplete fails to build with Python 3.13: AssertionError: Items in the first set but not the second (failures=13, errors=1)
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-argcompleteAssignee: Sandro <gui1ty>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: chris, gui1ty, igor.raits, ksurma, maxwell, mfabik, mhroncok, msrb, python-packagers-sig, steve.traylen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-argcomplete-3.3.0-2.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-22 17:42:11 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: 2244836    

Description Karolina Surma 2024-03-22 10:18:26 UTC
python-argcomplete fails to build with Python 3.13.0a5.

======================================================================
ERROR: test_repl_parse_after_complete (__main__.TestArgcompleteREPL.test_repl_parse_after_complete)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 934, in test_repl_parse_after_complete
    args = p.parse_args(["--foo", "spam", "bar"])
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/argparse.py", line 1916, in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/argparse.py", line 1949, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
                      ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/argcomplete-3.2.2/argcomplete/packages/_argparse.py", line 299, in _parse_known_args
    start_index = consume_optional(start_index)
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/builddir/build/BUILD/argcomplete-3.2.2/argcomplete/packages/_argparse.py", line 165, in consume_optional
    action, option_string, explicit_arg = option_tuple
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)

======================================================================
FAIL: test_choices (__main__.TestArgcomplete.test_choices)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 179, in test_choices
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--help'
'-h'
'--ship'
Items in the second set but not the first:
'submarine'
'speedboat'

======================================================================
FAIL: test_completers (__main__.TestArgcomplete.test_completers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 300, in test_completers
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--email'
'--help'
'-h'
'--url'
Items in the second set but not the first:
'http://url2'
'http://url1'

======================================================================
FAIL: test_default_completer (__main__.TestArgcomplete.test_default_completer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 424, in test_default_completer
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--one'
'--many'
Items in the second set but not the first:
'test/'

======================================================================
FAIL: test_escape_special_chars (__main__.TestArgcomplete.test_escape_special_chars)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 832, in test_escape_special_chars
    self.assertEqual(set(self.run_completer(make_parser(), "prog -1 ")), {r"bar\<\$\>baz "})
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'-3'
'-1'
'-2'
Items in the second set but not the first:
'bar\\<\\$\\>baz '

======================================================================
FAIL: test_exclusive (__main__.TestArgcomplete.test_exclusive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 773, in test_exclusive
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--no-bar'

======================================================================
FAIL: test_exclusive_class (__main__.TestArgcomplete.test_exclusive_class)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 822, in test_exclusive_class
    self.assertEqual(set(self.run_completer(parser, cmd, completer=completer)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--foo'
'--no-bar'
'--baz'
'--bar'
Items in the second set but not the first:
'baz1'
'baz2'

======================================================================
FAIL: test_filescompleter_filetype_integration (__main__.TestArgcomplete.test_filescompleter_filetype_integration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 378, in test_filescompleter_filetype_integration
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--r'
'--help'
'-h'
'--w'
Items in the second set but not the first:
'abcaha/'
'abcdefж/'
'abcxyz'

======================================================================
FAIL: test_mixed_optional_positional (__main__.TestArgcomplete.test_mixed_optional_positional)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 793, in test_mixed_optional_positional
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--set'
Items in the second set but not the first:
'name1'
'name2'

======================================================================
FAIL: test_non_ascii (__main__.TestArgcomplete.test_non_ascii)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 482, in test_non_ascii
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--книга'
'--help'
'-h'
Items in the second set but not the first:
'Парень\\ из\\ преиÑподней'
'Трудно\\ быть\\ богом'
'Понедельник\\ начинаетÑÑ\\ в\\ Ñубботу'

======================================================================
FAIL: test_optional_nargs (__main__.TestArgcomplete.test_optional_nargs)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 697, in test_optional_nargs
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'--foobar'
'--foo'
'--baz'
'--bar'
'--help'
'--qux'
'-h'
Items in the second set but not the first:
'foo2'
'foo1'

======================================================================
FAIL: test_positional_remainder (__main__.TestArgcomplete.test_positional_remainder)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 717, in test_positional_remainder
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the second set but not the first:
'--opt'
'pos'

======================================================================
FAIL: test_subparser_completers (__main__.TestArgcomplete.test_subparser_completers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 345, in test_subparser_completers
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the second set but not the first:
'val5'

======================================================================
FAIL: test_subparsers (__main__.TestArgcomplete.test_subparsers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-3.2.2/test/test.py", line 451, in test_subparsers
    self.assertEqual(set(self.run_completer(make_parser(), cmd)), set(output))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Items in the first set but not the second:
'eggs'
'--age'
'spam'
Items in the second set but not the first:
'in\\ the\\ rain'
'with\\ a\\ goat'
'on\\ a\\ train'
'on\\ a\\ boat'

----------------------------------------------------------------------
Ran 186 tests in 133.589s

FAILED (failures=13, errors=1, skipped=12, expected failures=5)

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07193429-python-argcomplete/

For all our attempts to build python-argcomplete with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-argcomplete/

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

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Sandro 2024-04-08 14:11:17 UTC
Reported upstream.

Comment 2 Fedora Update System 2024-04-22 15:22:43 UTC
FEDORA-2024-1355f5e0bb (python-argcomplete-3.3.0-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-1355f5e0bb

Comment 3 Fedora Update System 2024-04-22 17:42:11 UTC
FEDORA-2024-1355f5e0bb (python-argcomplete-3.3.0-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.