-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type hints to manim.cli
module
#3988
Conversation
Could you remove this module from mypy's ignore list? https://github.com/ManimCommunity/manim/blob/main/mypy.ini#L61-L63 |
Done! |
I'll have to fix the MyPy errors later. |
I fixed all the errors reported by
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting in this effort, this is amazing progress towards typing Manim fully :)
I did leave some minor comments, so I would appreciate if you could take a look at those.
# No command name matched. | ||
ctx.arg0 = cmd_name | ||
ctx.meta["arg0"] = cmd_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about this, nice change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I was struggling to do this assignment without having mypy
complain about it, so I ended up looking at click.Context
in the hope of finding some dictionary, which I fortunately found!
cli
manim.cli
module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Just one minor thing, and I think this PR is good to go :)
manim/cli/render/render_options.py
Outdated
start, end = map(int, re.split(r"[;,\-]", value)) | ||
except Exception: | ||
logger.error("Couldn't determine a range for -n option.") | ||
exit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use sys.exit
here, exit()
is only intended for use in the REPL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! I just made that change.
As required by the issue #3375, I added typings for the
manim.cli
module.I also added an entry in the docs for the
cli
module, although it's a work in progress.Links to added or changed documentation pages
Reviewer Checklist