PR1: forms facade + IronPython backend extraction + CPython stubs#3039
PR1: forms facade + IronPython backend extraction + CPython stubs#3039jmcouffin merged 14 commits intopyrevitlabs:developfrom
Conversation
|
Unable to trigger custom agent "Code Reviewer"You have run out of credits 😔 |
1f4763a to
5c3a2da
Compare
sanzoghenzo
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I've made a few comments, most of them are due to the overuse of AI in the documentation side.
Another thing I would suggest, and I'm sorry if I didn't tell you before, is to remove the "_forms" from the modules names, since we know we are talking about forms from the package name.
But this is my personal preference and just an implementation detail that should remain hidden to the user, so it's fine to leave it like that.
...RevitDev.tab/Debug.panel/Engine Tests.pulldown/Test CPython Regressions.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitDev.tab/Debug.panel/Engine Tests.pulldown/Test CPython Regressions.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitDev.tab/Debug.panel/Engine Tests.pulldown/Test CPython Regressions.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitDev.tab/Debug.panel/Engine Tests.pulldown/Test CPython Regressions.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitDev.tab/Debug.panel/Engine Tests.pulldown/Test CPython Regressions.pushbutton/script.py
Outdated
Show resolved
Hide resolved
1f17d7c to
b017c93
Compare
|
Rebased on latest Addressed review feedback:
Validation:
Revit manual checks were run earlier (CPython regression + IronPython forms tests); not re-run after this rebase since changes were docstrings/tests/docs only. |
|
Please remove the _forms from the names of the ipy_forms and cpy_forms modules and change the code accordingly in the init and anywhere else necessary |
|
Rebased on latest
Test results (Revit 2025):
|
1013ad9 to
6f0c683
Compare
|
Would you mind trying it out @sanzoghenzo ? |
|
FYI, |
I'll try to squeeze some time tomorrow, not promising anything though |
|
I'll free some time tomorrow to rebase the branch with the latest develop and fix all the requested changes. I think a release should be done only after we finish implementing the second step of the agreed plan, as it would feel more like a cohesive feature than a behind-the-scenes change. I'll also try to elaborate on the second step, so we will have more implementation heuristics to choose from. |
6f0c683 to
267a5ca
Compare
|
Resolved the two remaining threads:
Scoped validations run:
Please re-review when you get a chance. |
|
As promised, here's a clearer plan for the follow-up (PR2) once this PR1 facade/stub contract lands. PR2 goal (small + reviewable): make one built-in Proposed PR2 slices
Implementation heuristics (based on the Dynamo PythonNet3 WPF writeups):
Key heuristic / decision point (existing XAML event attributes): CPython/pythonnet won't reliably bind XAML event attributes like
Validation approach
|
|
The plan sounds good. No opinion on the decision point, this is far from my regular playground, so I'll trust you and your AI friends ;p I'll test PR1 whenever I get the chance this weekend |
|
I'll be more than happy to share my AI stack for contributing to this repo 🙂 |
sanzoghenzo
left a comment
There was a problem hiding this comment.
I can't help myself, just a little edit please 😉
Can you make it a little less verbose? Not really fond of lengthy issue comments that brings not that much of info to the table.... But maybe it's just my adversion to LLM generated content 😅 |
|
Well, I see the less verbose approach as not didactic enough. I believe that the more everything is documented and explained, more successful contributes will come. Moreover, AI-First development is a careful game of semantics-statistics, sometimes you need to let the model "leave its mark" in documentation to keep the development cohesive. Since large refactoring is a matter of a few dollars these days, I find it more useful to keep the clean up for when the feature is fully implemented. Lastly, I'm not sure exactly where, but i feel like the changes introduced in this PR need to be represented in the architecture documentation in some way, as the architecture changed. |
Agreed, but when I have to read a full page describing a simple "let's create a forms module for the cpython engine and a facade to import the correct version transparently" (I'm exaggerating here, bear with me), I feel like the AI is wasted tokens for the creator and wasted time for the reader.
I might have done the wrong thing when I named that document "architecture.md". For that we should add a separate document, and of course an AI agent can do wonders!
I still suck at this agents setup (just today I got an entire python module of my project wiped out by gpt4.1 on opencode and replaced with
And quite a bit of CO2, unfortunately... but I digress. |
|
Sorry for the off-topic. Hoping that sometime in the future we got support for event attributes from upstream pythonnet! |
…l/Engine Tests.pulldown/Test CPython Regressions.pushbutton/script.py Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
Co-authored-by: Andrea Ghensi <andrea.ghensi@gmail.com>
601ff27 to
3910867
Compare
sanzoghenzo
left a comment
There was a problem hiding this comment.
Thank you for your contribution and your patience!
I still didn't test it, but it looks good, so I believe we can go ahead with the second step 😉
|
PR2 coming right up 😉 this time with less verbose documentation. |
|
I haven't forgotten about this one |
|
One step beyond! |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26047+2110-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26047+2131-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26047+2147-wip |
|
📦 New work-in-progress (wip) builds are available for 6.0.0.26047+2248-wip |
|
📦 New work-in-progress (wip) builds are available for 6.1.0.26047+2255-wip |
|
📦 New public release are available for 6.1.0.26047+2349 |
PR1: Refactor
pyrevit.formsinto a lightweight facade that routes to an IronPython backend, and add a CPython stub backend that preserves importability while enforcing a consistent error contract.What changed
pyrevitlib/pyrevit/forms/_ipy_forms.py(intended to be behavior-identical).pyrevitlib/pyrevit/forms/__init__.pyfacade routing based onpyrevit.compat.IRONPY(no WPF/clr imports in facade).pyrevitlib/pyrevit/forms/_cpy_forms.pysoimport pyrevit.formssucceeds under CPython.PyRevitCPythonNotSupported("pyrevit.forms.<symbol>").output.print_mdunder CPython by handlingsys.stdout.Flush()vsflush().docs/architecture.md.Manual validation (Revit 2025)
Contributing while PR1 is open
develop.