Bug 1914138 - python-cliff fails to build with Python 3.10: argparse output has changed
Summary: python-cliff fails to build with Python 3.10: argparse output has changed
Alias: None
Product: Fedora
Classification: Fedora
Component: python-cliff
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
Reported: 2021-01-08 08:23 UTC by Tomáš Hrnčiar
Modified: 2021-02-11 10:07 UTC (History)
7 users (show)

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

Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-01-08 08:23:26 UTC
python-cliff fails to build with Python 3.10.0a4.

FAIL: test_show_help_for_help (cliff.tests.test_help.TestHelp)
testtools.testresult.real._StringException: Empty attachments:

Traceback (most recent call last):
  File "/builddir/build/BUILD/cliff-3.5.0/cliff/tests/test_help.py", line 107, in test_show_help_for_help
    self.assertIn('optional arguments:\n  --version', help_text)
  File "/usr/lib/python3.10/site-packages/testtools/testcase.py", line 397, in assertIn
    self.assertThat(haystack, Contains(needle), message)
  File "/usr/lib/python3.10/site-packages/testtools/testcase.py", line 478, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 'optional arguments:\n  --version' not in "usage: setup.py [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]\n\ntesting\n\noptions:\n  --version            show program's version number and exit\n  -v, --verbose        Increase verbosity of output. Can be repeated.\n  -q, --quiet          Suppress output except warnings and errors.\n  --log-file LOG_FILE  Specify a file to log output. Disabled by default.\n  -h, --help           Show help message and exit.\n  --debug              Show tracebacks on errors.\n\nCommands:\n  complete       print bash completion command\n  help           print detailed help for another command\n  one            Test command.\n  three word command  Test command.\n  two words      Test command.\n"

Ran 204 tests in 0.451s

FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=204 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=204 errors=0 failures=1>

For the build logs, see:

For all our attempts to build python-cliff with Python 3.10, see:

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:

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 Kevin Fenzi 2021-01-11 01:12:47 UTC
Odd. I am not sure why this would be failing in 3.10. 

On 3.9, the 'optional arguments:\n --version' does seem to be there/pass. 

Did python 3.10 change something about optional arguments?

Comment 2 Miro Hrončok 2021-01-11 08:53:46 UTC
Yes indeed the output has changed from:

  optional arguments:



I have only recently learned abut this change:


Comment 3 Ben Cotton 2021-02-09 15:38:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 4 jcapitao 2021-02-11 10:07:20 UTC
I proposed a patch upstream https://review.opendev.org/c/openstack/cliff/+/775091

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