9
9
)
10
10
11
11
from ..__version__ import __version__
12
+ from ..exceptions import PipenvOptionsError
12
13
from ..patched import crayons
13
14
from ..vendor import click_completion , delegator
14
15
from .options import (
@@ -298,6 +299,7 @@ def uninstall(
298
299
if retcode :
299
300
sys .exit (retcode )
300
301
302
+
301
303
LOCK_HEADER = """\
302
304
#
303
305
# These requirements were autogenerated by pipenv
@@ -307,11 +309,13 @@ def uninstall(
307
309
#
308
310
"""
309
311
310
- LOCK_DEV_NOTE = """\
312
+
313
+ LOCK_DEV_NOTE = """\
311
314
# Note: in pipenv 2020.x, "--dev" changed to emit both default and development
312
315
# requirements. To emit only development requirements, pass "--dev-only".
313
316
"""
314
317
318
+
315
319
@cli .command (short_help = "Generates Pipfile.lock." , context_settings = CONTEXT_SETTINGS )
316
320
@lock_options
317
321
@pass_state
@@ -342,10 +346,10 @@ def lock(
342
346
header_options .append ("--dev-only" )
343
347
elif dev :
344
348
header_options .append ("--dev" )
345
- click . echo (LOCK_HEADER .format (options = " " .join (header_options )))
349
+ echo (LOCK_HEADER .format (options = " " .join (header_options )))
346
350
# TODO: Emit pip-compile style header
347
351
if dev and not dev_only :
348
- click . echo (LOCK_DEV_NOTE )
352
+ echo (LOCK_DEV_NOTE )
349
353
# Setting "emit_requirements=True" means do_init() just emits the
350
354
# install requirements file to stdout, it doesn't install anything
351
355
do_init (
@@ -356,7 +360,7 @@ def lock(
356
360
pre = state .installstate .pre ,
357
361
)
358
362
elif state .lockoptions .dev_only :
359
- raise exceptions . PipenvOptionsError (
363
+ raise PipenvOptionsError (
360
364
"--dev-only" ,
361
365
"--dev-only is only permitted in combination with --requirements. "
362
366
"Aborting."
0 commit comments