Skip to content

Commit 7fa21a1

Browse files
authored
Setup and Building: update code blocks (#947)
* Bump GitHub Actions * Strip the dollar prompt when copying code * Use prompts with console instead of promptless bash
1 parent 97a229f commit 7fa21a1

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v3
16+
- uses: actions/setup-python@v4
1717
with:
1818
python-version: "3.10"
1919
cache: pip

conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,7 @@
103103
}
104104

105105
todo_include_todos = True
106+
107+
# Strip the dollar prompt when copying code
108+
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#strip-and-configure-input-prompts-for-code-cells
109+
copybutton_prompt_text = "$"

getting-started/setup-building.rst

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,9 @@ If you want to install these optional dependencies, consult the
150150
If you don't need to install them, the basic steps for building Python
151151
for development is to configure it and then compile it.
152152

153-
Configuration is typically:
153+
Configuration is typically::
154154

155-
.. code-block:: bash
156-
157-
./configure --with-pydebug
155+
$ ./configure --with-pydebug
158156

159157
More flags are available to ``configure``, but this is the minimum you should
160158
do to get a pydebug build of CPython.
@@ -163,11 +161,9 @@ do to get a pydebug build of CPython.
163161
You might need to run ``make clean`` before or after re-running ``configure``
164162
in a particular build directory.
165163

166-
Once ``configure`` is done, you can then compile CPython with:
167-
168-
.. code-block:: bash
164+
Once ``configure`` is done, you can then compile CPython with::
169165

170-
make -s -j2
166+
$ make -s -j2
171167

172168
This will build CPython with only warnings and errors being printed to
173169
stderr and utilize up to 2 CPU cores. If you are using a multi-core machine
@@ -465,11 +461,9 @@ Python's ``configure.ac`` script typically requires a specific version of
465461
Autoconf. At the moment, this reads: ``AC_PREREQ(2.69)``. It also requires
466462
to have the ``autoconf-archive`` and ``pkg-config`` utilities installed in
467463
the system and the ``pkg.m4`` macro file located in the appropriate ``alocal``
468-
location. You can easily check if this is correctly configured by running:
464+
location. You can easily check if this is correctly configured by running::
469465

470-
.. code-block:: bash
471-
472-
ls $(aclocal --print-ac-dir) | grep pkg.m4
466+
$ ls $(aclocal --print-ac-dir) | grep pkg.m4
473467

474468
If the system copy of Autoconf does not match this version, you will need to
475469
install your own copy of Autoconf.
@@ -501,9 +495,7 @@ Make target. Note that for doing this you need to regenerate the ABI file in
501495
the same environment that the GitHub CI uses to check for it. This is because
502496
different platforms may include some platform-specific details that make the
503497
check fail even if the Python ABI is the same. The easier way to regenerate
504-
the ABI file using the same platform as the CI uses is by using docker:
505-
506-
.. code-block:: bash
498+
the ABI file using the same platform as the CI uses is by using Docker::
507499

508500
# In the CPython root:
509501
$ docker run -v$(pwd):/src:Z -w /src --rm -it ubuntu:22.04 \

0 commit comments

Comments
 (0)