GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-108303: Move all `pydoc` related files to `test_pydoc` by sobolevn · Pull Request #114506 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Jan 23, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

  • Issue: Move test files into test subdirectories #108303

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
pythongh-108303: Move all pydoc related files to test_pydoc
e6acc2e
@sobolevn sobolevn added skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jan 23, 2024
@sobolevn
sobolevn requested a review from vstinner January 23, 2024 22:29
@bedevere-app bedevere-app Bot added the awaiting review label Jan 23, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jan 23, 2024
Move test files into test subdirectories #108303
Closed
@sobolevn

sobolevn commented Jan 24, 2024

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jan 24, 2024

Copy link
Copy Markdown
Member

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

Tell me if you need help to investigate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Feb 12, 2024

Copy link
Copy Markdown
Member

test_pydoc is failing!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Feb 12, 2024

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
sobolevn marked this pull request as draft February 12, 2024 16:25
@bedevere-app bedevere-app Bot removed the awaiting review label Feb 12, 2024
@sobolevn

sobolevn commented Feb 12, 2024

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Feb 12, 2024

Copy link
Copy Markdown
Member

No idea what's wrong.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Feb 12, 2024

Copy link
Copy Markdown
Member

Also, there are now merge conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Feb 12, 2024

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Merge
24e087b
@sobolevn
sobolevn force-pushed the issue-108303-pydoc branch from 5d78f9f to 24e087b Compare February 13, 2024 07:48
@vstinner

vstinner commented Feb 13, 2024

Copy link
Copy Markdown
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:
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn
Fix test
c1d27cd
@sobolevn
sobolevn marked this pull request as ready for review February 13, 2024 10:06
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 13, 2024
@sobolevn

sobolevn commented Feb 13, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@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 :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner merged commit ccc76c3 into python:main Feb 13, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Feb 13, 2024
@miss-islington-app

miss-islington-app Bot commented Feb 13, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Feb 13, 2024

Copy link
Copy Markdown

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned vstinner Feb 13, 2024
@miss-islington-app

miss-islington-app Bot commented Feb 13, 2024

Copy link
Copy Markdown

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Feb 13, 2024

Copy link
Copy Markdown
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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Feb 13, 2024

Copy link
Copy Markdown
Member Author

Will do!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
@sobolevn @fsc-eriker
pythongh-108303: Move all pydoc related test files to new `test.tes…
390d833
…t_pydoc` package (python#114506)
sobolevn added a commit to sobolevn/cpython that referenced this pull request Feb 15, 2024
@sobolevn
[3.11] pythongh-108303: Move all pydoc related files to test_pydoc (
2e9069c
pythonGH-114506)
@bedevere-app

bedevere-app Bot commented Feb 15, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@sobolevn
[3.12] pythongh-108303: Move all pydoc related files to test_pydoc (
06901fa
pythonGH-114506)
@bedevere-app

bedevere-app Bot commented Feb 15, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Feb 15, 2024
sobolevn added a commit that referenced this pull request Feb 15, 2024
@sobolevn
[3.12] gh-108303: Move all pydoc related files to test_pydoc (GH-…
9bc32cd
…114506) (#115502)

(cherry picked from commit ccc76c3)
sobolevn added a commit that referenced this pull request Feb 15, 2024
@sobolevn
[3.11] gh-108303: Move all pydoc related files to test_pydoc (GH-…
c3a274b
…114506) (#115501)

(cherry picked from commit ccc76c3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@vstinner vstinner

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sobolevn @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.