0c6b5f54b95fcbc328f032c24f6cba8162bfcb5b

Author
Michael Aquilina <michaelaquilina@gmail.com>
Committer
Michael Aquilina <michaelaquilina@gmail.com>
Date

Message

Update README for new poetry and pipenv integrations

Diff

 1diff --git a/README.rst b/README.rst
 2index c04887800917d37247bf9dbac7797dd4be275fbe..2744beae5e36786299fa25168b1db09b09172078 100644
 3--- a/README.rst
 4+++ b/README.rst
 5@@ -27,13 +27,18 @@ Simply call the ``mkvenv`` command in the directory you wish to setup a
 6 virtual environment. A virtual environment specific to that folder will
 7 now activate every time you enter it.
 8 
 9-``zsh-autoswitch-virtualenv`` will try detect python projects and remind
10-you to create a virtual environment if e.g. setup.py or requirements.txt is
11-found in the current directory.
12+``zsh-autoswitch-virtualenv`` will detect python projects and remind
13+you to create a virtual environment. This mainly occurs if one of the following
14+is found in current the directory:
15 
16-**NOTE: Pipenv and Poetry projects should not use 'mkvenv'.**
17+* setup.py
18+* requirements.txt
19+* Pipfile
20+* poetry.lock
21 
22-**Use 'pipenv install' or 'poetry install' respectively instead**
23+To create a virtual environment for that project, simply run ``mkvenv``.
24+This command works as expected for all popular python project types
25+(virtualenvs, pipenv and poetry).
26 
27 See the Commands_ section below for more detail.
28 
29@@ -123,7 +128,7 @@ Commands
30 mkvenv
31 ''''''
32 
33-Setup a new project with virtualenv autoswitching using the ``mkvenv``
34+Setup a new python project with autoswitching using the ``mkvenv``
35 helper command.
36 
37 ::
38@@ -137,6 +142,8 @@ helper command.
39     Installing collected packages: requests
40     Successfully installed requests-2.11.1
41 
42+This command also works as expected with both ``poetry`` and ``pipenv``.
43+
44 Optionally, you can specify the python binary to use for this virtual environment
45 
46 ::
47@@ -144,40 +151,8 @@ Optionally, you can specify the python binary to use for this virtual environmen
48     $ mkvenv --python=/usr/bin/python3
49 
50 
51-It is also possible to inherit the system site packages (which can reduce duplication on the file system
52-and download/setup time).
53-
54-::
55-
56-    $ mkvenv --system-site-packages
57-
58-In fact, ``mkvenv`` supports any parameters that can be passed to ``python -m virtualenv``.
59-A comprehensive list of options may be found in the
60-`virtualenv guide <https://virtualenv.pypa.io/en/latest/reference/#options>`__
61-
62-``mkvenv`` will create a virtual environment with the same name as the
63-current directory, suggest installing ``requirements.txt`` if available
64-and create the relevant ``.venv`` file for you.
65-
66-Next time you switch to that folder, you'll see the following message
67-
68-::
69-
70-    $ cd my-python-project
71-    Switching virtualenv: my-python-project  [Python 3.4.3+]
72-    $
73-
74-If you have set the ``AUTOSWITCH_DEFAULTENV`` environment variable,
75-exiting that directory will switch back to the value set.
76-
77-::
78-
79-    $ cd ..
80-    Switching virtualenv: mydefaultenv  [Python 3.4.3+]
81-    $
82-
83-Otherwise, ``deactivate`` will simply be called on the virtualenv to
84-switch back to the global python environment.
85+In fact any parameters passed to mkvenv will be passed to the relevant setup command.
86+The same applies to passing additional parameters to ``pipenv install`` and ``poetry install``.
87 
88 Autoswitching is smart enough to detect that you have traversed to a
89 project subdirectory. So your virtualenv will not be deactivated if you
90@@ -216,6 +191,9 @@ This will delete the virtual environment in ``.venv`` and remove the
91     $ rmvenv
92     No .venv file in the current directory!
93 
94+Similar to ``mkvenv``, the ``rmvenv`` command also works as you would
95+expect with removing ``poetry`` and ``pipenv`` projects.
96+
97 disable_autoswitch_virtualenv
98 '''''''''''''''''''''''''''''
99