-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Pytest: Improve doctest integration #39206
Conversation
Documentation preview for this PR (built with commit 5863a98; changes) is ready! 🎉 |
What exactly "better vscode integration" does mean here? That's something that ought to be documented, eventually, |
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 otherwise
Tests show up now in the test explorer and can be run in the "usual" way: https://code.visualstudio.com/docs/python/testing Thanks for the review! |
I'm getting
fwiw |
@vbraun Is this with python 3.11? typing_extensions is a standard dependency of sagelib, so I don't understand why it's not automatically installed. I've added it now as explicit dependency, and first try to import from |
For the record Sage Python is 3.12.5, OS Python is 3.13.0. I haven't tried to figure out why |
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> With these changes it should now be possible to run doctests via pytest: e.g. `pytest --doctest src/sage/manifolds`. There are still a lot of errors since pytests handles a few things differently (most notable it doesn't isolate tests from each other). These issues will be fixed in follow-ups. I've also moved the pytest config from `src` to the root for better vscode integration. Added also a bit of typing information in the doctest framework. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39206 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
This still causes failure in which… makes sense (?) the dependency specification of modularized distribution is separate e.g. |
I think its safe to ignore this failure (nobody is actually working on the modularized distributions and they have a lot of issues)
Would be surprised to find someone that actually understands how this works ;-) |
Feel like we can save some CO₂ emission (and developer time by looking at notification of CI failure) by (temporarily?) comment out |
Yes, that's a good idea. |
Done at #39284 |
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> As suggested at sagemath#39206 (comment). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39284 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> As suggested at sagemath#39206 (comment). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39284 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> As suggested at sagemath#39206 (comment). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39284 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
With these changes it should now be possible to run doctests via pytest: e.g.
pytest --doctest src/sage/manifolds
.There are still a lot of errors since pytests handles a few things differently (most notable it doesn't isolate tests from each other). These issues will be fixed in follow-ups.
I've also moved the pytest config from
src
to the root for better vscode integration. Added also a bit of typing information in the doctest framework.📝 Checklist
⌛ Dependencies