Maya-stubs

Latest version: v0.4.1

Safety actively analyzes 624845 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.4.0

This release includes a lot of improvements to the stubs quality, courtesy of arvidfm

Python command stubs
- Positional arguments of commands now have default values of `...`
- query and/or edit flags are now included for commands detected as queryable and/or editable based on the description
- In query mode, any queryable argument takes a bool unless explicitly specified to only take a value in query mode as well, so these flags are now type hinted as X | bool
- The return type of queryable commands is now a union of the original return type as well as all queryable types
- Commands whose synopsys defines multiple return types are expressed as type unions
- Flags marked as multiuse are now type hinted as X | List[X]
- Improved MEL to Python type conversion
- The maya.cmds stub now includes various type aliases to make the function signatures a bit easier to read, e.g. Queryable[str] for str | bool and Range[float] for Tuple[float] | Tuple[float, float]

Python API stubs
- Literals are now only printed to the stub files if they are simple literals that can actually be represented in Python, e.g. numbers, strings and empty lists/dicts, avoiding syntax errors from sequences like <property object at 0x7fc18a818400> in the stubs
- The parser now keeps track of the fully qualified path of symbols imported from other modules, so e.g. MFnBase will be referenced as maya.OpenMaya.MFnBase when used in OpenMayaUI
- The parser now attempt to guess the types of descriptor class members (property and getset_descriptor attributes) by instantiating the class and retrieving the member via the instance
- The parser also tries to guess the type of parameters using the default value imported by inspect.signature
- Members imported from other modules are no longer included
-
- `staticmethod` and `classmethod` decorators are now detected and included in the stubs
- Module-level global variables are now included in the stubs
- Add special cases for __init__ and __cls__ so that the former always returns None, and the latter always has a cls argument

Other various changes
- Stubs are now also generated for the top-level `maya` package in `maya.__init__.pyi`
- `__init__.pyi` files are now included in all directories so that type checkers correctly detect them as Python packages
- Any use of Callable is now type hinted as Callable[..., Any] to prevent type checkers for complaining about missing type parameters

0.3.1

Switch to Docspec + Jinja to generate the stubs

- maya.cmds stubs are substantially better than before though still contain some inaccuracies
- stubs for the plugins `invertShape.mll` and `poseInterpolator.mll` are included (though they are bare bones)
- Stubs for Open Maya 1.0 and 2.0 are likely worse than before

0.3.0alpha.1

Pre release of the docspec / jinja2 refactor

The stubs for maya.cmds should be substantially more accurate with return types parsed from the HTML docs and the flags being (for now) all optional

However, the stubs for Open Maya 1.0 and 2.0 are most likely worse and still a work in progress.

0.2.0

Added degraded stubs for all OpenMaya 1 and 2 members
Open Maya 2 also has docstrings included.

0.1.2

Support python 2 and 3.

The stubs haven't change, this is a version bump to match pypi's release

0.1.1

- Added support for implicit first arguments of all commands documented with `cmds.help`

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.