Skip to content

Commit a95d0b1

Browse files
dukecat0bhrutledge
andauthored
Change to code-block:: text from code-block:: bash & update the version of pip (#937)
* Change to `text` from `bash` & update the version of pip * Remove `messages.pot` from this PR * Update source/guides/installing-using-pip-and-virtual-environments.rst Co-authored-by: Brian Rutledge <[email protected]> * separate the command from its output * Split which/where output * Rework installing pip section * Use bat for Windows input * Use bash for Unix input Co-authored-by: Brian Rutledge <[email protected]>
1 parent 60b75be commit a95d0b1

10 files changed

+93
-76
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Requirements for packaging and distributing
3636
3737
.. tab:: Windows
3838

39-
.. code-block:: bash
39+
.. code-block:: bat
4040
4141
py -m pip install twine
4242
@@ -728,7 +728,7 @@ Before you can build wheels and sdists for your project, you'll need to install
728728
729729
.. tab:: Windows
730730

731-
.. code-block:: bash
731+
.. code-block:: bat
732732
733733
py -m pip install build
734734
@@ -747,7 +747,7 @@ Minimally, you should create a :term:`Source Distribution <Source Distribution (
747747
748748
.. tab:: Windows
749749

750-
.. code-block:: bash
750+
.. code-block:: bat
751751
752752
py -m build --sdist
753753
@@ -804,7 +804,7 @@ To build the wheel:
804804
805805
.. tab:: Windows
806806

807-
.. code-block:: bash
807+
.. code-block:: bat
808808
809809
py -m build --wheel
810810
@@ -833,7 +833,7 @@ To build the wheel:
833833
834834
.. tab:: Windows
835835

836-
.. code-block:: bash
836+
.. code-block:: bat
837837
838838
py -m build --wheel
839839
@@ -930,7 +930,7 @@ it will be automatically created when the first release is uploaded.
930930
For the second and subsequent releases, PyPI only requires that the
931931
version number of the new release differ from any previous releases.
932932

933-
.. code-block:: text
933+
.. code-block:: bash
934934
935935
twine upload dist/*
936936

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Steps:
6767
6868
.. tab:: Windows
6969

70-
.. code-block:: bash
70+
.. code-block:: bat
7171
7272
py -m pip install  --upgrade setuptools twine
7373

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ description to configure their installer appropriately. For example with pip:
2222
2323
.. tab:: Windows
2424

25-
.. code-block:: bash
25+
.. code-block:: bat
2626
2727
py -m pip install --extra-index-url https://python.example.com/ foobar
2828

source/guides/installing-using-pip-and-virtual-environments.rst

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ installed.
2121

2222
.. tab:: Unix/macOS
2323

24-
Debian and most other distributions include a `python-pip`_ package, if you
25-
want to use the Linux distribution-provided versions of pip see
24+
Debian and most other distributions include a `python-pip`_ package; if you
25+
want to use the Linux distribution-provided versions of pip, see
2626
:doc:`/guides/installing-using-linux-tools`.
2727

2828
You can also install pip yourself to ensure you have the latest version. It's
@@ -32,30 +32,34 @@ installed.
3232
3333
python3 -m pip install --user --upgrade pip
3434
35-
Afterwards, you should have the newest pip installed in your user site:
35+
python3 -m pip --version
3636
37-
.. code-block:: bash
37+
Afterwards, you should have the latest version of pip installed in your
38+
user site:
3839

39-
python3 -m pip --version
40-
pip 9.0.1 from $HOME/.local/lib/python3.6/site-packages (python 3.6)
40+
.. code-block:: text
41+
42+
pip 21.1.3 from $HOME/.local/lib/python3.9/site-packages (python 3.9)
4143
4244
.. _python-pip: https://packages.debian.org/stable/python-pip
4345

4446
.. tab:: Windows
4547

46-
The Python installers for Windows include pip. You should be able to access
47-
pip using:
48+
The Python installers for Windows include pip. You can make sure that pip is
49+
up-to-date by running:
4850

49-
.. code-block:: bash
51+
.. code-block:: bat
52+
53+
py -m pip install --upgrade pip
5054
5155
py -m pip --version
52-
pip 9.0.1 from c:\python36\lib\site-packages (Python 3.6.1)
5356
54-
You can make sure that pip is up-to-date by running:
57+
Afterwards, you should have the latest version of pip:
5558

56-
.. code-block:: bash
59+
.. code-block:: text
60+
61+
pip 21.1.3 from c:\python39\lib\site-packages (Python 3.9.4)
5762
58-
py -m pip install --upgrade pip
5963
6064
6165
Installing virtualenv
@@ -81,7 +85,7 @@ using pip.
8185
8286
.. tab:: Windows
8387

84-
.. code-block:: bash
88+
.. code-block:: bat
8589
8690
py -m pip install --user virtualenv
8791
@@ -111,7 +115,7 @@ in the below commands.
111115
112116
.. tab:: Windows
113117

114-
.. code-block:: bash
118+
.. code-block:: bat
115119
116120
py -m venv env
117121
@@ -140,27 +144,40 @@ virtual environment-specific
140144
141145
.. tab:: Windows
142146

143-
.. code-block:: text
147+
.. code-block:: bat
144148
145149
.\env\Scripts\activate
146150
147151
You can confirm you're in the virtual environment by checking the location of your
148-
Python interpreter, it should point to the ``env`` directory.
152+
Python interpreter:
149153

150154
.. tab:: Unix/macOS
151155

152156
.. code-block:: bash
153157
154158
which python
155-
.../env/bin/python
156159
157160
.. tab:: Windows
158161

159-
.. code-block:: text
162+
.. code-block:: bat
160163
161164
where python
165+
166+
It should be in the ``env`` directory:
167+
168+
.. tab:: Unix/macOS
169+
170+
.. code-block:: bash
171+
172+
.../env/bin/python
173+
174+
.. tab:: Windows
175+
176+
.. code-block:: bat
177+
162178
...\env\Scripts\python.exe
163179
180+
164181
As long as your virtual environment is activated pip will install packages into that
165182
specific environment and you'll be able to import and use packages in your
166183
Python application.
@@ -193,7 +210,7 @@ Now that you're in your virtual environment you can install packages. Let's inst
193210
194211
.. tab:: Windows
195212

196-
.. code-block:: bash
213+
.. code-block:: bat
197214
198215
py -m pip install requests
199216
@@ -232,7 +249,7 @@ a specific version of ``requests``:
232249
233250
.. tab:: Windows
234251

235-
.. code-block:: bash
252+
.. code-block:: bat
236253
237254
py -m pip install requests==2.18.4
238255
@@ -246,7 +263,7 @@ To install the latest ``2.x`` release of requests:
246263
247264
.. tab:: Windows
248265

249-
.. code-block:: bash
266+
.. code-block:: bat
250267
251268
py -m pip install requests>=2.0.0,<3.0.0
252269
@@ -260,7 +277,7 @@ To install pre-release versions of packages, use the ``--pre`` flag:
260277
261278
.. tab:: Windows
262279

263-
.. code-block:: bash
280+
.. code-block:: bat
264281
265282
py -m pip install --pre requests
266283
@@ -279,7 +296,7 @@ specifying the extra in brackets:
279296
280297
.. tab:: Windows
281298

282-
.. code-block:: bash
299+
.. code-block:: bat
283300
284301
py -m pip install requests[security]
285302
@@ -301,7 +318,7 @@ pip can install a package directly from source, for example:
301318
302319
.. tab:: Windows
303320

304-
.. code-block:: bash
321+
.. code-block:: bat
305322
306323
cd google-auth
307324
py -m pip install .
@@ -318,7 +335,7 @@ installed package without needing to re-install:
318335
319336
.. tab:: Windows
320337

321-
.. code-block:: bash
338+
.. code-block:: bat
322339
323340
py -m pip install --editable .
324341
@@ -354,7 +371,7 @@ wheel, or tar file) you can install it directly with pip:
354371
355372
.. tab:: Windows
356373

357-
.. code-block:: bash
374+
.. code-block:: bat
358375
359376
py -m pip install requests-2.18.4.tar.gz
360377
@@ -370,7 +387,7 @@ pip to look for packages there and not to use the
370387
371388
.. tab:: Windows
372389

373-
.. code-block:: bash
390+
.. code-block:: bat
374391
375392
py -m pip install --no-index --find-links=/local/dir/ requests
376393
@@ -393,7 +410,7 @@ If you want to download packages from a different index than the
393410
394411
.. tab:: Windows
395412

396-
.. code-block:: bash
413+
.. code-block:: bat
397414
398415
py -m pip install --index-url http://index.example.com/simple/ SomeProject
399416
@@ -409,7 +426,7 @@ and a separate index, you can use the ``--extra-index-url`` flag instead:
409426
410427
.. tab:: Windows
411428

412-
.. code-block:: bash
429+
.. code-block:: bat
413430
414431
py -m pip install --extra-index-url http://index.example.com/simple/ SomeProject
415432
@@ -427,7 +444,7 @@ install the latest version of ``requests`` and all of its dependencies:
427444
428445
.. tab:: Windows
429446

430-
.. code-block:: bash
447+
.. code-block:: bat
431448
432449
py -m pip install --upgrade requests
433450
@@ -453,7 +470,7 @@ And tell pip to install all of the packages in this file using the ``-r`` flag:
453470
454471
.. tab:: Windows
455472

456-
.. code-block:: bash
473+
.. code-block:: bat
457474
458475
py -m pip install -r requirements.txt
459476
@@ -471,7 +488,7 @@ Pip can export a list of all installed packages and their versions using the
471488
472489
.. tab:: Windows
473490

474-
.. code-block:: bash
491+
.. code-block:: bat
475492
476493
py -m pip freeze
477494

source/guides/making-a-pypi-friendly-readme.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ such as ``text/plain``, ``text/x-rst`` (for reStructuredText), or ``text/markdow
5353
5454
.. tab:: Windows
5555

56-
.. code-block:: bash
56+
.. code-block:: bat
5757
5858
py -m pip install --user --upgrade setuptools wheel twine
5959
@@ -115,7 +115,7 @@ You can check your README for markup errors before uploading as follows:
115115
116116
.. tab:: Windows
117117

118-
.. code-block:: bash
118+
.. code-block:: bat
119119
120120
py -m pip install --upgrade twine
121121

source/guides/using-testpypi.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ specifying the ``--index-url`` flag
4949
5050
.. tab:: Windows
5151

52-
.. code-block:: bash
52+
.. code-block:: bat
5353
5454
py -m pip install --index-url https://test.pypi.org/simple/ your-package
5555
@@ -65,7 +65,7 @@ you're testing has dependencies:
6565
6666
.. tab:: Windows
6767

68-
.. code-block:: bash
68+
.. code-block:: bat
6969
7070
py -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package
7171

source/tutorials/creating-documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Use ``pip`` to install Sphinx:
2121
2222
.. tab:: Windows
2323

24-
.. code-block:: bash
24+
.. code-block:: bat
2525
2626
py -m pip install -U sphinx
2727

0 commit comments

Comments
 (0)