Skip to content

Commit 1979ba1

Browse files
committed
Prefer py.exe whereever possible on Windows
use tab layout so users can shift between windows/*nix Signed-off-by: Naveen M K <naveen@syrusdark.website>
1 parent 3a11322 commit 1979ba1

10 files changed

Lines changed: 558 additions & 123 deletions

source/guides/distributing-packages-using-setuptools.rst

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,23 @@ conflicts, prefer the advice in the Python Packaging User Guide.
2323

2424
Requirements for packaging and distributing
2525
===========================================
26-
26+
2727
1. First, make sure you have already fulfilled the :ref:`requirements for
2828
installing packages <installing_requirements>`.
2929

30-
2. Install "twine" [1]_:
30+
2. Install "twine" [1]_:
31+
32+
.. tab:: Unix/macOS
33+
34+
.. code-block:: bash
3135
32-
::
36+
python3 -m pip install twine
3337
34-
python -m pip install twine
38+
.. tab:: Windows
39+
40+
.. code-block:: bash
41+
42+
py -m pip install twine
3543
3644
You'll need this to upload your project :term:`distributions <Distribution
3745
Package>` to :term:`PyPI <Python Package Index (PyPI)>` (see :ref:`below
@@ -751,10 +759,17 @@ called a :ref:`*Platform Wheel* (see section below) <Platform Wheels>`.
751759
Before you can build wheels for your project, you'll need to install the
752760
``wheel`` package:
753761

754-
.. code-block:: text
762+
.. tab:: Unix/macOS
755763

756-
python -m pip install wheel
764+
.. code-block:: bash
757765
766+
python3 -m pip install wheel
767+
768+
.. tab:: Windows
769+
770+
.. code-block:: bash
771+
772+
py -m pip install wheel
758773
759774
.. _`Universal Wheels`:
760775

@@ -767,9 +782,17 @@ anywhere by :ref:`pip`.
767782

768783
To build the wheel:
769784

770-
.. code-block:: text
785+
.. tab:: Unix/macOS
786+
787+
.. code-block:: bash
788+
789+
python3 setup.py bdist_wheel --universal
771790
772-
python setup.py bdist_wheel --universal
791+
.. tab:: Windows
792+
793+
.. code-block:: bash
794+
795+
py setup.py bdist_wheel --universal
773796
774797
You can also permanently set the ``--universal`` flag in :file:`setup.cfg`:
775798

@@ -803,10 +826,17 @@ and 3.
803826

804827
To build the wheel:
805828

806-
::
829+
.. tab:: Unix/macOS
830+
831+
.. code-block:: bash
832+
833+
python3 setup.py bdist_wheel
834+
835+
.. tab:: Windows
807836

808-
python setup.py bdist_wheel
837+
.. code-block:: bash
809838
839+
py setup.py bdist_wheel
810840
811841
``bdist_wheel`` will detect that the code is pure Python, and build a wheel
812842
that's named such that it's usable on any Python installation with the same
@@ -830,9 +860,17 @@ macOS, or Windows, usually due to containing compiled extensions.
830860

831861
To build the wheel:
832862

833-
::
863+
.. tab:: Unix/macOS
864+
865+
.. code-block:: bash
866+
867+
python3 setup.py bdist_wheel
868+
869+
.. tab:: Windows
870+
871+
.. code-block:: bash
834872
835-
python setup.py bdist_wheel
873+
py setup.py bdist_wheel
836874
837875
838876
:command:`bdist_wheel` will detect that the code is not pure Python, and build

source/guides/dropping-older-python-versions.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,19 @@ Defining the Python version required
5757

5858
Ensure that before you generate source distributions or binary distributions, you update Setuptools and install twine.
5959

60-
Steps::
60+
Steps
6161

62-
python -m pip install --upgrade setuptools twine
62+
.. tab:: Unix/macOS
63+
64+
.. code-block:: bash
65+
66+
python3 -m pip install --upgrade setuptools twine
67+
68+
.. tab:: Windows
69+
70+
.. code-block:: bash
71+
72+
py -m pip install --upgrade setuptools twine
6373
6474
`setuptools` version should be above 24.0.0.
6575

source/guides/hosting-your-own-index.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,19 @@ generate an autoindex.
1212

1313
In either case, since you'll be hosting a repository that is likely not in
1414
your user's default repositories, you should instruct them in your project's
15-
description to configure their installer appropriately. For example with pip::
15+
description to configure their installer appropriately. For example with pip
1616

17-
python -m pip install --extra-index-url https://python.example.com/ foobar
17+
.. tab:: Unix/macOS
18+
19+
.. code-block:: bash
20+
21+
python3 -m pip install --extra-index-url https://python.example.com/ foobar
22+
23+
.. tab:: Windows
24+
25+
.. code-block:: bash
26+
27+
py -m pip install --extra-index-url https://python.example.com/ foobar
1828
1929
In addition, it is **highly** recommended that you serve your repository with
2030
valid HTTPS. At this time, the security of your user's installations depends on

0 commit comments

Comments
 (0)