@@ -22,10 +22,11 @@ Create a new environment, in the WORKON_HOME.
2222
2323Syntax::
2424
25- mkvirtualenv [options] ENVNAME
25+ mkvirtualenv [-r requirements_file] [virtualenv options] ENVNAME
2626
27- All command line options are passed directly to ``virtualenv ``. The
28- new environment is automatically activated after being initialized.
27+ All command line options except ``-r `` and ``-h `` are passed directly
28+ to ``virtualenv ``. The new environment is automatically activated
29+ after being initialized.
2930
3031::
3132
@@ -40,10 +41,17 @@ new environment is automatically activated after being initialized.
4041 mynewenv
4142 (mynewenv)$
4243
44+ The ``-r `` option can be used to specify a text file listing packages
45+ to be installed. The argument value is passed to ``pip -r `` to be
46+ installed.
47+
4348.. seealso ::
4449
4550 * :ref: `scripts-premkvirtualenv `
4651 * :ref: `scripts-postmkvirtualenv `
52+ * `requirements file format `_
53+
54+ .. _requirements file format : http://www.pip-installer.org/en/latest/requirement-format.html
4755
4856.. _command-lsvirtualenv :
4957
@@ -394,3 +402,99 @@ output.
394402 Enabled global site-packages
395403 (env1)$ toggleglobalsitepackages -q
396404 (env1)$
405+
406+ ============================
407+ Project Directory Management
408+ ============================
409+
410+ .. seealso ::
411+
412+ :ref: `project-management `
413+
414+ .. _command-mkproject :
415+
416+ mkproject
417+ ---------
418+
419+ Create a new virtualenv in the WORKON_HOME and project directory in
420+ PROJECT_HOME.
421+
422+ Syntax::
423+
424+ mkproject [-t template] [virtualenv_options] ENVNAME
425+
426+ The template option may be repeated to have several templates used to
427+ create a new project. The templates are applied in the order named on
428+ the command line. All other options are passed to ``mkvirtualenv `` to
429+ create a virtual environment with the same name as the project.
430+
431+ ::
432+
433+ $ mkproject myproj
434+ New python executable in myproj/bin/python
435+ Installing distribute.............................................
436+ ..................................................................
437+ ..................................................................
438+ done.
439+ Creating /Users/dhellmann/Devel/myproj
440+ (myproj)$ pwd
441+ /Users/dhellmann/Devel/myproj
442+ (myproj)$ echo $VIRTUAL_ENV
443+ /Users/dhellmann/Envs/myproj
444+ (myproj)$
445+
446+ .. seealso ::
447+
448+ * :ref: `scripts-premkproject `
449+ * :ref: `scripts-postmkproject `
450+
451+ setvirtualenvproject
452+ --------------------
453+
454+ Bind an existing virtualenv to an existing project.
455+
456+ Syntax::
457+
458+ setvirtualenvproject [virtualenv_path project_path]
459+
460+ The arguments to ``setvirtualenvproject `` are the full paths to the
461+ virtualenv and project directory. An association is made so that when
462+ ``workon `` activates the virtualenv the project is also activated.
463+
464+ ::
465+
466+ $ mkproject myproj
467+ New python executable in myproj/bin/python
468+ Installing distribute.............................................
469+ ..................................................................
470+ ..................................................................
471+ done.
472+ Creating /Users/dhellmann/Devel/myproj
473+ (myproj)$ mkvirtualenv myproj_new_libs
474+ New python executable in myproj/bin/python
475+ Installing distribute.............................................
476+ ..................................................................
477+ ..................................................................
478+ done.
479+ Creating /Users/dhellmann/Devel/myproj
480+ (myproj_new_libs)$ setvirtualenvproject $VIRTUAL_ENV $(pwd)
481+
482+ When no arguments are given, the current virtualenv and current
483+ directory are assumed.
484+
485+ Any number of virtualenvs can refer to the same project directory,
486+ making it easy to switch between versions of Python or other
487+ dependencies for testing.
488+
489+ .. _command-cdproject :
490+
491+ cdproject
492+ ---------
493+
494+ Change the current working directory to the one specified as the
495+ project directory for the active virtualenv.
496+
497+ Syntax::
498+
499+ cdproject
500+
0 commit comments