As the title says, it's not a fix, i just rewrote everything since the stubs were outdated, and the actual module was missing features.
Files changelog:
.gitignore: Mainly to ignore _pycache_\ files.
setup.py: Added vsgenstubs4 command line action, copy .pyi (part) file when installing from pip.
__init__.py, __main__.py: Added main so it's possible to do python -m vsgenstubs4, moved code from dunder init to init.
init.py: Rewrote the module
Made the typing way easier to the user
Collapsed the docstrings, adding \n. With enough plugins it would've reached thousands of lines and VSCode would have stopped reading the pyi file; this edit is to try avoid this issue.
Moved plugins to load-plugin.
plugins (-p) is now for selecting only those plugins and if the stubs file already exists, append them.
Sort the plugins and functions alphabetically.
Added exclude-plugin, which as the name implies, excludes that plugin from the stubs file.
avs-plugin now will print a user friendly error if the avs plugin isn't available.
Added force command, which will force the rewrite of the file.
_vapoursynth.part.pyi: Rewrote it from the ground up from the latest vs git (R60) cython code.
Minimized Any usage, looking up the cython code paths.
Added inspection API under not TYPE_CHECKING so it's shadowed by type checkers and editors, since it's not public yet, but developers have it ready and can easily use it.
Added all__, pyxcapi_\
Exposed enum values stop shadowing their literal value (eg a function that takes Literal[vs.ColorFamily.YUV] in an overload, previously errored with vs.YUV)
This is still Python 3.8 compatible.
Tested with R59, R60 (latest git), both with ~200 plugins.
Setsu, the .pyi-file is there to document the public API of the vapoursynth module. It shouldn't describe every minute detail of the vapoursynth-module, especially internal classes a user will never see
As the title says, it's not a fix, i just rewrote everything since the stubs were outdated, and the actual module was missing features.
Files changelog:
.gitignore
: Mainly to ignore _pycache_\ files.setup.py
: Addedvsgenstubs4
command line action, copy .pyi (part) file when installing from pip.__init__.py
,__main__.py
: Added main so it's possible to dopython -m vsgenstubs4
, moved code from dunder init to init.init.py
: Rewrote the module\n
. With enough plugins it would've reached thousands of lines and VSCode would have stopped reading the pyi file; this edit is to try avoid this issue.plugins
toload-plugin
.plugins
(-p
) is now for selecting only those plugins and if the stubs file already exists, append them.exclude-plugin
, which as the name implies, excludes that plugin from the stubs file.avs-plugin
now will print a user friendly error if the avs plugin isn't available.force
command, which will force the rewrite of the file._vapoursynth.part.pyi
: Rewrote it from the ground up from the latest vs git (R60) cython code.FilterMode
,CoreCreationFlags
,FuncData
,Function
,Func
,FramePtr
,RawNode
,RawFrame
,ColorFamily.UNDEFINED
DataType
,CallBack
,_VapourSynthMapValue
types.Any
usage, looking up the cython code paths.not TYPE_CHECKING
so it's shadowed by type checkers and editors, since it's not public yet, but developers have it ready and can easily use it.Literal[vs.ColorFamily.YUV]
in an overload, previously errored withvs.YUV
)This is still Python 3.8 compatible.
Tested with R59, R60 (latest git), both with ~200 plugins.