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

gh-108303: Move all pydoc related files to test_pydoc #114506

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jan 23, 2024

I hope that this will be one of the latest commits to this issue! 🎉
There are only a couple of things left to do. Most files were cleaned up.

The change itself is rather simple.

@sobolevn
Copy link
Member Author

Very strange, why windows build fails. I will investigate.

@vstinner
Copy link
Member

Very strange, why windows build fails. I will investigate.

Tell me if you need help to investigate.

@vstinner
Copy link
Member

test_pydoc is failing!

@sobolevn
Copy link
Member Author

yes, this is expected. I am still debugging :(
No idea what's wrong.

@sobolevn sobolevn marked this pull request as draft February 12, 2024 16:25
@sobolevn
Copy link
Member Author

I will convert to draft, so it will be clear that this is a WIP.

@vstinner
Copy link
Member

No idea what's wrong.

Try: git mv Lib/test/pydoc_mod.py Lib/test/test_pydoc/. Does it help?

@vstinner
Copy link
Member

Also, there are now merge conflicts.

@sobolevn
Copy link
Member Author

Try: git mv Lib/test/pydoc_mod.py Lib/test/test_pydoc/. Does it help?

No, that's not the case :)

I am trying to debug the initial Windows failure:

 ======================================================================
FAIL: test_text_doc (test.test_pydoc.test_pydoc.PydocDocTest.test_text_doc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_pydoc\test_pydoc.py", line 435, in test_text_doc
    self.assertEqual(expected_text, result)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "NAME[76 chars]DULE DOCS\n    https://docs.python.org/3.13/li[2235 chars]d.py" != "NAME[76 chars]DULE REFERENCE\n    https://docs.python.org/3.[2567 chars]d.py"
  NAME
      test.test_pydoc.pydoc_mod - This is a test module for test_pydoc
  
- MODULE DOCS
+ MODULE REFERENCE
      https://docs.python.org/3.13/library/test.test_pydoc.pydoc_mod.html
+ 
+     The following documentation is automatically generated from the Python
+     source files.  It may be incomplete, incorrect or include features that
+     are considered implementation detail and may vary between Python
+     implementations.  When in doubt, consult the module reference at the
+     location listed above.
  

The problem is that I cannot reproduce it locally on my macos.

@vstinner
Copy link
Member

You should update pydoc as well:

diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 17f7346e5c..6d145abda9 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -552,7 +552,7 @@ def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
                                  '_thread', 'zipimport') or
              (file.startswith(basedir) and
               not file.startswith(os.path.join(basedir, 'site-packages')))) and
-            object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
+            object.__name__ not in ('xml.etree', 'test.test_pydoc.pydoc_mod')):
             if docloc.startswith(("http://", "https://")):
                 docloc = "{}/{}.html".format(docloc.rstrip("/"), object.__name__.lower())
             else:

@sobolevn sobolevn marked this pull request as ready for review February 13, 2024 10:06
@sobolevn
Copy link
Member Author

sobolevn commented Feb 13, 2024

@vstinner thanks a lot, your suggestion about object.__name__ not in ('xml.etree', 'test.test_pydoc.pydoc_mod') worked!
Not gonna lie, I still do not fully understand the difference between macos / linux / win pydoc builds, but since all CIs are green now, I think that it is fine :)

@vstinner vstinner merged commit ccc76c3 into python:main Feb 13, 2024
38 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @sobolevn and @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ccc76c3e88647e416184bb1f5210b4e8946ae358 3.12

@miss-islington-app
Copy link

Sorry, @sobolevn and @vstinner, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ccc76c3e88647e416184bb1f5210b4e8946ae358 3.11

@vstinner
Copy link
Member

Merged. I just edited the commit message. Oh, sorry, I forgot that you can now merge changes by yourself! Oops.

Well, sadly, automated backports fail as usual. Can you try to backport them manually?

@sobolevn
Copy link
Member Author

Will do!

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
sobolevn added a commit to sobolevn/cpython that referenced this pull request Feb 15, 2024
@bedevere-app
Copy link

bedevere-app bot commented Feb 15, 2024

GH-115501 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Feb 15, 2024
sobolevn added a commit to sobolevn/cpython that referenced this pull request Feb 15, 2024
@bedevere-app
Copy link

bedevere-app bot commented Feb 15, 2024

GH-115502 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Feb 15, 2024
sobolevn added a commit that referenced this pull request Feb 15, 2024
sobolevn added a commit that referenced this pull request Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants