Skip to content

[PR #12321/1aaf43b3 backport][3.14] Add cdef type declarations and inline upgrade check in HTTP parser - #12559

Merged
bdraco merged 1 commit into
3.14from
patchback/backports/3.14/1aaf43b3b620a6e241ba78bbe3cb94cb5115cdfe/pr-12321
May 16, 2026
Merged

bdraco merged 1 commit into
3.14from
patchback/backports/3.14/1aaf43b3b620a6e241ba78bbe3cb94cb5115cdfe/pr-12321

Conversation

@patchback

@patchback patchback Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

This is a backport of PR #12321 as merged into master (1aaf43b).

What do these changes do?

Add cdef type declarations for h_upg and enc local variables in _on_headers_complete, and inline the allowed variable into the conditional check. Noticed while reviewing #11966

Are there changes in behavior for the user?

No behavior changes; this is a minor optimization to help Cython generate better C code.

Is it a substantial burden for the maintainers to support this?

No, this is a small change with no maintenance burden.

Related issue number

N/A

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_or_pr_num>.<type>.rst (e.g. 588.bugfix.rst)

    • if you don't have an issue number, change it to the pull request
      number after creating the PR

      • .bugfix: A bug fix for something the maintainers deemed an
        improper undesired behavior that got corrected to match
        pre-agreed expectations.
      • .feature: A new behavior, public APIs. That sort of stuff.
      • .deprecation: A declaration of future API removals and breaking
        changes in behavior.
      • .breaking: When something public is removed in a breaking way.
        Could be deprecated in an earlier release.
      • .doc: Notable updates to the documentation structure or build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and tooling. Changes in the test invocation considerations and
        runtime assumptions.
      • .contrib: Stuff that affects the contributor experience. e.g.
        Running tests, building the docs, setting up the development
        environment.
      • .misc: Changes that are hard to assign to any of the above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      Use the past tense or the present tense a non-imperative mood,
      referring to what's changed compared to the last released version
      of this project.

@codecov

codecov Bot commented May 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.20%. Comparing base (2a76d8e) to head (7348981).
⚠️ Report is 170 commits behind head on 3.14.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.14   #12559      +/-   ##
==========================================
- Coverage   98.20%   98.20%   -0.01%     
==========================================
  Files         135      135              
  Lines       47211    47210       -1     
  Branches     2533     2533              
==========================================
- Hits        46364    46363       -1     
  Misses        671      671              
  Partials      176      176              
Flag Coverage Δ
CI-GHA 98.25% <ø> (ø)
OS-Linux 98.02% <ø> (ø)
OS-Windows 95.65% <ø> (ø)
OS-macOS 97.20% <ø> (ø)
Py-3.10.11 96.68% <ø> (ø)
Py-3.10.20 97.15% <ø> (ø)
Py-3.11.15 97.44% <ø> (-0.01%) ⬇️
Py-3.11.9 96.97% <ø> (ø)
Py-3.12.10 97.04% <ø> (ø)
Py-3.12.13 97.52% <ø> (ø)
Py-3.13.13 97.73% <ø> (+0.01%) ⬆️
Py-3.14.4 96.97% <ø> (+<0.01%) ⬆️
Py-3.14.5 97.56% <ø> (-0.01%) ⬇️
Py-3.14.5t 96.81% <ø> (ø)
Py-pypy3.11.15-7.3.22 96.65% <ø> (ø)
VM-macos 97.20% <ø> (ø)
VM-ubuntu 98.02% <ø> (ø)
VM-windows 95.65% <ø> (ø)
cython-coverage 38.04% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codspeed

codspeed Bot commented May 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 67 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing patchback/backports/3.14/1aaf43b3b620a6e241ba78bbe3cb94cb5115cdfe/pr-12321 (7348981) with 3.14 (8808809)2

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on 3.14 (2a76d8e) during the generation of this report, so 8808809 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@bdraco
bdraco merged commit bcea105 into 3.14 May 16, 2026
38 of 39 checks passed
@bdraco
bdraco deleted the patchback/backports/3.14/1aaf43b3b620a6e241ba78bbe3cb94cb5115cdfe/pr-12321 branch May 16, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant