Skip to content

Commit 2a6cbd2

Browse files
authored
Add inline tabs on Quick Reference page for commands on different systems (#1205)
* add sphinx-inline-tabs dependency * implement system environment instructions in tabs * sort requirements alphabetically * sort extensions alphabetically * remove whitespace from empty line * move macOS note into macOS tab * remove redundant explanation
1 parent eaf1ed8 commit 2a6cbd2

File tree

3 files changed

+52
-15
lines changed

3 files changed

+52
-15
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'sphinx.ext.intersphinx',
1212
'sphinx.ext.todo',
1313
'sphinx_copybutton',
14+
'sphinx_inline_tabs',
1415
'sphinxext.opengraph',
1516
'sphinxext.rediraffe',
1617
]

index.rst

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,54 @@ instructions please see the :ref:`setup guide <setup>`.
2727
git clone https://github.com/<your_username>/cpython
2828
cd cpython
2929

30-
3. Build Python, on Unix and macOS use::
30+
3. Build Python:
3131

32-
./configure --with-pydebug && make -j
32+
.. tab:: Unix
3333

34-
and on Windows use:
34+
.. code-block:: shell
3535
36-
.. code-block:: dosbatch
36+
./configure --with-pydebug && make -j
3737
38-
PCbuild\build.bat -e -d
38+
.. tab:: macOS
39+
40+
.. code-block:: shell
41+
42+
./configure --with-pydebug && make -j
43+
44+
.. tab:: Windows
45+
46+
.. code-block:: dosbatch
47+
48+
PCbuild\build.bat -e -d
3949
4050
See also :ref:`more detailed instructions <compiling>`,
4151
:ref:`how to install and build dependencies <build-dependencies>`,
4252
and the platform-specific pages for :ref:`Unix <unix-compiling>`,
4353
:ref:`macOS`, and :ref:`Windows <windows-compiling>`.
4454

45-
4. :ref:`Run the tests <runtests>`::
55+
4. :ref:`Run the tests <runtests>`:
56+
57+
.. tab:: Unix
58+
59+
.. code-block:: shell
60+
61+
./python -m test -j3
62+
63+
.. tab:: macOS
4664

47-
./python -m test -j3
65+
.. code-block:: shell
4866
49-
On :ref:`most <mac-python.exe>` macOS systems, replace :file:`./python`
50-
with :file:`./python.exe`. On Windows, use :file:`python.bat`.
67+
./python.exe -m test -j3
68+
69+
Note: :ref:`Most <mac-python.exe>` macOS systems use
70+
:file:`./python.exe` in order to avoid filename conflicts with
71+
the ``Python`` directory.
72+
73+
.. tab:: Windows
74+
75+
.. code-block:: dosbatch
76+
77+
.\python.bat -m test -j3
5178
5279
5. Create a new branch where your work for the issue will go, e.g.::
5380

@@ -57,17 +84,25 @@ instructions please see the :ref:`setup guide <setup>`.
5784
<https://github.com/python/cpython/issues>`_. Trivial issues (e.g. typo fixes) do
5885
not require any issue to be created.
5986

60-
6. Once you fixed the issue, run the tests, and the patchcheck.
87+
6. Once you fixed the issue, run the tests, and the patchcheck:
88+
89+
.. tab:: Unix
90+
91+
.. code-block:: shell
92+
93+
make patchcheck
94+
95+
.. tab:: macOS
6196

62-
On Unix and macOS use::
97+
.. code-block:: shell
6398
64-
make patchcheck
99+
make patchcheck
65100
66-
and on Windows:
101+
.. tab:: Windows
67102

68-
.. code-block:: dosbatch
103+
.. code-block:: dosbatch
69104
70-
.\python.bat Tools\patchcheck\patchcheck.py
105+
.\python.bat Tools\patchcheck\patchcheck.py
71106
72107
If everything is ok, commit.
73108

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Sphinx~=7.2.6
22
furo>=2022.6.4
33
jinja2
4+
sphinx-inline-tabs>=2023.4.21
45
sphinx-lint==0.6.8
56
sphinx-notfound-page>=1.0.0
67
sphinx_copybutton>=0.3.3

0 commit comments

Comments
 (0)