refinements

This commit is contained in:
2017-01-21 18:30:10 -05:00
parent 014c2ac804
commit 087c21073d
2 changed files with 18 additions and 9 deletions
+2 -1
View File
@@ -21,7 +21,8 @@ The main commands are ```install``, ``uninstall``, and ``lock``, which generates
Basic Concepts
//////////////
- When no parameters are passed to ``install``, a virtualenv will be created if it doesn't exist, and all packages specified will be installed.
- A virtualenv will automatically be created, when one doesn't exist.
- When no parameters are passed to ``install``, all packages specified will be installed.
- When no parameters are passed to ``uninstall``, all packages will be uninstalled.
Other Commands
+16 -8
View File
@@ -81,6 +81,18 @@ def do_install_dependencies(dev=False, only=False, bare=False):
click.echo(crayons.blue(c.out))
def do_create_virtualenv():
"""Creates a virtualenv."""
click.echo(crayons.yellow('Creating a virtualenv for this project...'))
# Actually create the virtualenv.
c = delegator.run(['virtualenv', project.virtualenv_location, '--prompt=({})'.format(project.name)], block=False)
click.echo(crayons.blue(c.out))
# Say where the virtualenv is.
do_where(virtualenv=True, bare=False)
def do_lock():
"""Executes the freeze functionality."""
@@ -181,14 +193,7 @@ def do_init(dev=False, skip_virtualenv=False):
do_where(bare=False)
if not project.virtualenv_exists:
click.echo(crayons.yellow('Creating a virtualenv for this project...'))
# Actually create the virtualenv.
c = delegator.run(['virtualenv', project.virtualenv_location, '--prompt=({})'.format(project.name)], block=False)
click.echo(crayons.blue(c.out))
# Say where the virtualenv is.
do_where(virtualenv=True, bare=False)
do_create_virtualenv()
# Write out the lockfile if it doesn't exist.
if project.lockfile_exists:
@@ -256,6 +261,9 @@ def where(venv=False, bare=False):
@click.option('--dev','-d', is_flag=True, default=False)
def install(package_name=False, dev=False):
if not project.virtualenv_exists:
do_create_virtualenv()
# Install all dependencies, if none was provided.
if package_name is False:
click.echo(crayons.yellow('No package provided, installing all dependencies.'))