| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I think we already run these doctests via Sphinx in CI. If there are certain doctests that aren't being run via that CI job, then I think we should investigate why that is, rather than running the entire doctest suite twice in CI |
Sorry, something went wrong.
See https://github.com/python/cpython/actions/runs/6741804289/job/18326927659 for a recent run, in which 55/55 typing doctests were reported to have passed (but maybe there's some that the job missed) |
Sorry, something went wrong.
|
@AlexWaygood as you can see there's something wrong with Doctest CI job: https://github.com/python/cpython/actions/runs/6743114958/job/18330437061?pr=111682 It passes on a clearly broken example. But, my new job fails as it should: https://github.com/python/cpython/actions/runs/6743114958/job/18330434893?pr=111682 I know this because I've already fixed multiple doctests for other modules. |
Sorry, something went wrong.
In which case, I think we should either try to fix the broken CI job, or, if it's useless, remove it from CI. @AA-Turner, any idea why the doctest CI job doesn't seem to be doing what it should be here? :) |
Sorry, something went wrong.
| >>> 1 + 2 | ||
| 4 |
There was a problem hiding this comment.
this isn't actually doctested, I don't think, since you don't have the .. doctest:: directive above this block. (I've just pushed to your branch to add it.)
Sorry, something went wrong.
There was a problem hiding this comment.
It is a doctest, clearly:
» ./python.exe -m doctest Doc/library/typing.rst
**********************************************************************
File "Doc/library/typing.rst", line 651, in typing.rst
Failed example:
1 + 2
Expected:
4
Got:
3
**********************************************************************
1 items had failures:
1 of 48 in typing.rst
***Test Failed*** 1 failures.
It works the same way with and without .. doctest::.
The problem might that Sphinx does not recognize doctests without this directive, but this is clearly a Sphinx's own issue.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, that was what I meant, sorry for not being clear: that it wouldn't be picked up by sphinx's doctest job :)
Sorry, something went wrong.
There was a problem hiding this comment.
We might need to use doctest_test_doctest_blocks from https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html
Sorry, something went wrong.
There was a problem hiding this comment.
We might need to use doctest_test_doctest_blocks from https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html
We can try enabling that, sure, but that should be a separate issue/PR. This PR is about fixing broken doctests in typing.rst, not changing the way we determine in CI which doctests should be run. The majority of these that need to be tested already are tested, using the .. doctest:: directive.
Sorry, something went wrong.
There was a problem hiding this comment.
It seems like the current CI job is not broken at all. The "clearly broken" example you added correctly failed in CI with the Sphinx doctest job after the .. doctest:: marker was added: https://github.com/python/cpython/actions/runs/6743594059/job/18331803827?pr=111682
Sorry, something went wrong.
| .. doctest:: | ||
|
|
||
| >>> from typing import ParamSpec | ||
| >>> from typing import ParamSpec, get_origin |
There was a problem hiding this comment.
I don't mind the change you're making here. But the reason why this doesn't currently fail when Sphinx runs our doctests in CI is because of this, which is run before every doctest block:
cpython/Doc/library/typing.rst
Lines 5 to 9 in d49aba5
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
It might not be broken, it just allows a lot of broken doctests in. Because what happens in reality is that a lot of code blocks / example do not have .. doctest directive and they become outdated, maintainers do not notice it, users get upset. |
Sorry, something went wrong.
I agree this situation is suboptimal. But that makes me think that we should do one of the following two things:
It makes no sense to me to do what this PR currently proposes: run most of the doctests in typing.rst twice in CI. |
Sorry, something went wrong.
|
Yes, I agree. I will convert it to a very minimalistic one: just remove unused imports and fix doctests a bit, without adding new tests to the suite. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
|
Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to 3.12 due to a conflict. cherry_picker ccc8caa8587103c4ccf617ba106cef63344504dd 3.12 |
Sorry, something went wrong.
|
Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict. cherry_picker ccc8caa8587103c4ccf617ba106cef63344504dd 3.11 |
Sorry, something went wrong.
|
@sobolevn, can I leave the backports with you? :) |
Sorry, something went wrong.
|
Will do, I will also create a new issue about our CI + doctest. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Windows11 Bigmem 3.x has failed when building commit ccc8caa. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/1079/builds/2658 Summary of the results of the build (if available): == Click to see traceback logsremote: Enumerating objects: 8, done.
remote: Counting objects: 12% (1/8)
remote: Counting objects: 25% (2/8)
remote: Counting objects: 37% (3/8)
remote: Counting objects: 50% (4/8)
remote: Counting objects: 62% (5/8)
remote: Counting objects: 75% (6/8)
remote: Counting objects: 87% (7/8)
remote: Counting objects: 100% (8/8)
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 12% (1/8)
remote: Compressing objects: 25% (2/8)
remote: Compressing objects: 37% (3/8)
remote: Compressing objects: 50% (4/8)
remote: Compressing objects: 62% (5/8)
remote: Compressing objects: 75% (6/8)
remote: Compressing objects: 87% (7/8)
remote: Compressing objects: 100% (8/8)
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 0), reused 1 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'ccc8caa8587103c4ccf617ba106cef63344504dd'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at ccc8caa858 gh-111681: minor fixes to typing doctests; remove unused imports in `test_typing` (#111682)
Switched to and reset branch 'main'
Could Not Find R:\buildarea\3.x.ambv-bb-win11.bigmem\build\Lib\*.pyc
The system cannot find the file specified.
Could Not Find R:\buildarea\3.x.ambv-bb-win11.bigmem\build\PCbuild\python*.zip
Could Not Find R:\buildarea\3.x.ambv-bb-win11.bigmem\build\PCbuild\python*.zip |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot x86-64 macOS 3.x has failed when building commit ccc8caa. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/366/builds/5809 Summary of the results of the build (if available): == Click to see traceback logsNote: switching to 'ccc8caa8587103c4ccf617ba106cef63344504dd'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at ccc8caa858 gh-111681: minor fixes to typing doctests; remove unused imports in `test_typing` (#111682)
Switched to and reset branch 'main'
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.13d.a(dynamic_annotations.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libpython3.13d.a(pymath.o) has no symbols
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: -undefined dynamic_lookup may not work with chained fixups
make: *** [buildbottest] Error 3 |
Sorry, something went wrong.
…s in `test_typing` (python#111682) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-112035 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
|
GH-112037 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
…s in `test_typing` (python#111682) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…s in `test_typing` (python#111682) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
| Back | FazBrowse Home | New Git URL |
Without globs it would fail:
📚 Documentation preview 📚: https://cpython-previews--111682.org.readthedocs.build/