Skip to content
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

Return injection fix #445

Merged
merged 3 commits into from Apr 10, 2024
Merged

Conversation

caffeinepills
Copy link
Contributor

@caffeinepills caffeinepills commented Apr 9, 2024

Resolves #444 and #425

Ignore the rst_epilog/rst_prolog during parsing type hints like #436 did. This still keeps the replacement behavior.

I tried adjusting the parsing, but the XML node line counting, and the list of lines given are too intertwined without rewriting it completely.

test_sphinx_autodoc_typehints was broken for me in Windows, so I have added an encoding kwarg for it to work.

EDIT: Working on making tests pass... and adding them.

@caffeinepills caffeinepills marked this pull request as draft April 9, 2024 03:37
@hoodmane
Copy link
Collaborator

hoodmane commented Apr 9, 2024

Thanks for working on this @caffeinepills! This also needs a new test to cover the intended difference between the old behavior and the new behavior.

Add tests for prolog and epilog. Add test runs to run all tests with configs of both.
@caffeinepills
Copy link
Contributor Author

caffeinepills commented Apr 9, 2024

I added tests (might be overkill?) A single test for both epilog and prolog to make sure the replacement functionality still works. Also it will run all test functions 4 times:

  1. Default Config.
  2. rst_prolog enabled
  3. rst_epilog enabled
  4. rst_prolog and rst_epilog enabled.

Not sure if that's overkill or not, but I can remove whichever.

@caffeinepills caffeinepills marked this pull request as ready for review April 9, 2024 19:22
Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat gaborbernat merged commit a79c4c1 into tox-dev:main Apr 10, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sphinx option rst_prolog and rst_epilog break return type injection
3 participants