mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
verbose mode for locking
fixes #483 Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
5.3.6:
|
||||
- Addition of `pipenv lock --verbose`.
|
||||
5.3.5:
|
||||
- Addition of update --dry-run.
|
||||
- Removal of install --lock option.
|
||||
|
||||
+5
-4
@@ -459,7 +459,7 @@ def get_downloads_info(names_map, section):
|
||||
return info
|
||||
|
||||
|
||||
def do_lock(no_hashes=True):
|
||||
def do_lock(no_hashes=True, verbose=False):
|
||||
"""Executes the freeze functionality."""
|
||||
|
||||
if no_hashes:
|
||||
@@ -477,7 +477,7 @@ def do_lock(no_hashes=True):
|
||||
|
||||
# Resolve dev-package dependencies.
|
||||
deps = convert_deps_to_pip(project.dev_packages, r=False)
|
||||
results = resolve_deps(deps, sources=project.sources)
|
||||
results = resolve_deps(deps, sources=project.sources, verbose=verbose)
|
||||
|
||||
# Add develop dependencies to lockfile.
|
||||
for dep in results:
|
||||
@@ -1016,8 +1016,9 @@ def uninstall(package_name=False, more_packages=False, three=None, python=False,
|
||||
@click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.")
|
||||
@click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.")
|
||||
@click.option('--hashes', is_flag=True, default=False, help="Generate hashes.")
|
||||
@click.option('--verbose', is_flag=True, default=False, help="Verbose mode.")
|
||||
@click.option('--requirements', '-r', is_flag=True, default=False, help="Generate output compatible with requirements.txt.")
|
||||
def lock(three=None, python=False, hashes=False, requirements=False):
|
||||
def lock(three=None, python=False, hashes=False, verbose=False, requirements=False):
|
||||
# Hack to invert hashing mode.
|
||||
no_hashes = not hashes
|
||||
|
||||
@@ -1027,7 +1028,7 @@ def lock(three=None, python=False, hashes=False, requirements=False):
|
||||
if requirements:
|
||||
do_init(dev=True, requirements=requirements, no_hashes=no_hashes)
|
||||
|
||||
do_lock(no_hashes=no_hashes)
|
||||
do_lock(no_hashes=no_hashes, verbose=verbose)
|
||||
|
||||
|
||||
@click.command(help="Spawns a shell within the virtualenv.", context_settings=dict(
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@ import tempfile
|
||||
from piptools.resolver import Resolver
|
||||
from piptools.repositories.pypi import PyPIRepository
|
||||
from piptools.scripts.compile import get_pip_command
|
||||
from piptools import logging
|
||||
|
||||
import requests
|
||||
import parse
|
||||
@@ -21,7 +22,7 @@ class PipCommand(pip.basecommand.Command):
|
||||
name = 'PipCommand'
|
||||
|
||||
|
||||
def resolve_deps(deps, sources=None):
|
||||
def resolve_deps(deps, sources=None, verbose=False):
|
||||
|
||||
constraints = []
|
||||
|
||||
@@ -43,6 +44,9 @@ def resolve_deps(deps, sources=None):
|
||||
|
||||
pypi = PyPIRepository(pip_options=pip_options, session=requests)
|
||||
|
||||
if verbose:
|
||||
logging.log.verbose = True
|
||||
|
||||
r = Resolver(constraints=constraints, repository=pypi)
|
||||
results = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user