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
Added typestring parser checker #1402
Added typestring parser checker #1402
Conversation
@MrMallIronmaker can you check what the error is? |
Nikhil - Thanks for the work you've been doing with the repo the past couple of days. I wanted to mention a couple things about communication, though. First, I don't think I needed a ping on this issue. While I did reply to the original Discord comment, I don't have any special knowledge about doctypes or the module. Any member of the dev team could be equally suited for this question. Second, I expected a more informative question than "can you check what the error was." Depending on how much experience you have with Github, CI, RTD, etc, I think good questions would be "How can I see what the problem was?" or "Why is RTD trying to run the code in my docs?" or "It works on my machine, why is it different here?" All of these questions are much more specific, so they show that you've put in the legwork in trying to teach yourself, they inform me a lot better about your experience so far, and they help me compose a better answer to your question. I do appreciate your enthusiasm, and this message is one of those social norms to learn as you're getting started with FOSS and community software development, and in particular development with Manim. |
I am actually getting an error because Logs:
|
Oh sorry, I realized I misspoke in my message earlier. I still think we should not add a dependency for a single section of the docs. The solution would not be live code to be run by the docstring engine but rather a handful of examples in the text itself. For future reference, the right place to add it to the list is the pyproject.toml file. |
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.
This addition looks good, let me know when you address the smaller changes.
docs/requirements.txt
Outdated
@@ -2,4 +2,4 @@ Sphinx==3.1.2 | |||
furo | |||
recommonmark>=0.5.0 | |||
sphinx-copybutton | |||
sphinxext-opengraph |
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.
It looks like this line didn't actually change; can you checkout the old requirements.txt so that this file doesn't have a change here?
I don't think so, maybe removing |
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, i can squash and merge this in a bit
>>> parse('int') | ||
<class 'int'> | ||
>>> parse('int or str') | ||
typing.Union[int, str] | ||
>>> parse('list of str or str') | ||
typing.Union[typing.List[str], str] | ||
>>> parse('list of (int, str)') | ||
typing.List[typing.Tuple[int, str]] |
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.
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.
No let's not have it as it just makes the CI fail.
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.
I would think there's some way to have a code block highlighted in the documentation, but not run - right? @naveen521kk
If not, this is definitely not a breaking 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.
@Nikhil0504 I know how to do this without breaking things, but I want you to search or rather explore to find things out.
You can easily add syntax highlighting, browse through though how it is done in other parts of manim itself or look at the reStructuredText Primer from sphinx or search the internet.
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.
Hey, I tried fixing the issue and couldn't find a solution for it. Is it possible for you to fix it?
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.
Take a look at how https://docs.manim.community/en/latest/tutorials/quickstart.html does it
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.
requesting changes to enable syntax highlighting
Fixed the code block issue at last. https://manimce--1402.org.readthedocs.build/en/1402/contributing/documentation.html |
be accessed by first downloading it via ``pip`` - ``pip install typestring-parser`` and | ||
then using ``from typestring_parser import parse``. | ||
|
||
.. code-block:: bash |
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.
how is the below code bash
? It's python.
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 use it under bash or cmd so it's not python right?
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.
Again, see how this is done in other places. It's obviously not bash
.
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.
I made another change and checked locally which passed but over here the pre commit is failing
All checks have passed and I removed the |
@@ -318,6 +318,24 @@ elements that are either a ``str`` or ``None``; | |||
``(str, int)``; ``Tuple[:class:`int`, ...]`` for a tuple of variable | |||
length with only integers. | |||
|
|||
.. note:: | |||
As a helper for tool for typesets, you can use ``typestring-parser``: https://github.com/Dominik1123/typestring-parser |
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.
rather than pasting the link near typestring-parser
make that clickable.
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.
docs are looking good to me.
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.
sgtm
@Nikhil0504 we can't merge until it's up-to-date, and we can't update the branch. Did you disable edits from maintainers on this branch? |
I gave the access and made the branch up to date. |
Changelog / Overview
Added
typestring-parser
Motivation
Now the contributors can check if their typestrings are correct more easily.
Explanation for Changes
This could lessen the reviews and can PR's can be done faster. For first-timers, this would save them a lot of time as they could check here directly without going through many websites on whether they are correct or not.
Testing Status
Further Comments
Closes #1394
Checklist
Reviewer Checklist