Bug 2432349

Summary: hatch fails to build with Python 3.15: AssertionError: TestUserAgent.test_user_agent_header_format: assert 'Hatch/1.16.3 cpython/3.15.0 HTTPX/0.28.1' == 'Hatch/1.16.3 cpython/3.15.0a5 HTTPX/0.28.1'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: hatchAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, ksurma, mhroncok, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hatch-1.16.3-2.fc44 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-01-23 14:32:24 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: 2412434    

Description Karolina Surma 2026-01-23 12:57:16 UTC
hatch fails to build with Python 3.15.0a5.

_________________ TestUserAgent.test_user_agent_header_format __________________

self = <tests.index.test_core.TestUserAgent object at 0x7ff01ac7bd90>

    def test_user_agent_header_format(self):
        index = PackageIndex("https://foo.internal/a/b/")
        client = index.client
    
        user_agent = client.headers["User-Agent"]
    
        expected = (
            f"Hatch/{__version__} {sys.implementation.name}/{platform.python_version()} HTTPX/{httpx.__version__}"
        )
>       assert user_agent == expected
E       AssertionError: assert 'Hatch/1.16.3 cpython/3.15.0 HTTPX/0.28.1' == 'Hatch/1.16.3 cpython/3.15.0a5 HTTPX/0.28.1'
E         
E         - Hatch/1.16.3 cpython/3.15.0a5 HTTPX/0.28.1
E         ?                            --
E         + Hatch/1.16.3 cpython/3.15.0 HTTPX/0.28.1

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/10047693-hatch/

For all our attempts to build hatch with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/hatch/

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

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
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 Miro Hrončok 2026-01-23 13:33:05 UTC
The difference in the user agent is just "a5". Likely, this would fail the test on any Python pre-release.

Comment 2 Miro Hrončok 2026-01-23 13:35:25 UTC
The test/implementation of this was modified in https://github.com/pypa/hatch/pull/2106/commits/557ed173eae4ffa326e3413e376be1eaed69043a -- and likely needs some adjustments.

Comment 3 Ben Beasley 2026-01-23 14:19:26 UTC
Thanks for the details. That made it easy to report this upstream as https://github.com/pypa/hatch/issues/2167. I’ll skip the test for the time being.

Comment 4 Fedora Update System 2026-01-23 14:29:05 UTC
FEDORA-2026-00f5ee28d2 (hatch-1.16.3-2.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-00f5ee28d2

Comment 5 Fedora Update System 2026-01-23 14:32:24 UTC
FEDORA-2026-00f5ee28d2 (hatch-1.16.3-2.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.