Repository navigation
Conversation
CodSpeed Performance ReportMerging #1190 will not alter performanceComparing Summary
|
asvetlov
left a comment
There was a problem hiding this comment.
#1185 (review) review has a lot of comments that are not applied to this PR yet.
Could you please address it, or should I move these comments to the PR?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Tomorrow Or Later I will see about tracking down the gc/weakref bug. |
|
@asvetlov I'm back. I woke up. I ran pre-commit install inside my env. |
|
@asvetlov When I run pre-commit run --all-files here's what I get |
|
Ok so it appears all I have left is documentation according to the linter this should be an easy one to fix seems I had some spelling errors when I was writing late at night. |
|
@asvetlov It's failing to built the wheels for mac-os for some strange reason but I will wait for you to get back before I do anything else... |
|
@asvetlov Workflow seems to be ignore testcapi but I'm sure you'll find a way to get it to run. |
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (0.43%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## capi #1190 +/- ##
==========================================
- Coverage 97.57% 96.12% -1.46%
==========================================
Files 28 28
Lines 4125 4335 +210
Branches 736 738 +2
==========================================
+ Hits 4025 4167 +142
- Misses 52 119 +67
- Partials 48 49 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sorry, this evening I was busy preparing the 6.5.1 bugfix release. |
|
So I have a theory on what caused multidict/multidict/_multilib/capsule.h Line 33 in ddbbf68 The problem may be tied to how Multidict is setup to first allocate memory. multidict/multidict/_multidict.c Line 911 in ddbbf68 Looking at PyObject *
PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
return type->tp_alloc(type, 0);
}Replacing
My bad I'll wait for tomorrow, I apologize. |
Yes, you are right. Better to call |
|
@asvetlov I'll leave the rest to you now, now that I've replaced the |
|
Ok. |
Alright, makes sense I'll see about removing this one here in a bit. |
|
@asvetlov I'm going to see about resolving a few conflicts today with this repo and |
|
@asvetlov I'll make sure your done with your benchmarks pr and then I will proceed. |
|
I've done, benchmarks are stable now. |
|
@asvetlov Sounds good let me sync what I need to sync |
…hnical _testcapi setup
…hnical _testcapi setup
|
I have to get off to work today but I should be back in 7-8 hours but if anybody wants to try and disabling 3.13t from trying to install cffi and seeing if testcapi passes on all other systems and then merge the pull-request if it all of it passes be my guest. |
|
@asvetlov I came up with a temporary solution for CFFI 2.0.0 on 3.13t, I'll revert the workflow script when it's done but just know this can come back to bite us later if were not careful with how this hack is used... |
|
Question: Is this PR still ongoing or should I consider doing a rewrite for it? |
|
Superseded by #1480 |
<!-- Thank you for your contribution! --> ## What do these changes do? Adds a public C API capsule (`multidict._multidict.CAPI`, reached through `multidict_capi.h` / `multidict_capi_struct.h`) so other C extensions can create and manipulate `MultiDict`, `CIMultiDict`, their proxies, and `istr` directly, without going through the Python-level API. Covers type checks and constructors for all four mapping types plus `istr`, `getversion()` and `len()`, and `add()`, `clear()`, `setdefault()`, and single-item access (`in`, `[]`, `del`, `pop()`) for the mutable types. `GetItem`, `Pop`, and `SetDefault` follow the `PyDict_GetItemRef` / `PyDict_SetDefaultRef` design, reporting a missing key through the return code rather than an exception. `MultiDict_ForEach` visits every item, or just the items for one key, through a callback, without allocating a list. The same capsule is also reachable from Cython: `multidict/__init__.pxd` lets third-party Cython code `cimport multidict`, mirrored by a `multidict/_testcyapi.pyx` test harness. Cython is optional and never a real dependency of `multidict` itself; an ordinary or release build never sees it, and a dedicated CI job exercises the opt-in path. ## Are there changes in behavior for the user? No behavior change for existing Python-level usage. This adds a new, opt-in C API surface for other C extensions and Cython code to use. ## Is it a substantial burden for the maintainers to support this? The struct only ever grows at the end, so older clients keep working against newer `multidict` builds. The Cython binding is test-only and opt-in, so it adds no ongoing dependency burden. ## Related issue number Supersedes and closes #1183, #1190, #1191 (earlier C API drafts). ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes exist - [x] Documentation reflects the changes - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` - [x] Add a new news fragment into the `CHANGES/` folder - [x] `make doc-spelling` passes and any new technical words are added to `docs/spelling_wordlist.txt` <details> <summary>Agent run details (optional, for reviewers)</summary> Tests: `pytest -q` on both the accelerated build (with and without the Cython opt-in) and the pure-Python build (`MULTIDICT_NO_EXTENSIONS=1`); `tests/test_capi.py`'s `api` fixture runs every case against both the C and Cython bindings when Cython is opted in. Lint: `pre-commit run --all-files` (ruff, mypy for 3.13/3.11, yamllint, clang-format, GitHub Actions validators) clean. Docs: strict Sphinx HTML build and `doc-spelling` clean. Drafted with Claude Code (Sonnet 5); reviewed by asvetlov. </details> --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
What do these changes do?
The summary of #1185 should suffice but basically the pr was accidently merged then deleted luckily I had a backup of the original code on hand so that we can resume where we left off.
Are there changes in behavior for the user?
Changes mainly will involve everything explained in #1185 but given with some better details and other suggestions from other contributors will go into this one.
Related issue number
Checklist