diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index e8a5074f8..86b0d8a5d 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -1,6 +1,9 @@ on: pull_request: branches: [ master ] + workflow_dispatch: + branches: [ master ] + jobs: pr-test: diff --git a/__init__.py b/__init__.py new file mode 100644 index 000000000..f783eee3a --- /dev/null +++ b/__init__.py @@ -0,0 +1,26 @@ +import sys +import os +import pythonnet +import subprocess +pythonnet.load("coreclr") +import clr + +def dotnet_build(type_: str = "Release"): + cmd = ["dotnet", + "build", + "-c", + type_] + return subprocess.run(cmd, capture_output=True, text=True) + +MY_DIR = os.path.dirname(os.path.abspath(__file__)) +OpenUtauPath = os.path.join(MY_DIR,r"OpenUtau\bin\Debug\net8.0-windows\OpenUtau.dll") +OpenUtauCorePath = os.path.join(MY_DIR,r"OpenUtau\bin\Debug\net8.0-windows\OpenUtau.Core.dll") +OpenUtauPluginBuiltinPath = os.path.join(MY_DIR,r"OpenUtau\bin\Debug\net8.0-windows\OpenUtau.Plugin.Builtin.dll") +if not os.path.exists(OpenUtauPath): + dotnet_build() +clr.AddReference(OpenUtauPath) # type: ignore +clr.AddReference(OpenUtauCorePath) # type: ignore +clr.AddReference(OpenUtauPluginBuiltinPath) # type: ignore +from OpenUtau import * # type: ignore +from OpenUtau.Core import * # type: ignore +from OpenUtau.Plugin.Builtin import * # type: ignore \ No newline at end of file diff --git a/requ_pythonlink.txt b/requ_pythonlink.txt new file mode 100644 index 000000000..ee7501e18 --- /dev/null +++ b/requ_pythonlink.txt @@ -0,0 +1,4 @@ +pythonnet==3.1.0 +clr_loader==0.3.1 +cffi==2.1.0 +pycparser==3.0 \ No newline at end of file