maiself / godot-python-extension

Python language bindings for the Godot game engine
https://godot-python-extension.readthedocs.io
MIT License
21 stars 4 forks source link

An issue with the prebuilt version #16

Closed MudkipWorld closed 1 week ago

MudkipWorld commented 1 month ago

Hi, I am having few issues with the addon. I tried using the prebuilt release, but the ouput in Godot keeps having this message :') image

by any chance are you able to update it? I am not too familiar with building/ compiling Gdextensions, so I think either making the build instructions more clear or having an updated prebuilt would be nice. ^^;

EDIT : Another issue, I am trying to test/ import a library, but this doesn't seem to work. Is this not supported yet or an issue?

maiself commented 1 month ago

I've kicked the workflow used to build the prebuilt releases. When it's done you should be able the download the artifacts from here (will expire after a month I think).

Life hasn't left me much time to work on this recently, so I'm not sure when I'll be able to get around to updating for release or build documentation. I haven't forgotten about it tho. If you run into other issues please feel free to open another. Keeping issues separate really helps to keep track of things.

MudkipWorld commented 1 month ago

I've kicked the workflow used to build the prebuilt releases. When it's done you should be able the download the artifacts from here (will expire after a month I think).

Life hasn't left me much time to work on this recently, so I'm not sure when I'll be able to get around to updating for release or build documentation. I haven't forgotten about it tho. If you run into other issues please feel free to open another. Keeping issues separate really helps to keep track of things.

It is okay, man, I get you. Also, there seems to be an issue with the Windows build (the os I use), sorry for not specifying that earlier ^^ and if you were able to, would you mind showing how to import external libraries? it seems to only work with importing godot in script. thank you

maiself commented 1 month ago

First build failed, I updated the link, try taking another look.

I don't have anymore energy today unfortunately. For pure Python libraries, if they are in side the project directory they should work, anything else will have to wait till I or someone else has time to spare. Hope that's enough to get you started.

MudkipWorld commented 1 month ago

I don't have anymore energy today unfortunately. For pure Python libraries, if they are in side the project directory they should work, anything else will have to wait till I or someone else has time to spare. Hope that's enough to get you started.

The git build crashes the engine. It is fine tho, I can wait till the next update ^^ Take your time, feel free to reply to me when you have time.

fire commented 3 weeks ago

I'll try kicking the build on my branch of the repo.

fire commented 3 weeks ago
  1. Must take the output of the build tools.
  2. Take a zip of the repo
  3. review windows.x86_64 = "res://bin/windows-x86_64/libgodot-python.windows.x86_64.dll"
  4. review python.gdextension build
  5. Extract zip of the github actions to godot-python-extension-master\test\bin\
  6. On windows bin is a symlink which isn't transferred
  7. Delete bin symlink.
  8. Extract the github actions zip to the godot-python-extension-master\test\bin\
  9. Test Godot Engine 4.3 steam stable on windows
  10. 4.3 steam stable crashes
  11. Test Godot Engine 4.2 steam stable on windows
  12. 4.3 steam stable crashes

Make a test zip

test.zip

crash_log.txt

fire commented 3 weeks ago
ERROR: Traceback (most recent call last):
  File "godot/__init__.py", line 22, in <module>
    from . import _internal
  File "godot/_internal/__init__.py", line 127, in <module>
    _init()
  File "godot/_internal/__init__.py", line 30, in _init
    module_machinery.initialize_module()
  File "godot/_internal/module_machinery.py", line 73, in initialize_module
    type_bind.bind_variant_type(type_info)
  File "godot/_internal/type_bind.py", line 88, in bind_variant_type
    method_bind.bind_method(cls, type_info, method_info)
  File "godot/_internal/method_bind.py", line 273, in bind_method
    method.__doc__ = doc_utils.reformat_doc_bbcode(docs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "godot/_internal/utils/doc_utils.py", line 62, in reformat_doc_bbcode
    for_tty = sys.stdout.isatty()
              ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'isatty'

In call:
    godot._internal.method_bind.bind_method(
        <class 'godot.String'>,
        {'name': 'String', 'indexing_return_type': 'String', 'is_keyed': False, 'operators': [{'name': '==',
            'right_type': 'Variant', 'return_type': 'bool'}, {'name': '!=', 'right_type': 'Variant', 'return_type':
            'bool'}, {'name': '%', 'right_type': 'Variant', 'return_type': 'String', 'description': 'Formats the
            [String], replacing the placeholders with one or more parameters. To pass multiple parameters, [param right]
            needs to be an [Array].\n[codeblock]\nprint("I caught %d fishes!" % 2) # Prints "I caught 2 [...]
        {'name': 'casecmp_to', 'return_type': 'int', 'is_vararg': False, 'is_const': True, 'is_static': False, 'hash':
            2920860731, 'arguments': [{'name': 'to', 'type': 'String'}], 'description': 'Performs a case-sensitive
            comparison to another string. Returns [code]-1[/code] if less than, [code]1[/code] if greater than, or
            [code]0[/code] if equal. "Less than" and "greater than" are determined by the
            [url=https://en.wikipedia.org/wiki/List_of_Unicode_characters]Unicode code points[/url] of each [...]
    )

In call:
    godot._internal.type_bind.bind_variant_type(
        {'name': 'String', 'indexing_return_type': 'String', 'is_keyed': False, 'operators': [{'name': '==',
            'right_type': 'Variant', 'return_type': 'bool'}, {'name': '!=', 'right_type': 'Variant', 'return_type':
            'bool'}, {'name': '%', 'right_type': 'Variant', 'return_type': 'String', 'description': 'Formats the
            [String], replacing the placeholders with one or more parameters. To pass multiple parameters, [param right]
            needs to be an [Array].\n[codeblock]\nprint("I caught %d fishes!" % 2) # Prints "I caught 2 [...]
    )
  During godot python module initialization

   at: pygodot::initialize_python_module (src\extension\extension.cpp:268)

Seems to be related to sys.stdout not working redirected on windows?

fire commented 3 weeks ago

Made a windows branch https://github.com/V-Sekai-fire/godot-python-extension/tree/windows.

Still testing.

fire commented 3 weeks ago

Made a branch pr https://github.com/maiself/godot-python-extension/pull/17.

Solves the crash on godot engine steam 4.2.

Did not solve the steps:

fire commented 3 weeks ago

Tested the pr and it works for me on my computer.

maiself commented 3 weeks ago

@fire, merged the pr, is there more yet to do here?

fire commented 3 weeks ago

Not on my test case.

Editd:

Nothing else to do for my test case. Seems to work for me.

maiself commented 1 week ago

I'm going to close this issue as its gotten a little confusing. Please open a new issue if you have further problems.