Skip to content

Generate social media preview cards for the documentation - #132101

Merged
AA-Turner merged 7 commits into
python:mainfrom
AA-Turner:docs/ogp_social_cards
Apr 5, 2025
Merged

AA-Turner merged 7 commits into
python:mainfrom
AA-Turner:docs/ogp_social_cards

Conversation

@AA-Turner

@AA-Turner AA-Turner commented Apr 4, 2025 •

Copy link
Copy Markdown
Member

Replaces #129120, requires python/docsbuild-scripts#242, closes python/docsbuild-scripts#147.

This generates a Doc/build/html/_images/social_previews/ directory of ~500 .png images (one per page; ~40MB). Per Hugo's comment in GH-129120, it removes HTML from the page head like:

<meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
<meta property="og:image:alt" content="Python documentation" />
...
<meta property="og:image:width" content="200" />
<meta property="og:image:height" content="200" />

And adds:

<meta property="og:url" content="https://docs.python.org/3/library/mm.html" />
...
<meta property="og:image:width" content="1146" />
<meta property="og:image:height" content="600" />
<meta property="og:image" content="_images/social_previews/summary_library_mm_8b5ad9c4.png" />
<meta property="og:image:alt" content="The modules described in this chapter implement various algorithms or interfaces that are mainly useful for multimedia applications. They are available at th..." />
...
<meta name="twitter:card" content="summary_large_image" />

A


📚 Documentation preview 📚: https://cpython-previews--132101.org.readthedocs.build/

@AA-Turner
AA-Turner force-pushed the docs/ogp_social_cards branch from 1ef8448 to 9533953 Compare April 4, 2025 22:25

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As #129120 (comment), we'll only generate images for the docs server, but here's indicative times, and they're very similar to before.

Read the Docs:

macOS:

  • Without images: 38s
  • With images: 48s
@AA-Turner
AA-Turner enabled auto-merge (squash) April 5, 2025 14:15
@AA-Turner
AA-Turner merged commit 561965f into python:main Apr 5, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Apr 5, 2025
@AA-Turner AA-Turner added the needs backport to 3.13 only security fixes label Apr 10, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @AA-Turner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 561965fa5c8314dee5b86586ffa16c1f369d1fa2 3.13
AA-Turner added a commit to AA-Turner/cpython that referenced this pull request Apr 10, 2025
…honGH-132101)

(cherry picked from commit 561965f)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Apr 10, 2025

Copy link
Copy Markdown

GH-132344 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Apr 10, 2025
@AA-Turner
AA-Turner deleted the docs/ogp_social_cards branch April 10, 2025 05:16
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable Refleaks 3.13 (tier-2) has failed when building commit f24f241.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1512/builds/494) and take a look at the build logs.
  4. Check if the failure is related to this commit (f24f241) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1512/builds/494

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::foo:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::foo:/tmp/test_python_6lyle2f8/tmp05s3t5tk/perftest.py' not found in 'python 1291779 1422927.438763:          1 cycles:Pu: \n\t    ffff93433ac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython 1291779 1422927.438792:          1 cycles:Pu: \n\tffffaa282d37fc78 [unknown] ([unknown])\n\tffffaa282d38049c [unknown] ([unknown])\n\tffffaa282bf215e4 [unknown] ([unknown
table-aarch64.refleak/build/python)\n\t          65fecf _PyGILState_Init+0x4b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          6532db pycore_create_interpreter+0x127 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          653cf3 pyinit_config+0x6f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65b3ab pyinit_core+0xdb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65b483 Py_InitializeFromConfig+0x97 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b63f pymain_init+0xff (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b703 pymain_main+0xf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b797 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          41ddb7 main+0xb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t    ffff931c625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffff931c633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41dcaf _start+0x2f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\npython 1291779 1422927.442716:    1885089 cycles:Pu: \n\t          53269c PyTuple_GET_SIZE+0x10 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          5458ff type_mro_modified+0xfb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          546bc7 mro_internal_unlocked+0x97 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          547363 type_ready_mro+0x6f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          5476df type_ready+0x77 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          54788f init_static_type+0xab (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          547a6f _PyStaticType_InitBuiltin+0x23 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          5077bf _PyTypes_InitTypes+0xa7 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65351f pycore_init_types+0x1b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          653b37 pycore_interp_init+0x10b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          653d33 pyinit_config+0xaf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65b3ab pyinit_core+0xdb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65b483 Py_InitializeFromConfig+0x97 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b63f pymain_init+0xff (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b703 pymain_main+0xf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b797 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          41ddb7 main+0xb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t    ffff931c625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffff931c633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41dcaf _start+0x2f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\npython 1291779 1422927.445083:    4552910 cycles:Pu: \n\t          55d968 PyUnicode_New+0x88 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          57065f unicode_decode_utf8+0x5f (/home


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::foo:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::foo:/tmp/test_python_ok4ukw5y/tmpcgzrih90/perftest.py' not found in 'python 1402615 1423595.719574:          1 cycles:Pu: \n\tffffaa282d37fc78 [unknown] ([unknown])\n\tffffaa282d38049c [unknown] ([unknown])\n\tffffaa282bf215e4 [unknown] ([unknown])\n\t    ffff96fffac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython 1402615 1423595.719610:          1 cycles:Pu: \n\t    ffff96fffac0 _start+0x0 (/usr/lib/ld-linux-aarch64.so.1)\n\npython 1402615 1423595.720070:          1 cycles:Pu: \n\t    ffff96fecb88 check_match+0xa8 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96fed017 do_lookup_x+0x397 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96fed833 _dl_lookup_symbol_x+0x113 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ff16ff resolve_map+0x79f (inlined)\n\t    ffff96ff16ff elf_machine_rela+0x79f (inlined)\n\t    ffff96ff16ff elf_dynamic_do_Rela+0x79f (inlined)\n\t    ffff96ff16ff _dl_relocate_object+0x79f (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ffd3d3 dl_main+0x15d3 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ffa5ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ffbb17 _dl_start_final+0x5ab (inlined)\n\t    ffff96ffbb17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96fffad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython 1402615 1423595.720090:        394 cycles:Pu: \n\t    ffff96fed774 _dl_new_hash+0x54 (inlined)\n\t    ffff96fed774 _dl_lookup_symbol_x+0x54 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ff16ff resolve_map+0x79f (inlined)\n\t    ffff96ff16ff elf_machine_rela+0x79f (inlined)\n\t    ffff96ff16ff elf_dynamic_do_Rela+0x79f (inlined)\n\t    ffff96ff16ff _dl_relocate_object+0x79f (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ffd3d3 dl_main+0x15d3 (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ffa5ff _dl_sysdep_start+0x1df (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96ffbb17 _dl_start_final+0x5ab (inlined)\n\t    ffff96ffbb17 _dl_start+0x5ab (/usr/lib/ld-linux-aarch64.so.1)\n\t    ffff96fffad3 _start+0x13 (/usr/lib/ld-linux-aarch64.so.1)\n\npython 1402615 1423595.721083:       1427 cycles:Pu: \n\t          54cef8 PyUnicode_READ+0x2c (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          55b68b _PyUnicode_CheckConsistency+0x377 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          577873 _PyUnicode_InitStaticStrings+0x12f3 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          58e39f init_global_interned_strings+0x77 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          58e5e7 _PyUnicode_InitGlobalObjects+0x63 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          6534af pycore_init_global_objects+0x23 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t     
/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\npython 1402615 1423595.721148:      79601 cycles:Pu: \n\t          6526f4 siphash13+0x54 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          6528a7 pysiphash+0x23 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          652a3b _Py_HashBytes+0x17 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          55bbc7 unicode_hash+0x97 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          55bc0b hashtable_unicode_hash+0xb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          62f02f _Py_hashtable_get_entry_generic+0x23 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          62f4a3 _Py_hashtable_get+0xf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          55cf37 intern_static+0x67 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          576523 _PyUnicode_InternStatic+0x27 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          578f5b _PyUnicode_InitStaticStrings+0x29db (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          58e39f init_global_interned_strings+0x77 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          58e5e7 _PyUnicode_InitGlobalObjects+0x63 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          6534af pycore_init_global_objects+0x23 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          653a57 pycore_interp_init+0x2b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          653d33 pyinit_config+0xaf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65b3ab pyinit_core+0xdb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          65b483 Py_InitializeFromConfig+0x97 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b63f pymain_init+0xff (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b703 pymain_main+0xf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          68b797 Py_BytesMain+0x27 (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          41ddb7 main+0xb (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t    ffff96d9625b __libc_start_call_main+0x7b (/usr/lib64/libc.so.6)\n\t    ffff96d9633b __libc_start_main@@GLIBC_2.34+0x9b (/usr/lib64/libc.so.6)\n\t          41dcaf _start+0x2f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\npython 1402615 1423595.722167:     170821 cycles:Pu: \n\t          62f058 _Py_hashtable_get_entry_generic+0x4c (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          62f4a3 _Py_hashtable_get+0xf (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          55d1d7 intern_common+0x11b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          58eabb _PyUnicode_InternMortal+0x1b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          58eb77 PyUnicode_InternFromString+0x1f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          4bb583 descr_new+0x3f (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          4bc767 PyDescr_NewWrapper+0x2b (/home/buildbot/buildarea/3.13.cstratak-fedora-stable-aarch64.refleak/build/python)\n\t          53a52b add_operators+0x63 (/home/buildbot/buildarea/3.13.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

3 participants