MizunagiKB / gd_cubism

Unofficial Live2D Player for Godot Engine
https://mizunagikb.github.io/gd_cubism/
Other
111 stars 17 forks source link

I meet with a problem about SConstruct file #83

Closed HowQi closed 1 month ago

HowQi commented 1 month ago

When I use the command to build,

scons platform=windows arch=x86_64 target=template_debug

an error broke the process :

TypeError: 'type' object is not subscriptable:
……
……

Error is on line 17 of the SConstruct file.

def get_cubism_sdk(dirname: str) -> tuple[Path]:

I tried many ways, finally I found that if I change this line to this, it would work correctly.

def get_cubism_sdk(dirname: str) -> "tuple[Path]":

I found that the previous release version was the same. I don't know if it is really a bug. It may be helpful if you fix it.

Thank you!

MizunagiKB commented 1 month ago

@HowQi

Thank you for your report.

To run SConstruct, Python is required. Could you please inform us of the version of Python you used to execute SConstruct? It seems likely that you might be using a version below 3.8.

The part you reported was written to be valid for versions 3.9 and above:

def get_cubism_sdk(dirname: str) -> tuple[Path]:

For Python 3.8, you need to use typing as follows:

import typing

def get_cubism_sdk(dirname: str) -> typing.Tuple[Path]:

Having explained this, there is no significant reason to impose the extra effort of maintaining type hints that diverge from the original intent.

Therefore, we will remove the type hints altogether.

def get_cubism_sdk(dirname):

The following correction has been made: https://github.com/MizunagiKB/gd_cubism/pull/86/commits/11a828825e262bc131b02b1677f07e9d7611be87

HowQi commented 1 month ago

I use Python 3.8, thanks for your work!

By the way, in the process of trying to solve the problem, I also tried the non-latest version of SCons, and I was told that I needed version 4.0 when compiling, which is different from what was written in your document. This is probably a problem, and the document may need to be modify.

MizunagiKB commented 1 month ago

@HowQi

As you pointed out, the Python version stated in the documentation was listed as 3.6 or higher. This was clearly an oversight on my part.

After the correction, the description has been updated to indicate Python 3.8 or higher.

This has been corrected in the following pull request: https://github.com/MizunagiKB/gd_cubism/pull/87