From 6b2b2b0d499c95e0590f86a2dd8f04c66eaf0675 Mon Sep 17 00:00:00 2001 From: Neha Kulal Date: Mon, 5 Oct 2026 13:43:38 +0000 Subject: [PATCH 1/2] Fix PDF build by removing incompatible emoji characters --- .../github-actions-ci-cd-sample/publish-to-pypi.yml | 12 ++++++------ .../installing-stand-alone-command-line-tools.rst | 2 +- ...releases-using-github-actions-ci-cd-workflows.rst | 2 +- source/index.rst | 2 +- source/tutorials/managing-dependencies.rst | 2 +- source/tutorials/packaging-projects.rst | 1 - 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml b/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml index 155f825551..f60de09a96 100644 --- a/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml +++ b/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml @@ -1,10 +1,10 @@ -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI +name: Publish Python distribution to PyPI and TestPyPI on: push jobs: build: - name: Build distribution 📦 + name: Build distribution runs-on: ubuntu-latest steps: @@ -31,7 +31,7 @@ jobs: publish-to-pypi: name: >- - Publish Python 🐍 distribution 📦 to PyPI + Publish Python distribution to PyPI if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes needs: - build @@ -48,11 +48,11 @@ jobs: with: name: python-package-distributions path: dist/ - - name: Publish distribution 📦 to PyPI + - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 publish-to-testpypi: - name: Publish Python 🐍 distribution 📦 to TestPyPI + name: Publish Python distribution to TestPyPI needs: - build runs-on: ubuntu-latest @@ -70,7 +70,7 @@ jobs: with: name: python-package-distributions path: dist/ - - name: Publish distribution 📦 to TestPyPI + - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ diff --git a/source/guides/installing-stand-alone-command-line-tools.rst b/source/guides/installing-stand-alone-command-line-tools.rst index c078fd1e48..95f2e51f84 100644 --- a/source/guides/installing-stand-alone-command-line-tools.rst +++ b/source/guides/installing-stand-alone-command-line-tools.rst @@ -59,7 +59,7 @@ For example: installed package cowsay 6.1, installed using Python 3.12.2 These apps are now globally available - cowsay - done! ✨ 🌟 ✨ + done! $ cowsay -t moo ___ < moo > diff --git a/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst b/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst index 035a8af8a0..6943eae44a 100644 --- a/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst +++ b/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst @@ -48,7 +48,7 @@ pre-existing project, if you are its owner. them in your PyPI and TestPyPI account settings in case you are replacing your old setup with the new one. -Let's begin! 🚀 +Let's begin! 1. Go to https://pypi.org/manage/account/publishing/. 2. Fill in the name you wish to publish your new diff --git a/source/index.rst b/source/index.rst index aa522c8c5d..e73f0a4c12 100644 --- a/source/index.rst +++ b/source/index.rst @@ -27,7 +27,7 @@ references to help you distribute and install Python packages with modern tools. This guide is maintained on `GitHub`_ by the :doc:`Python Packaging Authority `. We -happily accept :doc:`contributions and feedback `. 😊 +happily accept :doc:`contributions and feedback `. .. _GitHub: https://github.com/pypa/packaging.python.org diff --git a/source/tutorials/managing-dependencies.rst b/source/tutorials/managing-dependencies.rst index bb67a60e36..19ea55459f 100644 --- a/source/tutorials/managing-dependencies.rst +++ b/source/tutorials/managing-dependencies.rst @@ -140,7 +140,7 @@ Next steps ---------- Congratulations, you now know how to effectively manage dependencies and -development environments on a collaborative Python project! ✨ 🍰 ✨ +development environments on a collaborative Python project! If you're interested in creating and distributing your own Python packages, see the :ref:`tutorial on packaging and distributing packages `. diff --git a/source/tutorials/packaging-projects.rst b/source/tutorials/packaging-projects.rst index 4f69de20be..2b526ae9be 100644 --- a/source/tutorials/packaging-projects.rst +++ b/source/tutorials/packaging-projects.rst @@ -484,7 +484,6 @@ Next steps ---------- **Congratulations, you've packaged and distributed a Python project!** -✨ 🍰 ✨ Keep in mind that this tutorial showed you how to upload your package to Test PyPI, which isn't a permanent storage. The Test system occasionally deletes From a34c2fe30fbaaf6d48aabe91ea4f52e127266e14 Mon Sep 17 00:00:00 2001 From: Neha Kulal Date: Wed, 7 Oct 2026 16:19:20 +0000 Subject: [PATCH 2/2] Restore source emojis and strip them only for LaTeX output --- pug_sphinx_extensions/__init__.py | 18 ++++++++++++++++++ .../publish-to-pypi.yml | 12 ++++++------ ...stalling-stand-alone-command-line-tools.rst | 2 +- ...es-using-github-actions-ci-cd-workflows.rst | 2 +- source/index.rst | 2 +- source/tutorials/managing-dependencies.rst | 2 +- source/tutorials/packaging-projects.rst | 1 + 7 files changed, 29 insertions(+), 10 deletions(-) diff --git a/pug_sphinx_extensions/__init__.py b/pug_sphinx_extensions/__init__.py index 00d91da3c9..4d99009b2d 100644 --- a/pug_sphinx_extensions/__init__.py +++ b/pug_sphinx_extensions/__init__.py @@ -1,9 +1,12 @@ import os import pathlib +import re import urllib +from docutils import nodes import sphinx.application import sphinx.util.logging +from sphinx.transforms.post_transforms import SphinxPostTransform DOMAIN = "packaging.python.org" @@ -12,6 +15,20 @@ logger = sphinx.util.logging.getLogger(__name__) +_LATEX_EMOJI_RE = re.compile(r"[ \t]*[😊✨🌟🍰🚀🐍📦](?:[ \t]+[😊✨🌟🍰🚀🐍📦])*") + + +class LatexEmojiTransform(SphinxPostTransform): + default_priority = 500 + formats = ("latex",) + + def run(self, **kwargs: object) -> None: + for text_node in self.document.findall(nodes.Text): + sanitized = _LATEX_EMOJI_RE.sub("", text_node.astext()) + if sanitized != text_node.astext(): + text_node.parent.replace(text_node, nodes.Text(sanitized)) + + def resolve_local_html_link(app: sphinx.application.Sphinx, url_path: str) -> str: """Takes path of a link pointing an HTML render of the current project, and returns local path of the referenced document. @@ -79,6 +96,7 @@ def rewrite_local_uri(app: sphinx.application.Sphinx, uri: str) -> str: def setup(app: sphinx.application.Sphinx) -> dict[str, bool]: app.connect("linkcheck-process-uri", rewrite_local_uri) + app.add_post_transform(LatexEmojiTransform) return { "parallel_read_safe": True, diff --git a/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml b/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml index f60de09a96..155f825551 100644 --- a/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml +++ b/source/guides/github-actions-ci-cd-sample/publish-to-pypi.yml @@ -1,10 +1,10 @@ -name: Publish Python distribution to PyPI and TestPyPI +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI on: push jobs: build: - name: Build distribution + name: Build distribution 📦 runs-on: ubuntu-latest steps: @@ -31,7 +31,7 @@ jobs: publish-to-pypi: name: >- - Publish Python distribution to PyPI + Publish Python 🐍 distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes needs: - build @@ -48,11 +48,11 @@ jobs: with: name: python-package-distributions path: dist/ - - name: Publish distribution to PyPI + - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 publish-to-testpypi: - name: Publish Python distribution to TestPyPI + name: Publish Python 🐍 distribution 📦 to TestPyPI needs: - build runs-on: ubuntu-latest @@ -70,7 +70,7 @@ jobs: with: name: python-package-distributions path: dist/ - - name: Publish distribution to TestPyPI + - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ diff --git a/source/guides/installing-stand-alone-command-line-tools.rst b/source/guides/installing-stand-alone-command-line-tools.rst index 95f2e51f84..c078fd1e48 100644 --- a/source/guides/installing-stand-alone-command-line-tools.rst +++ b/source/guides/installing-stand-alone-command-line-tools.rst @@ -59,7 +59,7 @@ For example: installed package cowsay 6.1, installed using Python 3.12.2 These apps are now globally available - cowsay - done! + done! ✨ 🌟 ✨ $ cowsay -t moo ___ < moo > diff --git a/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst b/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst index 6943eae44a..035a8af8a0 100644 --- a/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst +++ b/source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst @@ -48,7 +48,7 @@ pre-existing project, if you are its owner. them in your PyPI and TestPyPI account settings in case you are replacing your old setup with the new one. -Let's begin! +Let's begin! 🚀 1. Go to https://pypi.org/manage/account/publishing/. 2. Fill in the name you wish to publish your new diff --git a/source/index.rst b/source/index.rst index e73f0a4c12..aa522c8c5d 100644 --- a/source/index.rst +++ b/source/index.rst @@ -27,7 +27,7 @@ references to help you distribute and install Python packages with modern tools. This guide is maintained on `GitHub`_ by the :doc:`Python Packaging Authority `. We -happily accept :doc:`contributions and feedback `. +happily accept :doc:`contributions and feedback `. 😊 .. _GitHub: https://github.com/pypa/packaging.python.org diff --git a/source/tutorials/managing-dependencies.rst b/source/tutorials/managing-dependencies.rst index 19ea55459f..bb67a60e36 100644 --- a/source/tutorials/managing-dependencies.rst +++ b/source/tutorials/managing-dependencies.rst @@ -140,7 +140,7 @@ Next steps ---------- Congratulations, you now know how to effectively manage dependencies and -development environments on a collaborative Python project! +development environments on a collaborative Python project! ✨ 🍰 ✨ If you're interested in creating and distributing your own Python packages, see the :ref:`tutorial on packaging and distributing packages `. diff --git a/source/tutorials/packaging-projects.rst b/source/tutorials/packaging-projects.rst index 2b526ae9be..4f69de20be 100644 --- a/source/tutorials/packaging-projects.rst +++ b/source/tutorials/packaging-projects.rst @@ -484,6 +484,7 @@ Next steps ---------- **Congratulations, you've packaged and distributed a Python project!** +✨ 🍰 ✨ Keep in mind that this tutorial showed you how to upload your package to Test PyPI, which isn't a permanent storage. The Test system occasionally deletes