Cloud sweep: fix ch_func_to_all_pk with *args, partialx reordering, pyproject + uv CI, runnable README - #92
Conversation
|
cloud-status: started — baseline 758/0 failed/2 xfailed; plan: fix #12 ch_func_to_all_pk kwargs (done), fix #17 partialx reordering, #78 if additive, packaging migration own commit, dependents gate (config2py, meshed, ju, dol) Generated by Claude Code |
c2ea1d3 to
85b545c
Compare
ch_func_to_all_pk routed calls through Sig.extract_args_and_kwargs, whose default ignore_kind=True turns every param keyword-only. For a function with *args, that mangled the tupled *args value and dropped the **kwargs extras, so every call failed or lost arguments. For functions with *args, the wrapper now binds to its own all-PK signature and rebuilds the call to the original function (tuple expanded as *args, dict as **kwargs). The **kwargs can be given as extra keywords or by name as a dict. Functions without *args keep master's code path unchanged: meshed's hook_up and FlexFuncFanout rely on its convention (**kwargs given by name as a dict, other extras ignored), and tests now pin it. The signature ch_func_to_all_pk produces is unchanged. Fixes #12
move_params_to_the_end appended the moved names at the very end, which could put a keyword-only param after **kwargs or before a positional one. partialx(partialx, x=2, _allow_reordering=True) hit this and raised "wrong parameter order". The reordered names are now stable-sorted by parameter kind. Every valid signature is already sorted by kind, so only orders that used to raise change; the order within each kind is kept. Fixes #17
Legacy setup.cfg/setup.py become a hatchling pyproject.toml, and the isee-based workflow becomes the wads inline uv workflow. This commit is self-contained so it can be dropped without touching the fixes before it. - Metadata: SPDX license string, description, keywords, classifiers, URLs, requires-python >=3.10 (master already fails to import on 3.9). - Wheel contents are file-for-file identical to the setuptools build. - [tool.wads.ci] mirrors today's CI: Linux only, Python 3.10 and 3.12, doctests, i2/examples and i2/scrap excluded. Metrics off (no config). - Ruff limited to D100, which the package already passes. - Inline workflow rather than the stub, because the stub's Pages job cannot pass the epythet v2 pilot pin, which is kept here. - Dropped i2/tests/test_requirements.txt (read only by the old workflow; the suite never imported its pins) and the unused SCRIPTS_REPOSITORY_URL. Publishing now uses secrets.PYPI_PASSWORD as a PyPI API token.
Seven README python examples failed when run: wrong Wrap ingress return shape, Ingress used as a decorator, next() without a default, undefined names, and attribute access on imdict. They now run, and i2/tests/test_readme.py executes every README python block in order so they can't silently break again. Also: a README pointer for agents to .claude/CLAUDE.md and the skills, a "For carbon-based contributors" section with dev setup and the dependents rule, and CLAUDE.md updated for the pyproject/uv CI setup and test count. Fixes #94
85b545c to
ce64cc6
Compare
|
cloud-status: done — tests 758 → 785 passed (2 xfailed); dependents unchanged; Opus review APPROVE; CI green; fixes #12, #17, #94 (filed); filed #93; needs-local #43, #78, #93; left for local landing (includes the pyproject + uv CI migration, so its publish path is untested) Generated by Claude Code |
thorwhalen
left a comment
There was a problem hiding this comment.
Review from the local session that decided #78 and #93 (with a use-site inventory across i2's dependents and a test sweep).
Verdict on this PR's approach: confirmed, and built on. The *args path of ch_func_to_all_pk and the _args_and_kwargs_from_all_pk_arguments helper are kept exactly as they are; tuple_the_args now uses the same helper (#93 part 1), so the two functions share one rebuild path. The one thing this PR left as "not yet handled", a required keyword-only after *args, is handled in all_pk_signature (#93 part 2) and needed no change to this PR's call path. #78 is resolved by dropping a source *args in replace_kwargs_using. The decisions and evidence are on the two issues.
How it lands. This PR is merged first, as is (CI green on 3.10/3.12, Opus review APPROVE, dependents gate in the body). The follow-up branch fix-variadics-all-pk is stacked on it and is landed right after, as its own PR, with the dependents sweep re-run on the combined result.
One note for the record: with *args, excess keyword arguments are merged into **kwargs; without *args, they are ignored (what meshed's hook_up relies on). That asymmetry is pinned by this PR's tests and left as is; it isn't in scope of #78 or #93, and is now tracked in #95.
Tests
Command (from the repo root):
The CI-equivalent command also gives 785 passed:
--cov=i2 --doctest-modules -o doctest_optionflags='ELLIPSIS IGNORE_EXCEPTION_DETAIL'. The two fix commits alone, without the packaging commit, give 783 passed on the legacy setup. The new uv CI is green on 3.10 and 3.12 for the current head.Dependents gate: each dependent was cloned from GitHub and run with i2 installed editable, first from master, then from this branch.
meshed's one failure is
test_hybrid_dag. It fails the same way on master because the optional depshttp2pyandextrudeare missing.Changes
fix: make ch_func_to_all_pk work for functions with *args: on master, every call failed or lost arguments when the function had*args. Only that case takes the new path. Functions without*argskeep master's code path and its convention:**kwargsgiven by name as a dict, other extras ignored. meshed'shook_upandFlexFuncFanoutrely on that convention, and tests now pin it. Fixes Makech_func_to_all_pkwork withkwargs#12.fix: keep parameter kinds in order when partialx reorders params:move_params_to_the_endnow stable-sorts by parameter kind. Only orders that used to raise change. Fixes Careful reordering when adding keyword-only params to a list that already has a variadic keyword. #17.build: migrate packaging to pyproject.toml and CI to wads uv: hatchlingpyproject.tomlwith SPDX license and full metadata, plus the wads inline uv workflow. It is inline because the reusable stub can't pass the epythet v2 Pages pin, which is kept.setup.cfg,setup.pyand the stalei2/tests/test_requirements.txtare removed. This commit is self-contained and can be dropped on its own.docs: fix broken README examples and guard them with a test: seven README examples didn't run and now do.i2/tests/test_readme.pyruns every README python block. The README also gains an agent pointer and a "For carbon-based contributors" section, and.claude/CLAUDE.mdis updated. Fixes Seven README examples don't run #94.Issues
ch_func_to_all_pkwork withkwargs#12, Careful reordering when adding keyword-only params to a list that already has a variadic keyword. #17, Seven README examples don't run #94. Seven README examples don't run #94 was filed this session.ch_func_to_all_pkwork withkwargs#12:tuple_the_argsrejects its own tupled param when it's given by keyword.ch_func_to_all_pkcan't handle a required keyword-only param after*args.Both need a design call and are labelled
needs-local.replace_kwargs_usingso it will create keyword-only params for wrapped variadic #78. The keyword-only behaviour it asks for already landed in f84b5a9 (2025-10-11). The remaining gap is that a source*argsbecomes a requiredargs, and fixing it isn't purely additive. Labelledneeds-local.needs-local: Need a more powerful and clean signature merging functionality #43, the signature-merging design; I created the label.Not done, and why
Sigand signature merging (Write a general parameters merging function #5 through Add attribute assignment dependencies inattribute_dependencies#75, Need a more powerful and clean signature merging functionality #43, Using aNotSetsentinel to solve makeFuncFactoryinstances' signature more truthful about argument requirements. #48): out of scope, since they need Thor's design decisions.wads-migrate ci-to-stubapplies.i2/data/skillswith.claude/skillssymlinks, theskill-enablelayout. That would change the wheel contents, so it's left for a local pass. The README'sgh skill install ... --allow-hidden-dirsline comes from the house docs and was not run here, because there's noghin the VM.ruff format: not applied. The first master publish will reformat 9 files in the bot commit. The reviewer confirmed the suite passes on the formatted tree.wads-migrate ci-to-uvcarried over the deadSCRIPTS_REPOSITORY_URLwith a wrong alias toSCRIPTS_USERNAME. I removed it by hand. That's worth fixing in wads.Adversarial review (Opus subagent)
The final verdict was APPROVE after three rounds.
ch_func_to_all_pkwork withkwargs#12 fix changed behaviour for functions with**kwargsbut no*args. It nestedkw={...}instead of spreading it and passed extras through instead of dropping them. That brokeFlexFuncFanoutkwonly calls and changed meshedhook_upoutput, which meshed's tests don't cover. Fixed: master's code path is restored for functions without*args, and tests pin it. Re-running the reviewer's scripts against master: every remaining difference is a call that raised on master.doctest_optionflagsdiffered from CI. It is now aligned.ruff formatwould change 9 files. Left as is; see above.PYPI_PASSWORDsecret is a PyPI API token. See below.i2/tests/test_readme.py, which skips itself when the README is absent. Otherwise the wheel is file-for-file identical to the setuptools build.__signature__.namehad become'Sig'instead of the function's name. Fixed and tested.**kwargsgiven by name" spreading, both for calls that raised on master.*argsparam is taken as the positional args.Both are left as is.
For whoever lands it
uv publishwithsecrets.PYPI_PASSWORDas a token. The 0.1.74 upload succeeded, so it is very likely already a token. If it isn't, publish fails before the bump and tag, so nothing half-publishes.Fixes #12
Fixes #17
Fixes #94
🤖 Generated with Claude Code