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

Use Sybil for doctests #142

Merged
merged 6 commits into from
Apr 24, 2024
Merged

Use Sybil for doctests #142

merged 6 commits into from
Apr 24, 2024

Conversation

nstarman
Copy link
Contributor

@nstarman nstarman commented Apr 21, 2024

This PR add docstring testing and testing of the docs via Sybil (https://sybil.readthedocs.io/en/latest/).
I'm not sure what style of docstrings you want... My last PR was in the NumPy style, but the rest of the docs are in Google's...

If you don't like the try: ...; ... except Exception as e: print(f"{type(e).__name__}: {e}"), I think we can subclass sybil.parsers.myst.PythonCodeBlockParser and modify it so that the try: except operates behind the scenes. IMO I like that it's explicit and the examples are safer to copy-paste.

Found:

  • 1 bug (plum/util.py) where classes generated in an atypical fashion, e.g. as in the docs have __module__ is None
  • Many out-of-date / incorrect docs — including the ones I just contributed!

Squash merge is fine!

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
@nstarman
Copy link
Contributor Author

nstarman commented Apr 21, 2024

Hmm. This passes on py3.12 on my local version.

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
@coveralls
Copy link

coveralls commented Apr 21, 2024

Pull Request Test Coverage Report for Build 8786086897

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 8773615289: 0.0%
Covered Lines: 1219
Relevant Lines: 1219

💛 - Coveralls

@nstarman
Copy link
Contributor Author

I think the failure is unrelated

Copy link
Member

@wesselb wesselb left a comment

Choose a reason for hiding this comment

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

This looks awesome, @nstarman. Thank you so much for this!

I've got a few very minor comments/questions, which I left as comment in the PR.

plum/util.py Outdated Show resolved Hide resolved
conftest.py Outdated Show resolved Hide resolved
plum/parametric.py Show resolved Hide resolved
@nstarman nstarman requested a review from wesselb April 23, 2024 19:36
@wesselb
Copy link
Member

wesselb commented Apr 24, 2024

Again, this is a fantastic PR, @nstarman! Merging this right away. :) Thanks so much!!

@wesselb wesselb merged commit a6c2ef4 into beartype:master Apr 24, 2024
6 checks passed
@nstarman nstarman deleted the doctests branch April 24, 2024 23:59
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.

None yet

3 participants