Add tabs to ref docs

This commit is contained in:
Srinivas Nyayapati 2020-08-06 16:06:10 -04:00
parent 423ccfd4f1
commit 4a6276bfc9
9 changed files with 500 additions and 138 deletions

View File

@ -9,7 +9,15 @@ pip cache
Usage Usage
***** *****
.. pip-command-usage:: cache .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: cache "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: cache "py -m pip"
Description Description
*********** ***********

View File

@ -10,7 +10,15 @@ pip check
Usage Usage
===== =====
.. pip-command-usage:: check .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: check "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: check "py -m pip"
Description Description
@ -24,27 +32,66 @@ Examples
#. If all dependencies are compatible: #. If all dependencies are compatible:
:: .. tabs::
$ pip check .. group-tab:: Unix/macOS
No broken requirements found.
$ echo $? .. code-block:: shell
0
$ python -m pip check
No broken requirements found.
$ echo $?
0
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip check
No broken requirements found.
C:\> echo %errorlevel%
0
#. If a package is missing: #. If a package is missing:
:: .. tabs::
$ pip check .. group-tab:: Unix/macOS
pyramid 1.5.2 requires WebOb, which is not installed.
$ echo $? .. code-block:: shell
1
$ python -m pip check
pyramid 1.5.2 requires WebOb, which is not installed.
$ echo $?
1
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip check
pyramid 1.5.2 requires WebOb, which is not installed.
C:\> echo %errorlevel%
1
#. If a package has the wrong version: #. If a package has the wrong version:
:: .. tabs::
$ pip check .. group-tab:: Unix/macOS
pyramid 1.5.2 has requirement WebOb>=1.3.1, but you have WebOb 0.8.
$ echo $? .. code-block:: shell
1
$ python -m pip check
pyramid 1.5.2 has requirement WebOb>=1.3.1, but you have WebOb 0.8.
$ echo $?
1
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip check
pyramid 1.5.2 has requirement WebOb>=1.3.1, but you have WebOb 0.8.
C:\> echo %errorlevel%
1

View File

@ -11,7 +11,15 @@ pip config
Usage Usage
===== =====
.. pip-command-usage:: config .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: config "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: config "py -m pip"
Description Description

View File

@ -10,7 +10,15 @@ pip debug
Usage Usage
===== =====
.. pip-command-usage:: debug .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: debug "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: debug "py -m pip"
.. warning:: .. warning::

View File

@ -10,7 +10,15 @@ pip hash
Usage Usage
===== =====
.. pip-command-usage:: hash .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: hash "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: hash "py -m pip"
Description Description
@ -39,13 +47,32 @@ Options
Example Example
======= =======
Compute the hash of a downloaded archive:: Compute the hash of a downloaded archive:
$ pip download SomePackage .. tabs::
Collecting SomePackage
Downloading SomePackage-2.2.tar.gz .. group-tab:: Unix/macOS
Saved ./pip_downloads/SomePackage-2.2.tar.gz
Successfully downloaded SomePackage .. code-block:: shell
$ pip hash ./pip_downloads/SomePackage-2.2.tar.gz
./pip_downloads/SomePackage-2.2.tar.gz: $ python -m pip download SomePackage
--hash=sha256:93e62e05c7ad3da1a233def6731e8285156701e3419a5fe279017c429ec67ce0 Collecting SomePackage
Downloading SomePackage-2.2.tar.gz
Saved ./pip_downloads/SomePackage-2.2.tar.gz
Successfully downloaded SomePackage
$ python -m pip hash ./pip_downloads/SomePackage-2.2.tar.gz
./pip_downloads/SomePackage-2.2.tar.gz:
--hash=sha256:93e62e05c7ad3da1a233def6731e8285156701e3419a5fe279017c429ec67ce0
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip download SomePackage
Collecting SomePackage
Downloading SomePackage-2.2.tar.gz
Saved ./pip_downloads/SomePackage-2.2.tar.gz
Successfully downloaded SomePackage
C:\> py -m pip hash ./pip_downloads/SomePackage-2.2.tar.gz
./pip_downloads/SomePackage-2.2.tar.gz:
--hash=sha256:93e62e05c7ad3da1a233def6731e8285156701e3419a5fe279017c429ec67ce0

View File

@ -10,7 +10,15 @@ pip list
Usage Usage
===== =====
.. pip-command-usage:: list .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: list "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: list "py -m pip"
Description Description
@ -32,75 +40,182 @@ Examples
#. List installed packages. #. List installed packages.
:: .. tabs::
$ pip list .. group-tab:: Unix/macOS
docutils (0.10)
Jinja2 (2.7.2) .. code-block:: shell
MarkupSafe (0.18)
Pygments (1.6) $ python -m pip list
Sphinx (1.2.1) docutils (0.10)
Jinja2 (2.7.2)
MarkupSafe (0.18)
Pygments (1.6)
Sphinx (1.2.1)
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list
docutils (0.10)
Jinja2 (2.7.2)
MarkupSafe (0.18)
Pygments (1.6)
Sphinx (1.2.1)
#. List outdated packages (excluding editables), and the latest version available. #. List outdated packages (excluding editables), and the latest version available.
:: .. tabs::
.. group-tab:: Unix/macOS
.. code-block:: shell
$ python -m pip list --outdated
docutils (Current: 0.10 Latest: 0.11)
Sphinx (Current: 1.2.1 Latest: 1.2.2)
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list --outdated
docutils (Current: 0.10 Latest: 0.11)
Sphinx (Current: 1.2.1 Latest: 1.2.2)
$ pip list --outdated
docutils (Current: 0.10 Latest: 0.11)
Sphinx (Current: 1.2.1 Latest: 1.2.2)
#. List installed packages with column formatting. #. List installed packages with column formatting.
:: .. tabs::
$ pip list --format columns .. group-tab:: Unix/macOS
Package Version
------- ------- .. code-block:: shell
docopt 0.6.2
idlex 1.13 $ python -m pip list --format columns
jedi 0.9.0 Package Version
------- -------
docopt 0.6.2
idlex 1.13
jedi 0.9.0
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list --format columns
Package Version
------- -------
docopt 0.6.2
idlex 1.13
jedi 0.9.0
#. List outdated packages with column formatting. #. List outdated packages with column formatting.
:: .. tabs::
$ pip list -o --format columns .. group-tab:: Unix/macOS
Package Version Latest Type
---------- ------- ------ ----- .. code-block:: shell
retry 0.8.1 0.9.1 wheel
setuptools 20.6.7 21.0.0 wheel $ python -m pip list -o --format columns
Package Version Latest Type
---------- ------- ------ -----
retry 0.8.1 0.9.1 wheel
setuptools 20.6.7 21.0.0 wheel
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list -o --format columns
Package Version Latest Type
---------- ------- ------ -----
retry 0.8.1 0.9.1 wheel
setuptools 20.6.7 21.0.0 wheel
#. List packages that are not dependencies of other packages. Can be combined with #. List packages that are not dependencies of other packages. Can be combined with
other options. other options.
:: .. tabs::
$ pip list --outdated --not-required .. group-tab:: Unix/macOS
docutils (Current: 0.10 Latest: 0.11)
.. code-block:: shell
$ python -m pip list --outdated --not-required
docutils (Current: 0.10 Latest: 0.11)
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list --outdated --not-required
docutils (Current: 0.10 Latest: 0.11)
#. Use legacy formatting #. Use legacy formatting
:: .. tabs::
$ pip list --format=legacy .. group-tab:: Unix/macOS
colorama (0.3.7)
docopt (0.6.2) .. code-block:: shell
idlex (1.13)
jedi (0.9.0) $ python -m pip list --format=legacy
colorama (0.3.7)
docopt (0.6.2)
idlex (1.13)
jedi (0.9.0)
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list --format=legacy
colorama (0.3.7)
docopt (0.6.2)
idlex (1.13)
jedi (0.9.0)
#. Use json formatting #. Use json formatting
:: .. tabs::
$ pip list --format=json .. group-tab:: Unix/macOS
[{'name': 'colorama', 'version': '0.3.7'}, {'name': 'docopt', 'version': '0.6.2'}, ...
.. code-block:: shell
$ python -m pip list --format=json
[{'name': 'colorama', 'version': '0.3.7'}, {'name': 'docopt', 'version': '0.6.2'}, ...
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list --format=json
[{'name': 'colorama', 'version': '0.3.7'}, {'name': 'docopt', 'version': '0.6.2'}, ...
#. Use freeze formatting #. Use freeze formatting
:: .. tabs::
$ pip list --format=freeze .. group-tab:: Unix/macOS
colorama==0.3.7
docopt==0.6.2 .. code-block:: shell
idlex==1.13
jedi==0.9.0 $ python -m pip list --format=freeze
colorama==0.3.7
docopt==0.6.2
idlex==1.13
jedi==0.9.0
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip list --format=freeze
colorama==0.3.7
docopt==0.6.2
idlex==1.13
jedi==0.9.0

View File

@ -10,7 +10,15 @@ pip search
Usage Usage
===== =====
.. pip-command-usage:: search .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: search "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: search "py -m pip"
Description Description
@ -30,8 +38,20 @@ Examples
#. Search for "peppercorn" #. Search for "peppercorn"
:: .. tabs::
$ pip search peppercorn .. group-tab:: Unix/macOS
pepperedform - Helpers for using peppercorn with formprocess.
peppercorn - A library for converting a token stream into [...] .. code-block:: shell
$ python -m pip search peppercorn
pepperedform - Helpers for using peppercorn with formprocess.
peppercorn - A library for converting a token stream into [...]
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip search peppercorn
pepperedform - Helpers for using peppercorn with formprocess.
peppercorn - A library for converting a token stream into [...]

View File

@ -10,7 +10,15 @@ pip show
Usage Usage
===== =====
.. pip-command-usage:: show .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: show "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: show "py -m pip"
Description Description
@ -30,58 +38,124 @@ Examples
#. Show information about a package: #. Show information about a package:
:: .. tabs::
$ pip show sphinx .. group-tab:: Unix/macOS
Name: Sphinx
Version: 1.4.5 .. code-block:: shell
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/ $ python -m pip show sphinx
Author: Georg Brandl Name: Sphinx
Author-email: georg@python.org Version: 1.4.5
License: BSD Summary: Python documentation generator
Location: /my/env/lib/python2.7/site-packages Home-page: http://sphinx-doc.org/
Requires: docutils, snowballstemmer, alabaster, Pygments, imagesize, Jinja2, babel, six Author: Georg Brandl
Author-email: georg@python.org
License: BSD
Location: /my/env/lib/python2.7/site-packages
Requires: docutils, snowballstemmer, alabaster, Pygments, imagesize, Jinja2, babel, six
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip show sphinx
Name: Sphinx
Version: 1.4.5
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg@python.org
License: BSD
Location: /my/env/lib/python2.7/site-packages
Requires: docutils, snowballstemmer, alabaster, Pygments, imagesize, Jinja2, babel, six
#. Show all information about a package #. Show all information about a package
:: .. tabs::
$ pip show --verbose sphinx .. group-tab:: Unix/macOS
Name: Sphinx
Version: 1.4.5 .. code-block:: shell
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/ $ python -m pip show --verbose sphinx
Author: Georg Brandl Name: Sphinx
Author-email: georg@python.org Version: 1.4.5
License: BSD Summary: Python documentation generator
Location: /my/env/lib/python2.7/site-packages Home-page: http://sphinx-doc.org/
Requires: docutils, snowballstemmer, alabaster, Pygments, imagesize, Jinja2, babel, six Author: Georg Brandl
Metadata-Version: 2.0 Author-email: georg@python.org
Installer: License: BSD
Classifiers: Location: /my/env/lib/python2.7/site-packages
Development Status :: 5 - Production/Stable Requires: docutils, snowballstemmer, alabaster, Pygments, imagesize, Jinja2, babel, six
Environment :: Console Metadata-Version: 2.0
Environment :: Web Environment Installer:
Intended Audience :: Developers Classifiers:
Intended Audience :: Education Development Status :: 5 - Production/Stable
License :: OSI Approved :: BSD License Environment :: Console
Operating System :: OS Independent Environment :: Web Environment
Programming Language :: Python Intended Audience :: Developers
Programming Language :: Python :: 2 Intended Audience :: Education
Programming Language :: Python :: 3 License :: OSI Approved :: BSD License
Framework :: Sphinx Operating System :: OS Independent
Framework :: Sphinx :: Extension Programming Language :: Python
Framework :: Sphinx :: Theme Programming Language :: Python :: 2
Topic :: Documentation Programming Language :: Python :: 3
Topic :: Documentation :: Sphinx Framework :: Sphinx
Topic :: Text Processing Framework :: Sphinx :: Extension
Topic :: Utilities Framework :: Sphinx :: Theme
Entry-points: Topic :: Documentation
[console_scripts] Topic :: Documentation :: Sphinx
sphinx-apidoc = sphinx.apidoc:main Topic :: Text Processing
sphinx-autogen = sphinx.ext.autosummary.generate:main Topic :: Utilities
sphinx-build = sphinx:main Entry-points:
sphinx-quickstart = sphinx.quickstart:main [console_scripts]
[distutils.commands] sphinx-apidoc = sphinx.apidoc:main
build_sphinx = sphinx.setup_command:BuildDoc sphinx-autogen = sphinx.ext.autosummary.generate:main
sphinx-build = sphinx:main
sphinx-quickstart = sphinx.quickstart:main
[distutils.commands]
build_sphinx = sphinx.setup_command:BuildDoc
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip show --verbose sphinx
Name: Sphinx
Version: 1.4.5
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg@python.org
License: BSD
Location: /my/env/lib/python2.7/site-packages
Requires: docutils, snowballstemmer, alabaster, Pygments, imagesize, Jinja2, babel, six
Metadata-Version: 2.0
Installer:
Classifiers:
Development Status :: 5 - Production/Stable
Environment :: Console
Environment :: Web Environment
Intended Audience :: Developers
Intended Audience :: Education
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Framework :: Sphinx
Framework :: Sphinx :: Extension
Framework :: Sphinx :: Theme
Topic :: Documentation
Topic :: Documentation :: Sphinx
Topic :: Text Processing
Topic :: Utilities
Entry-points:
[console_scripts]
sphinx-apidoc = sphinx.apidoc:main
sphinx-autogen = sphinx.ext.autosummary.generate:main
sphinx-build = sphinx:main
sphinx-quickstart = sphinx.quickstart:main
[distutils.commands]
build_sphinx = sphinx.setup_command:BuildDoc

View File

@ -11,7 +11,15 @@ pip wheel
Usage Usage
===== =====
.. pip-command-usage:: wheel .. tabs::
.. group-tab:: Unix/macOS
.. pip-command-usage:: wheel "python -m pip"
.. group-tab:: Windows
.. pip-command-usage:: wheel "py -m pip"
Description Description
@ -24,9 +32,22 @@ Build System Interface
---------------------- ----------------------
In order for pip to build a wheel, ``setup.py`` must implement the In order for pip to build a wheel, ``setup.py`` must implement the
``bdist_wheel`` command with the following syntax:: ``bdist_wheel`` command with the following syntax:
.. tabs::
.. group-tab:: Unix/macOS
.. code-block:: shell
$ python setup.py bdist_wheel -d TARGET
.. group-tab:: Windows
.. code-block:: shell
C:\> py setup.py bdist_wheel -d TARGET
python setup.py bdist_wheel -d TARGET
This command must create a wheel compatible with the invoking Python This command must create a wheel compatible with the invoking Python
interpreter, and save that wheel in the directory TARGET. interpreter, and save that wheel in the directory TARGET.
@ -39,9 +60,22 @@ Customising the build
It is possible using ``--global-option`` to include additional build commands It is possible using ``--global-option`` to include additional build commands
with their arguments in the ``setup.py`` command. This is currently the only with their arguments in the ``setup.py`` command. This is currently the only
way to influence the building of C extensions from the command line. For way to influence the building of C extensions from the command line. For
example:: example:
.. tabs::
.. group-tab:: Unix/macOS
.. code-block:: shell
$ python -m pip wheel --global-option bdist_ext --global-option -DFOO wheel
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip wheel --global-option bdist_ext --global-option -DFOO wheel
pip wheel --global-option bdist_ext --global-option -DFOO wheel
will result in a build command of will result in a build command of
@ -69,13 +103,34 @@ Examples
#. Build wheels for a requirement (and all its dependencies), and then install #. Build wheels for a requirement (and all its dependencies), and then install
:: .. tabs::
$ pip wheel --wheel-dir=/tmp/wheelhouse SomePackage .. group-tab:: Unix/macOS
$ pip install --no-index --find-links=/tmp/wheelhouse SomePackage
.. code-block:: shell
$ python -m pip wheel --wheel-dir=/tmp/wheelhouse SomePackage
$ python -m pip install --no-index --find-links=/tmp/wheelhouse SomePackage
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip wheel --wheel-dir=/tmp/wheelhouse SomePackage
C:\> py -m pip install --no-index --find-links=/tmp/wheelhouse SomePackage
#. Build a wheel for a package from source #. Build a wheel for a package from source
:: .. tabs::
$ pip wheel --no-binary SomePackage SomePackage .. group-tab:: Unix/macOS
.. code-block:: shell
$ python -m pip wheel --no-binary SomePackage SomePackage
.. group-tab:: Windows
.. code-block:: shell
C:\> py -m pip wheel --no-binary SomePackage SomePackage