Skip to content

Commit 881ac61

Browse files
committed
Group container instruction in Setup into a single section
Having two top-level sections that both use the container seemed unnecessary. Also update an internal link to make it easier to find the container definition file.
1 parent 053d92f commit 881ac61

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

getting-started/setup-building.rst

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -386,14 +386,14 @@ compiler just like building for :ref:`Unix <unix-compiling>` as well as:
386386
1. A C compiler that can target WebAssembly (for example, `WASI SDK`_)
387387
2. A WASI host/runtime (for example, Wasmtime_)
388388

389-
All of this is provided in the :ref:`devcontainer <using-codespaces>`. You can
389+
All of this is provided in the :ref:`devcontainer <using-a-container>`. You can
390390
also use what's installed in the container as a reference of what versions of
391391
these tools are known to work.
392392

393393
.. note::
394394

395-
CPython has only been verified with the above tools for WASI. Using
396-
other compilers, hosts, or WASI versions *should* work, but the above tools
395+
CPython has only been verified with the certain tools for WASI. Using
396+
other compilers, hosts, or WASI versions *should* work, but the tools
397397
and their versions specified in the container are tested via a
398398
:ref:`buildbot <buildbots>`.
399399

@@ -1124,17 +1124,26 @@ every rule.
11241124
.. c_directory_structure_end
11251125
11261126
1127+
.. _using-a-container:
1128+
1129+
Using a container
1130+
=================
1131+
1132+
There are various ways to use a container to build CPython without installing
1133+
additional tools on your machine. All approaches use the container defined in
1134+
the `cpython-devcontainers repo`_ in some way.
1135+
11271136
.. _using-codespaces:
11281137

11291138
Contribute using GitHub Codespaces
1130-
==================================
1139+
----------------------------------
11311140

11321141
.. c_codespaces_start
11331142
11341143
.. _codespaces-whats-codespaces:
11351144

11361145
What is GitHub Codespaces?
1137-
--------------------------
1146+
^^^^^^^^^^^^^^^^^^^^^^^^^^
11381147

11391148
If you'd like to start contributing to CPython without needing to set up a local
11401149
developer environment, you can use
@@ -1153,7 +1162,7 @@ you'd prefer to use that directly.
11531162
.. _codespaces-create-a-codespace:
11541163

11551164
Create a CPython codespace
1156-
--------------------------
1165+
^^^^^^^^^^^^^^^^^^^^^^^^^^
11571166

11581167
Here are the basic steps needed to contribute a pull request using Codespaces.
11591168
You first need to navigate to the
@@ -1182,7 +1191,7 @@ up from where you left off!
11821191
.. _codespaces-use-locally:
11831192

11841193
Use Codespaces locally
1185-
----------------------
1194+
^^^^^^^^^^^^^^^^^^^^^^
11861195

11871196
On the bottom left side of the codespace screen you will see a green or grey
11881197
square that says :guilabel:`Codespaces`. You can click this for additional
@@ -1191,10 +1200,12 @@ select the option ``Open in VS Code``. You will still be working on the remote
11911200
codespace instance, thus using the remote instance's compute power. The compute
11921201
power may be a much higher spec than your local machine which can be helpful.
11931202

1203+
.. c_codespaces_end
1204+
11941205
.. _devcontainer-directly:
11951206

11961207
Using the dev container directly
1197-
================================
1208+
--------------------------------
11981209

11991210
If you want more control over the environment, or to work offline,
12001211
you can use the same container used in
@@ -1208,7 +1219,7 @@ installed.
12081219
.. _devcontainer-image:
12091220

12101221
Using the pre-built container image
1211-
-----------------------------------
1222+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12121223

12131224
`Dev container images <https://github.com/python/cpython-devcontainers/pkgs/container/devcontainer>`__
12141225
are available from the
@@ -1232,10 +1243,10 @@ to remove caches and build output generated for your host OS.
12321243
.. _devcontainer-build:
12331244

12341245
Building yourself
1235-
-----------------
1246+
^^^^^^^^^^^^^^^^^
12361247

12371248
If you prefer, you can build the container image yourself. In a clone of the
1238-
`cpython-devcontainers repo <https://github.com/python/cpython-devcontainers>`_,
1249+
`cpython-devcontainers repo`_,
12391250
build the container and name it ``cpython-dev``:
12401251

12411252
.. code-block:: bash
@@ -1262,7 +1273,6 @@ in a clone of the CPython repository.
12621273
The same caveats outlined above when running from a container image from GHCR
12631274
also apply here.
12641275

1265-
.. c_codespaces_end
1266-
12671276

1277+
.. _cpython-devcontainers repo: https://github.com/python/cpython-devcontainers
12681278
.. include:: ../links.rst

0 commit comments

Comments
 (0)