Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squashed commit of python_pr3 #4841

Open
wants to merge 80 commits into
base: master
Choose a base branch
from

Conversation

gsohler
Copy link
Member

@gsohler gsohler commented Nov 21, 2023

Squashed commit of all my changes

@Matthieu-LAURENT39
Copy link

Matthieu-LAURENT39 commented Nov 22, 2023

Really nice, hope this gets merged!
Seems like i was a bit too late to work some more on the fork '^^

@bandtank
Copy link

Man this really needs to be merged. It is painful to keep up with changes while still enabling Python. Thank you for the hard work.

@Matthieu-LAURENT39
Copy link

Also, i just noticed when going through the changes, but when squashing you can use Co-authored-by: in your commit message to mention all authors that worked on something.

Personally i don't really care about having attribution, but it's good practice so i thought i'd mention it ;)

@gsohler
Copy link
Member Author

gsohler commented Nov 27, 2023 via email

@Matthieu-LAURENT39
Copy link

Matthieu-LAURENT39 commented Nov 27, 2023

Hi Matthieu Yes of course, It's very true that you have contributed quite a lot to my fork, especially with the editor and operators and the nice walk-through tutorial. When doing the squash the intent was not to remove your name but to remove very old commits which do not actually belong the the project. On my 1st trial to git rebase my branch to a correct master I spend over 2 hours for nothing. There were lots of conflicts on each new hash, which was absolutely no fun. So I decided so squash instead ... If you want to have this fixed, we can schedule for a screen sharing session to fix it. personally i dont have too much of these abilities. and again, sorry. Your effort is very well appreciated!

On Mon, Nov 27, 2023 at 3:23 PM Matthieu LAURENT @.> wrote: Also, i just noticed when going through the changes, but when squashing you can use Co-authored-by: https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors in your commit message to mention all authors that worked on something. Personally i don't really care about having attribution, but it's good practice so i thought i'd mention it ;) — Reply to this email directly, view it on GitHub <#4841 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCO4MX6DNQAMKIGPUAHFPDYGSO73AVCNFSM6AAAAAA7UKWFIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRXHEZTGOBXGE . You are receiving this because you authored the thread.Message ID: @.>

Don't worry about it too much ^^
If you need help rebasing, i have quite a bit of experience with git, so i wouldn't mind helping.
Feel free to send me an email 👍

Co-authored-by: Matthieu LAURENT <matthieu.laurent69@proton.me>
@pca006132
Copy link
Member

  1. Minimal supported python version should be Python 3.10, as Python 3.9 contains node.h that will conflict with src/core/node.h. We can either write this as requirement or resolve this by changing every #include "node.h" to #include "src/core/node.h".
  2. Backup file still has .scad suffix.
  3. For some reason I cannot get the GUI to work:
    image
  4. For slightly more complicated example (from the openscad-python website), I got segfault with the GUI (but it works fine in CLI):
    def foot(x,y):
    	c=cube([1,1,10])
    	return translate(c,[x,y,0])
    
    def plate():
    	return cube([11,11,1])
    
    parts=[]
    parts.append(translate(plate(),[0,0,10]))
    
    for y in [0,10]:
    	for x in [0,10]:
    		parts.append(foot(x,y))
    
    output(parts)
    #0  0x00007ffff658e1b2 in t_primary_rule ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #1  0x00007ffff658e328 in t_primary_rule ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #2  0x00007ffff6593c7f in single_subscript_attribute_target_rule ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #3  0x00007ffff6594db8 in simple_stmt_rule ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #4  0x00007ffff65976b3 in simple_stmts_rule ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #5  0x00007ffff659bf2a in statements_rule ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #6  0x00007ffff659ef22 in _PyPegen_parse ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #7  0x00007ffff633bfa2 in _PyPegen_run_parser ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #8  0x00007ffff633c36c in _PyParser_ASTFromString ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #9  0x00007ffff6577dfe in PyRun_SimpleStringFlags ()
       from /nix/store/hd18diw4x8yn48d83z09gsifxhqm5cz6-python3-3.11.6-env/lib/libpython3.11.so.1.0
    #10 0x0000000000dbce78 in evaluatePython (
        code="def foot(x,y):\r\n\tc=cube([1,1,10])\r\n\treturn translate(c,[x,y,0])\r\n\r\ndef plate():\r\n\treturn cube([11,11,1])\r\n\r\nparts=[]\r\nparts.append(translate(plate(),[0,0,10]))\r\n\r\nfor y in [0,10]:\r\n\tfor x in [0,10]:\r\n"..., assignments=std::vector of length 2, capacity 2 = {...})
        at /home/pca006132/code/openscad/src/python/pyopenscad.cc:528
    #11 0x0000000000cfdfc8 in MainWindow::parseTopLevelDocument (this=0x4f2658a8c00)
        at /home/pca006132/code/openscad/src/gui/MainWindow.cc:1992
    #12 0x0000000000d81cf2 in TabManager::openTabFile (this=this@entry=0x4f26d6b5880, filename=...)
        at /home/pca006132/code/openscad/src/gui/TabManager.cc:504
    

Not sure if 3 and 4 are due to my rather unusual setup... Don't think they should block the merge if it works for others, I can find some time to debug that issue.

@gsohler
Copy link
Member Author

gsohler commented Dec 1, 2023 via email

@pca006132
Copy link
Member

For 3 and 4, I tried the old commit (before my changes) and it is the same.

@@ -45,7 +46,7 @@ bool pythonRuntimeInitialized = false;

void PyOpenSCADObject_dealloc(PyOpenSCADObject *self)
{
Py_XDECREF(self->dict);
// Py_XDECREF(self->dict);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this cause memory leak?

@gsohler
Copy link
Member Author

gsohler commented Dec 1, 2023 via email

@pca006132
Copy link
Member

yes it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

None yet

9 participants