-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: broken type checks as of Live 12.1 (#7)
Live 12.1 switched to python 3.11, which is currently impractical to decompile. See gluon/AbletonLive12_MIDIRemoteScripts#2 for more discussion. `pycdc` does decompile some basic structural elements of the Live libraries, but outputs mostly empty function and class definitions. https://pylingual.io/ seems to work better but isn't currently possible to integrate in an automated way. This PR adds https://github.com/gluon/AbletonLive12_MIDIRemoteScripts (currently not updated for 12.1 but seems to work fine for our use cases) as a submodule and sets it up for use with the typechecker.
- Loading branch information
Showing
19 changed files
with
174 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "__ext__/AbletonLive12_MIDIRemoteScripts"] | ||
path = __ext__/AbletonLive12_MIDIRemoteScripts | ||
url = https://github.com/gluon/AbletonLive12_MIDIRemoteScripts.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule AbletonLive12_MIDIRemoteScripts
added at
810ef7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
# This file exports elements of the Live API for which we want to | ||
# provide more specific types than the ones inferred by the type | ||
# checker. Types are specified in the associated .pyi file. | ||
from ableton.v3.base import lazy_attribute # noqa: F401 | ||
# | ||
# Note the type-checker sees some of these as missing imports due to issues in the | ||
# decompiled types, but in practice they're available. | ||
# | ||
# type: ignore | ||
from ableton.v3.base import ( | ||
find_if, # noqa: F401 | ||
flatten, # noqa: F401 | ||
lazy_attribute, # noqa: F401 | ||
listens, # noqa: F401 | ||
memoize, # noqa: F401 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
import typing | ||
|
||
from ableton.v2.base import Slot as __Slot | ||
|
||
T = typing.TypeVar("T") | ||
|
||
def find_if( | ||
predicate: typing.Callable[[T], typing.Any], seq: typing.Iterable[T] | ||
) -> typing.Optional[T]: ... | ||
def flatten(list: typing.Iterable[typing.Iterable[T]]) -> typing.Iterable[T]: ... | ||
|
||
class lazy_attribute(typing.Generic[T]): | ||
def __init__(self, func: typing.Callable[[typing.Any], T], name=...) -> None: ... | ||
def __get__(self, obj, cls=...) -> T: ... | ||
|
||
def listens( | ||
event_path: str, *a, **k | ||
) -> typing.Callable[[typing.Callable[..., typing.Any]], __Slot]: ... | ||
def memoize(function: typing.Callable[..., T]) -> typing.Callable[..., T]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.