Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
on:
pull_request:
branches: [ master ]
workflow_dispatch:
branches: [ master ]


jobs:
pr-test:
Expand Down
26 changes: 26 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions requ_pythonlink.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pythonnet==3.1.0
clr_loader==0.3.1
cffi==2.1.0
pycparser==3.0