Skip to content

Commit

Permalink
Add inline tabs on Quick Reference page for commands on different sys…
Browse files Browse the repository at this point in the history
…tems (#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
  • Loading branch information
lancegoyke committed Oct 26, 2023
1 parent eaf1ed8 commit 2a6cbd2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
1 change: 1 addition & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx_copybutton',
'sphinx_inline_tabs',
'sphinxext.opengraph',
'sphinxext.rediraffe',
]
Expand Down
65 changes: 50 additions & 15 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,54 @@ instructions please see the :ref:`setup guide <setup>`.
git clone https://github.com/<your_username>/cpython
cd cpython

3. Build Python, on Unix and macOS use::
3. Build Python:

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

and on Windows use:
.. code-block:: shell
.. code-block:: dosbatch
./configure --with-pydebug && make -j
PCbuild\build.bat -e -d
.. tab:: macOS

.. code-block:: shell
./configure --with-pydebug && make -j
.. tab:: Windows

.. code-block:: dosbatch
PCbuild\build.bat -e -d
See also :ref:`more detailed instructions <compiling>`,
:ref:`how to install and build dependencies <build-dependencies>`,
and the platform-specific pages for :ref:`Unix <unix-compiling>`,
:ref:`macOS`, and :ref:`Windows <windows-compiling>`.

4. :ref:`Run the tests <runtests>`::
4. :ref:`Run the tests <runtests>`:

.. tab:: Unix

.. code-block:: shell
./python -m test -j3
.. tab:: macOS

./python -m test -j3
.. code-block:: shell
On :ref:`most <mac-python.exe>` macOS systems, replace :file:`./python`
with :file:`./python.exe`. On Windows, use :file:`python.bat`.
./python.exe -m test -j3
Note: :ref:`Most <mac-python.exe>` macOS systems use
:file:`./python.exe` in order to avoid filename conflicts with
the ``Python`` directory.

.. tab:: Windows

.. code-block:: dosbatch
.\python.bat -m test -j3
5. Create a new branch where your work for the issue will go, e.g.::

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

6. Once you fixed the issue, run the tests, and the patchcheck.
6. Once you fixed the issue, run the tests, and the patchcheck:

.. tab:: Unix

.. code-block:: shell
make patchcheck
.. tab:: macOS

On Unix and macOS use::
.. code-block:: shell
make patchcheck
make patchcheck
and on Windows:
.. tab:: Windows

.. code-block:: dosbatch
.. code-block:: dosbatch
.\python.bat Tools\patchcheck\patchcheck.py
.\python.bat Tools\patchcheck\patchcheck.py
If everything is ok, commit.

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Sphinx~=7.2.6
furo>=2022.6.4
jinja2
sphinx-inline-tabs>=2023.4.21
sphinx-lint==0.6.8
sphinx-notfound-page>=1.0.0
sphinx_copybutton>=0.3.3
Expand Down

0 comments on commit 2a6cbd2

Please sign in to comment.