Bug 2270953

Summary: python-colcon-core fails to build with Python 3.13: SystemExit: 2 pytest: error: unrecognized arguments: --bar --baz
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-colcon-coreAssignee: Scott K Logan <logans>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, logans, lrossett, mhroncok
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-colcon-core-0.16.1-1.fc39 python-colcon-core-0.16.1-1.fc38 python-colcon-core-0.16.1-1.el8 python-colcon-core-0.16.1-1.el9 python-colcon-core-0.16.1-1.el7 python-colcon-core-0.16.1-1.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-18 01:11:52 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:36:34 UTC
python-colcon-core fails to build with Python 3.13.0a5.

=================================== FAILURES ===================================
______________________________ test_create_parser ______________________________

    def test_create_parser():
        with ExtensionPointContext():
            parser = create_parser('colcon_core.environment_variable')
    
        parser.add_argument('--foo', nargs='*', type=str.lstrip)
>       args = parser.parse_args(['--foo', '--bar', '--baz'])

test/test_command.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.13/argparse.py:1919: in parse_args
    self.error(msg % ' '.join(argv))
/usr/lib64/python3.13/argparse.py:2695: in error
    self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = CustomArgumentParser(prog='pytest', usage=None, description=None, formatter_class=<class 'colcon_core.command.CustomFormatter'>, conflict_handler='error', add_help=True)
status = 2, message = 'pytest: error: unrecognized arguments: --bar --baz\n'

    def exit(self, status=0, message=None):
        if message:
            self._print_message(message, _sys.stderr)
>       _sys.exit(status)
E       SystemExit: 2

/usr/lib64/python3.13/argparse.py:2682: SystemExit
----------------------------- Captured stderr call -----------------------------
usage: pytest [-h] [--log-base LOG_BASE] [--log-level LOG_LEVEL]
              [--foo [FOO ...]]
pytest: error: unrecognized arguments: --bar --baz
=========================== short test summary info ============================
FAILED test/test_command.py::test_create_parser - SystemExit: 2
=========== 1 failed, 144 passed, 4 skipped, 5 deselected in 14.36s ============

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/07193455-python-colcon-core/

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

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 Fedora Update System 2024-04-09 19:25:38 UTC
FEDORA-2024-f6f61f92ba (COLCON-20240409) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f6f61f92ba

Comment 2 Fedora Update System 2024-04-09 19:25:39 UTC
FEDORA-2024-0c685e4d78 (COLCON-20240409) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-0c685e4d78

Comment 3 Fedora Update System 2024-04-09 19:25:41 UTC
FEDORA-EPEL-2024-e66a664a96 (COLCON-20240409) has been submitted as an update to Fedora EPEL 7.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-e66a664a96

Comment 4 Fedora Update System 2024-04-09 19:25:42 UTC
FEDORA-2024-e092c979d8 (COLCON-20240409) has been submitted as an update to Fedora 38.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-e092c979d8

Comment 5 Fedora Update System 2024-04-09 19:25:43 UTC
FEDORA-EPEL-2024-e2bfa1a43d (COLCON-20240409) has been submitted as an update to Fedora EPEL 8.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-e2bfa1a43d

Comment 6 Scott K Logan 2024-04-09 19:37:37 UTC
The change which broke `colcon-core` in Python 3.13 was actually backported to 3.12 and 3.11 as well. I have released a new version of `colcon-core` which contains the fix on all supported distros.

Comment 7 Fedora Update System 2024-04-10 01:47:17 UTC
FEDORA-2024-0c685e4d78 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-0c685e4d78`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-0c685e4d78

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2024-04-10 01:59:36 UTC
FEDORA-2024-f6f61f92ba has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f6f61f92ba`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f6f61f92ba

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2024-04-10 02:12:34 UTC
FEDORA-EPEL-2024-77431ab983 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-77431ab983

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2024-04-10 02:14:37 UTC
FEDORA-EPEL-2024-e2bfa1a43d has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-e2bfa1a43d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-04-10 02:21:47 UTC
FEDORA-EPEL-2024-e66a664a96 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-e66a664a96

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-04-10 03:08:13 UTC
FEDORA-2024-e092c979d8 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-e092c979d8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-e092c979d8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2024-04-18 01:11:52 UTC
FEDORA-2024-0c685e4d78 (COLCON-20240409) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2024-04-18 01:14:34 UTC
FEDORA-2024-e092c979d8 (COLCON-20240409) has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2024-04-18 01:59:10 UTC
FEDORA-EPEL-2024-e2bfa1a43d (COLCON-20240409) has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2024-04-18 02:01:57 UTC
FEDORA-EPEL-2024-77431ab983 (COLCON-20240409) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2024-04-18 02:17:28 UTC
FEDORA-EPEL-2024-e66a664a96 (COLCON-20240409) has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2024-04-19 21:33:40 UTC
FEDORA-2024-f6f61f92ba (COLCON-20240409) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Leonardo Rossetti 2024-04-25 15:45:07 UTC
The "build logs" link leads to a 404 error, I believe the correct one right now is: https://copr-be.cloud.fedoraproject.org/results/%40python/python3.13/fedora-rawhide-x86_64/07289487-python-colcon-core/

Nitpicking: I see the package name is defined as "Npython-%{srcname}", shouldn't it include the python version as well the same way the subpackages are, such as "python%{python3_pkgversion}..."?

Comment 20 Karolina Surma 2024-04-26 06:50:46 UTC
The naming is correct. The component name shouldn't be versioned unless there's a strong reason to, and it produces a versioned built package. See: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_naming