Separate out virtualenv docs to its own sections (#2551)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Rowlando13 · committed by GitHub · parents 8fa833e, cb145c3 · Browse files · 3 files·+59 added−57 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+59 added−57 removed
- other:+59 added−57 removed
Provenance
- Commit
1a696c0- Tree
66ec6c2- Author
Rowlando13 <67291205+Rowlando13@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent 1
8fa833e- Parent 2
cb145c3
3 files changed+59 added−57 removed
modified:docs/index.rst+1 added
66 unmodified lines67 :maxdepth: 268 69 why70 quickstart71+ virtualenv72 setuptools73 parameters74 options75 arguments33 unmodified linesmodified:docs/quickstart.rst+4 added-57 removed
1 unmodified line2 ==========3 4 .. currentmodule:: click5 6-You can get the library directly from PyPI::6+Install7+----------------------8+Install from PyPI::9 10 pip install click11 10-The installation into a :ref:`virtualenv` is heavily recommended.12+Installing into a virtual environment is highly recommended. We suggest :ref:`virtualenv-heading`.13 12-.. _virtualenv:13-14-virtualenv15-----------16-17-Virtualenv is probably what you want to use for developing Click18-applications.19-20-What problem does virtualenv solve? Chances are that you want to use it21-for other projects besides your Click script. But the more projects you22-have, the more likely it is that you will be working with different23-versions of Python itself, or at least different versions of Python24-libraries. Let's face it: quite often libraries break backwards25-compatibility, and it's unlikely that any serious application will have26-zero dependencies. So what do you do if two or more of your projects have27-conflicting dependencies?28-29-Virtualenv to the rescue! Virtualenv enables multiple side-by-side30-installations of Python, one for each project. It doesn't actually31-install separate copies of Python, but it does provide a clever way to32-keep different project environments isolated.33-34-Create your project folder, then a virtualenv within it::35-36- $ mkdir myproject37- $ cd myproject38- $ python3 -m venv .venv39-40-Now, whenever you want to work on a project, you only have to activate the41-corresponding environment. On OS X and Linux, do the following::42-43- $ . .venv/bin/activate44- (venv) $45-46-If you are a Windows user, the following command is for you::47-48- > .venv\scripts\activate49- (venv) >50-51-Either way, you should now be using your virtualenv (notice how the prompt of52-your shell has changed to show the active environment).53-54-And if you want to stop using the virtualenv, use the following command::55-56- $ deactivate57-58-After doing this, the prompt of your shell should be as familiar as before.59-60-Now, let's move on. Enter the following command to get Click activated in your61-virtualenv::62-63- $ pip install click64-65-A few seconds later and you are good to go.66-14 Screencast and Examples15 -----------------------16 17 There is a screencast available which shows the basic API of Click and210 unmodified linesadded:docs/virtualenv.rst+54 added
1+.. _virtualenv-heading:2+3+Virtualenv4+=========================5+6+Why Use Virtualenv?7+-------------------------8+9+You should use `Virtualenv <https://virtualenv.pypa.io/en/latest/>`_ because:10+11+* It allows you to install multiple versions of the same dependency.12+13+* If you have an operating system version of Python, it prevents you from changing its dependencies and potentially messing up your os.14+15+How to Use Virtualenv16+-----------------------------17+18+Create your project folder, then a virtualenv within it::19+20+ $ mkdir myproject21+ $ cd myproject22+ $ python3 -m venv .venv23+24+Now, whenever you want to work on a project, you only have to activate the25+corresponding environment.26+27+.. tabs::28+29+ .. group-tab:: OSX/Linux30+31+ .. code-block:: text32+33+ $ . .venv/bin/activate34+ (venv) $35+36+ .. group-tab:: Windows37+38+ .. code-block:: text39+40+ > .venv\scripts\activate41+ (venv) >42+43+44+You are now using your virtualenv (notice how the prompt of your shell has changed to show the active environment).45+46+To install packages in the virtual environment::47+48+ $ pip install click49+50+And if you want to stop using the virtualenv, use the following command::51+52+ $ deactivate53+54+After doing this, the prompt of your shell should be as familiar as before.