diff options
author | kotfu <kotfu@kotfu.net> | 2019-07-03 11:23:58 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2019-07-03 11:23:58 -0600 |
commit | 51ea4ba9fbcdfc785a5e9d6bafcac69334e535a8 (patch) | |
tree | b9b6aa7273040f5dd9132e94706c91ac3de601fe /docs/overview/installation.rst | |
parent | 11da5ba65a43c63364e702de726a7bf09a1241b4 (diff) | |
download | cmd2-git-51ea4ba9fbcdfc785a5e9d6bafcac69334e535a8.tar.gz |
Revise menu structure
- collapse menu structure in sidebar so not everything is always shown
- updates to Getting Started section
Diffstat (limited to 'docs/overview/installation.rst')
-rw-r--r-- | docs/overview/installation.rst | 160 |
1 files changed, 83 insertions, 77 deletions
diff --git a/docs/overview/installation.rst b/docs/overview/installation.rst index 62765704..fc44e740 100644 --- a/docs/overview/installation.rst +++ b/docs/overview/installation.rst @@ -2,110 +2,99 @@ Installation Instructions ========================= -This section covers the basics of how to install, upgrade, and uninstall ``cmd2``. - -Installing ----------- -First you need to make sure you have Python 3.5+, pip_, and setuptools_. Then you can just use pip to -install from PyPI_. .. _pip: https://pypi.python.org/pypi/pip .. _setuptools: https://pypi.python.org/pypi/setuptools .. _PyPI: https://pypi.python.org/pypi +``cmd2`` works on Linux, macOS, and Windows. It requires Python 3.5 or +higher, pip_, and setuptools_. If you've got all that, then you can just: + +.. code-block:: shell + + $ pip install cmd2 + .. note:: - Depending on how and where you have installed Python on your system and on what OS you are using, you may need to - have administrator or root privileges to install Python packages. If this is the case, take the necessary steps - required to run the commands in this section as root/admin, e.g.: on most Linux or Mac systems, you can precede them - with ``sudo``:: + Depending on how and where you have installed Python on your system and on + what OS you are using, you may need to have administrator or root privileges + to install Python packages. If this is the case, take the necessary steps + required to run the commands in this section as root/admin, e.g.: on most + Linux or Mac systems, you can precede them with ``sudo``: - sudo pip install <package_name> + .. code-block:: shell + $ sudo pip install <package_name> -Requirements for Installing -~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* If you have Python 3 >=3.5 installed from `python.org - <https://www.python.org>`_, you will already have pip_ and - setuptools_, but may need to upgrade to the latest versions: + +Prerequisites +------------- + +If you have Python 3 >=3.5 installed from `python.org +<https://www.python.org>`_, you will already have pip_ and setuptools_, but may +need to upgrade to the latest versions: On Linux or OS X: - :: + .. code-block:: shell - pip install -U pip setuptools + $ pip install -U pip setuptools On Windows: - :: + .. code-block:: shell - python -m pip install -U pip setuptools + > python -m pip install -U pip setuptools .. _`pip_install`: -Use pip for Installing -~~~~~~~~~~~~~~~~~~~~~~ +Install from PyPI +----------------- + +pip_ is the recommended installer. Installing packages from PyPI_ with pip is +easy: -pip_ is the recommended installer. Installing packages from PyPI_ with pip is easy:: +.. code-block:: shell - pip install cmd2 + $ pip install cmd2 -This should also install the required 3rd-party dependencies, if necessary. +This will install the required 3rd-party dependencies, if necessary. .. _github: -Install from GitHub using pip -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Install from GitHub +------------------- -The latest version of ``cmd2`` can be installed directly from the master branch on GitHub using pip_:: +The latest version of ``cmd2`` can be installed directly from the master branch +on GitHub using pip_: - pip install -U git+git://github.com/python-cmd2/cmd2.git +.. code-block:: shell -This should also install the required 3rd-party dependencies, if necessary. + $ pip install -U git+git://github.com/python-cmd2/cmd2.git Install from Debian or Ubuntu repos -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We recommend installing from pip_, but if you wish to install from Debian or Ubuntu repos this can be done with -apt-get. +----------------------------------- + +We recommend installing from pip_, but if you wish to install from Debian or +Ubuntu repos this can be done with apt-get. For Python 3:: - sudo apt-get install python3-cmd2 + $ sudo apt-get install python3-cmd2 This will also install the required 3rd-party dependencies. .. warning:: - Versions of ``cmd2`` before 0.7.0 should be considered to be of unstable "beta" quality and should not be relied upon - for production use. If you cannot get a version >= 0.7 from your OS repository, then we recommend - installing from either pip or GitHub - see :ref:`pip_install` or :ref:`github`. - - -Deploy cmd2.py with your project -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``cmd2`` is contained in a small number of Python files, which can be easily copied into your project. *The -copyright and license notice must be retained*. - -This is an option suitable for advanced Python users. You can simply include the files within your project's hierarchy. -If you want to modify ``cmd2``, this may be a reasonable option. Though, we encourage you to use stock ``cmd2`` and -either composition or inheritance to achieve the same goal. - -This approach will obviously NOT automatically install the required 3rd-party dependencies, so you need to make sure -the following Python packages are installed: - - * attrs - * colorama - * pyperclip - * wcwidth - -On Windows, there is an additional dependency: - - * pyreadline + Versions of ``cmd2`` before 0.7.0 should be considered to be of unstable + "beta" quality and should not be relied upon for production use. If you + cannot get a version >= 0.7 from your OS repository, then we recommend + installing from either pip or GitHub - see :ref:`pip_install` or + :ref:`github`. Upgrading cmd2 @@ -122,34 +111,51 @@ Uninstalling cmd2 ----------------- If you wish to permanently uninstall ``cmd2``, this can also easily be done with pip_:: - pip uninstall cmd2 + $ pip uninstall cmd2 + +macOS Considerations +-------------------- -Extra requirement for macOS -=========================== -macOS comes with the `libedit <http://thrysoee.dk/editline/>`_ library which is similar, but not identical, to GNU Readline. -Tab-completion for ``cmd2`` applications is only tested against GNU Readline. +macOS comes with the `libedit <http://thrysoee.dk/editline/>`_ library which is +similar, but not identical, to GNU Readline. Tab-completion for ``cmd2`` +applications is only tested against GNU Readline. + +There are several ways GNU Readline can be installed within a Python environment +on a Mac, detailed in the following subsections. -There are several ways GNU Readline can be installed within a Python environment on a Mac, detailed in the following subsections. gnureadline Python module -------------------------- -Install the `gnureadline <https://pypi.python.org/pypi/gnureadline>`_ Python module which is statically linked against a specific compatible version of GNU Readline:: +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Install the `gnureadline <https://pypi.python.org/pypi/gnureadline>`_ Python module which is statically linked against a specific compatible version of GNU Readline: + +.. code-block:: shell + + $ pip install -U gnureadline - pip install -U gnureadline readline via conda ------------------- -Install the **readline** package using the ``conda`` package manager included with the Anaconda Python distribution:: +~~~~~~~~~~~~~~~~~~ + +Install the **readline** package using the ``conda`` package manager included +with the Anaconda Python distribution: + +.. code-block:: shell + + $ conda install readline - conda install readline readline via brew ------------------ -Install the **readline** package using the Homebrew package manager (compiles from source):: +~~~~~~~~~~~~~~~~~ + +Install the **readline** package using the Homebrew package manager (compiles +from source): + +.. code-block:: shell - brew install openssl - brew install pyenv - brew install readline + $ brew install openssl + $ brew install pyenv + $ brew install readline Then use pyenv to compile Python and link against the installed readline |