From 0113891ca107d3f60e9388d9b8ef3d2ca5f5d4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sun, 13 Oct 2024 13:33:14 +0200 Subject: [PATCH] use GHCR images instead of Docker images --- _extensions/ubuntu_version.py | 28 ------------------------ conf.py | 8 ------- developer-workflow/extension-modules.rst | 28 ++++-------------------- 3 files changed, 4 insertions(+), 60 deletions(-) delete mode 100644 _extensions/ubuntu_version.py diff --git a/_extensions/ubuntu_version.py b/_extensions/ubuntu_version.py deleted file mode 100644 index 1298f35d98..0000000000 --- a/_extensions/ubuntu_version.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Sphinx extension to update the required Ubuntu version. - -The required Ubuntu version should be specified in conf.py by:: - - configure_ubuntu_version = "MAJOR.MINOR" # e.g., "22.04" - -The version must match the one used to regenerate the configure script in -https://github.com/python/cpython/blob/main/Tools/build/regen-configure.sh. -""" - -from sphinx.errors import ExtensionError - - -def replace_ubuntu_version(app, docname, source): - """Replace all occurrences of $CONFIGURE_UBUNTU_VERSION$. - - This is needed since RST replacement via ``|...|`` is not supported - in code-blocks directives. - """ - if (ubuntu_version := app.config.configure_ubuntu_version) is None: - raise ExtensionError("configure_ubuntu_version is not set in conf.py") - source[0] = source[0].replace("$CONFIGURE_UBUNTU_VERSION$", ubuntu_version) - - -def setup(app): - app.add_config_value("configure_ubuntu_version", None, "env", types=(str,)) - app.connect("source-read", replace_ubuntu_version) - return {"parallel_read_safe": True, "parallel_write_safe": True} diff --git a/conf.py b/conf.py index aed6592c38..842bf1b0c4 100644 --- a/conf.py +++ b/conf.py @@ -1,10 +1,6 @@ -import sys import time -sys.path.insert(0, '_extensions') - extensions = [ - 'ubuntu_version', 'notfound.extension', 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', @@ -203,7 +199,3 @@ copybutton_prompt_text = "$ " # https://sphinx-copybutton.readthedocs.io/en/latest/use.html#honor-line-continuation-characters-when-copying-multline-snippets copybutton_line_continuation_character = "\\" - -# Must be synchronized with the Ubuntu image version in -# https://github.com/python/cpython/blob/main/Tools/build/regen-configure.sh -configure_ubuntu_version = "22.04" diff --git a/developer-workflow/extension-modules.rst b/developer-workflow/extension-modules.rst index 7e32283c2e..d6621032fc 100644 --- a/developer-workflow/extension-modules.rst +++ b/developer-workflow/extension-modules.rst @@ -593,34 +593,14 @@ by executing :cpy-file:`Tools/build/regen-configure.sh`: ``make regen-configure`` and missing permissions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Since this rule requires `Docker `_ to be -running, the following can be done on Linux platforms (``systemctl``-based): - -.. code-block:: shell - - systemctl status docker # is the Docker service running? - sudo systemctl start docker # start it if it is not - sudo systemctl restart docker # or restart it if the issue persists - If Docker complains about missing permissions, this Stack Overflow post could be useful in solving the issue: `How to fix docker: permission denied `_. -Once the Docker service is running, check that you have an `Ubuntu -$CONFIGURE_UBUNTU_VERSION$ image `_, -or pull it if it is not case: - -.. code-block:: shell - - # check for the Docker image presence - docker images ubuntu:$CONFIGURE_UBUNTU_VERSION$ - # pull the Docker image if needed - docker image pull ubuntu:$CONFIGURE_UBUNTU_VERSION$ - -.. tip:: - - If the issue persists, you may try `podman `_. - The commands for listing or pulling an image are the same as ``docker``. +We also recommend using `podman `_ +instead of ``docker`` since the former does not require a background +service, or does not create files owned by the ``root`` user in some +cases. Missing ``Py_BUILD_CORE`` define when using internal headers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^