-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
doctest for .rst files #1511
doctest for .rst files #1511
Conversation
pls add also testing RST files with pytest along with the existing testing because now it is tested only against one package's configuration but we would like to cover at least min and max package version coverage >> add it to Github action CI |
this is just a draft and I'm experimenting. I don't know how to do all these things but I will figure it out. P.S. you deleted all my content in the PR description. can it be undone? I have to type it again :( |
I didn't, you can see the version history as next to the content title is edited by ... |
Codecov Report
@@ Coverage Diff @@
## master #1511 +/- ##
======================================
Coverage 88% 88%
======================================
Files 69 69
Lines 4151 4151
======================================
+ Hits 3661 3670 +9
+ Misses 490 481 -9 |
@Borda The doctestplus you suggested seems not to work very well with sphinx. It is a library to run doctests on standalone rst files with pytest. However, since we are using rst files with sphinx, doctestplus is not optimal. First of all, sphinx doctests support things like this:
But this is not supported by doctestplus and it would be nice to run our doctests conditionally. |
the point is that the Read-The-docs is running the build on quite a simple machine so we do not want to take it too long... let's try it with sphinx only and see how it goes :] |
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.
@awaelchli can we turn it for review?
what does it mean, some tests are skipped or failing? |
No it means it is not designed to be used together with sphinx. It will ignore directives like
Sphinx has its own doctest extension. |
@awaelchli @Borda shall we merge soon? unless @awaelchli wants to keep rebasing lol... this will get hard to merge the longer it's open :) |
@williamFalcon sure, I'll try to finish it today, thanks. |
This pull request is now in conflict... :( |
@Borda in the doctests I import loggers, should I add requirements-extra to the docs build or what should I do? |
in this case, I think yeas you really need to call some methods... the mock here is not enough, right? |
hmm, not sure how I could mock them. |
I think it is not possible if we want to run the tests...
what is the problem with Horovod? |
It seems CI can't install it if I do pip install -r requirements-extra.txt |
@tgaddair Hi do you know how I can install or ignore horovod in the docs build CI? It is CPU only and I need to install the logger requiremetns in requirements-extra.txt but it also contains horovod. |
Hey @awaelchli, Horovod should be able to install with or without GPU. I can take a quick look at the build output to see why it's failing. |
Thanks, here it is: |
Thanks. From the logs, it seems the problem is that neither MPI nor CMake are installed. One of those most be installed for Horovod to build. I suggest installing CMake as we do in
That should take care of the issue. |
This reverts commit 490ac28.
Can't invest more time into trying to make the doctests run on drone. I have tried everything, there is just no output that would suggest any failures. So I suggest to drop it for drone and just keep it in the circle ci. PR is now ready for review |
I am fine with having it now at least for CPU (CircleCI) and GPU we can add later... |
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 like his testing VERY MUCH ❤️
Co-authored-by: Jirka Borovec <[email protected]>
Looks like ReadTheDocs did not like what we modified in the conf.py. Some pages like Trainer and LightningModule are broken. I suspect it's the mocking of packages. Will track this down and submit a follow up PR. |
@awaelchli could pls prepare fix as main repo branch and I will turn on building this branch so we will constantly know how it is going... |
Before submitting
What does this PR do?
Follow up to #1484 in a series of doc improvements.
This PR adds doctesting for .rst files and converts existing code blocks to proper doctests.
Note:
Notes:
pl.LightningModule
to because otherwise there was an import error because in docs the__LIGHTNING_SETUP__
variable is set.PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃