Bug 1914138

Summary: python-cliff fails to build with Python 3.10: argparse output has changed
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-cliffAssignee: Tomáš Hrnčiar <thrnciar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: apevec, infra-sig, jcapitao, kevin, mhroncok, openstack-sig, 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: 2021-06-07 11:36:31 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: 1890881    

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)
cliff.tests.test_help.TestHelp.test_show_help_for_help
----------------------------------------------------------------------
testtools.testresult.real._StringException: Empty attachments:
  stderr
  stdout

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:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01865080-python-cliff/

For all our attempts to build python-cliff with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-cliff/

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.

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:


to:


  options:


I have only recently learned abut this change:

https://bugs.python.org/issue9694
https://bugs.python.org/issue42870

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 Joel Capitao 2021-02-11 10:07:20 UTC
I proposed a patch upstream https://review.opendev.org/c/openstack/cliff/+/775091

Comment 5 Miro Hrončok 2021-06-04 20:15:35 UTC
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/

Comment 6 Miro Hrončok 2021-06-07 10:23:08 UTC
$ repoquery --repo=koji{,-source} --whatrequires python3-cliff --recursive 
5minute-0:0.2.32-9.fc34.noarch
5minute-0:0.2.32-9.fc34.src
ara-0:1.5.6-1.fc35.noarch
ara-0:1.5.6-1.fc35.src
python-aodhclient-0:2.2.0-2.fc35.src
python-bashate-0:2.0.0-3.fc34.src
python-designateclient-0:4.2.0-1.fc35.src
python-gabbi-0:2.0.4-2.fc34.src
python-gnocchiclient-0:7.0.7-2.fc34.src
python-heatclient-0:2.3.0-1.fc35.src
python-jenkins-job-builder-1:3.8.0-1.fc34.src
python-keystoneauth1-0:4.3.1-1.fc35.src
python-keystoneclient-1:4.2.0-1.fc35.src
python-ldappool-0:2.4.0-9.fc34.src
python-magnumclient-0:3.4.0-1.fc35.src
python-manilaclient-0:2.5.0-1.fc35.src
python-mistralclient-0:4.2.0-1.fc35.src
python-mox3-0:1.1.0-2.fc34.src
python-neutronclient-0:7.3.0-1.fc35.src
python-octaviaclient-0:2.3.0-1.fc35.src
python-openstackclient-0:5.5.0-1.fc35.src
python-openstackclient-doc-0:5.5.0-1.fc35.noarch
python-openstacksdk-0:0.55.0-1.fc35.src
python-opnsense-0:0.3.0-2.fc34.src
python-os-client-config-0:2.1.0-3.fc34.src
python-osc-lib-0:2.3.1-1.fc35.src
python-oslo-config-2:8.5.0-1.fc35.src
python-oslo-serialization-0:4.1.0-1.fc35.src
python-oslotest-0:4.4.1-3.fc34.src
python-pymochad-0:0.2.0-2.fc34.src
python-pymod2pkg-0:0.17.1-8.fc34.src
python-saharaclient-0:3.3.0-1.fc35.src
python-stestr-0:2.6.0-8.fc34~bootstrap.src
python-tackerclient-0:1.6.0-1.fc35.src
python-tosca-parser-0:2.1.0-2.fc34.src
python-troveclient-0:7.0.0-1.fc35.src
python-virtualbmc-0:2.2.0-1.fc35.src
python-vitrageclient-0:4.3.0-1.fc35.src
python-zuul-client-0:0.0.4-3.fc35.src
python3-aodhclient-0:2.2.0-2.fc35.noarch
python3-aodhclient-tests-0:2.2.0-2.fc35.noarch
python3-ara-0:1.5.6-1.fc35.noarch
python3-ara-server-0:1.5.6-1.fc35.noarch
python3-ara-tests-0:1.5.6-1.fc35.noarch
python3-barbicanclient-0:5.1.0-1.fc35.noarch
python3-cliff-tablib-0:1.1-23.fc34.noarch
python3-cliff-tests-0:3.7.0-1.fc35.noarch
python3-designateclient-0:4.2.0-1.fc35.noarch
python3-designateclient-tests-0:4.2.0-1.fc35.noarch
python3-epi-0:0.1.2-2.fc34.noarch
python3-gearbox-0:0.2.1-1.fc35.noarch
python3-gnocchiclient-0:7.0.7-2.fc34.noarch
python3-gnocchiclient-tests-0:7.0.7-2.fc34.noarch
python3-heatclient-0:2.3.0-1.fc35.noarch
python3-ironicclient-0:4.3.0-3.fc34.noarch
python3-keystoneclient-tests-1:4.2.0-1.fc35.noarch
python3-magnumclient-0:3.4.0-1.fc35.noarch
python3-magnumclient-tests-0:3.4.0-1.fc35.noarch
python3-manilaclient-0:2.5.0-1.fc35.noarch
python3-mistralclient-0:4.2.0-1.fc35.noarch
python3-neutronclient-0:7.3.0-1.fc35.noarch
python3-neutronclient-tests-0:7.3.0-1.fc35.noarch
python3-octaviaclient-0:2.3.0-1.fc35.noarch
python3-octaviaclient-tests-0:2.3.0-1.fc35.noarch
python3-openstackclient-0:5.5.0-1.fc35.noarch
python3-os-testr-0:2.0.0-3.fc34.noarch
python3-osc-lib-0:2.3.1-1.fc35.noarch
python3-osc-lib-tests-0:2.3.1-1.fc35.noarch
python3-oslo-serialization-tests-0:4.1.0-1.fc35.noarch
python3-pkgwat-0:0.13-8.fc34.noarch
python3-rsdclient-0:1.0.2-3.fc34.noarch
python3-rsdclient-tests-0:1.0.2-3.fc34.noarch
python3-saharaclient-0:3.3.0-1.fc35.noarch
python3-stestr-0:2.6.0-8.fc34~bootstrap.noarch
python3-tackerclient-0:1.6.0-1.fc35.noarch
python3-tackerclient-tests-unit-0:1.6.0-1.fc35.noarch
python3-tosca-parser-0:2.1.0-2.fc34.noarch
python3-troveclient-0:7.0.0-1.fc35.noarch
python3-virtualbmc-0:2.2.0-1.fc35.noarch
python3-virtualbmc-tests-0:2.2.0-1.fc35.noarch
python3-vitrageclient-0:4.3.0-1.fc35.noarch
python3-zaqarclient-0:2.1.0-1.fc35.noarch
resalloc-openstack-0:7-8.fc34.noarch