Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Make install editable option an option #2299

Closed
wants to merge 13 commits into from
Next Next commit
Make install editable option an option
  • Loading branch information
mlouielu committed Jun 3, 2018
commit 15d5fa15393aabc1459a2674273b85f850267968
10 changes: 10 additions & 0 deletions pipenv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ def cli(
default=False,
help="Install package(s) in [dev-packages].",
)
@option(
'--editable',
'-e',
nargs=1,
default=False,
help="Install a project in editable mode (i.e. setuptools "
"\"develop mode\") from a local project path.",
)
@option(
'--three/--two',
is_flag=True,
Expand Down Expand Up @@ -366,6 +374,7 @@ def install(
package_name=False,
more_packages=False,
dev=False,
editable=False,
three=False,
python=False,
system=False,
Expand All @@ -387,6 +396,7 @@ def install(
package_name=package_name,
more_packages=more_packages,
dev=dev,
editable=editable,
three=three,
python=python,
system=system,
Expand Down
9 changes: 5 additions & 4 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,7 @@ def do_install(
package_name=False,
more_packages=False,
dev=False,
editable=False,
three=False,
python=False,
system=False,
Expand Down Expand Up @@ -1888,11 +1889,11 @@ def do_install(
for req in import_from_code(code):
click.echo(' Found {0}!'.format(crayons.green(req)))
project.add_package_to_pipfile(req)
# Capture -e argument and assign it to following package_name.
more_packages = list(more_packages)
if package_name == '-e':
package_name = ' '.join([package_name, more_packages.pop(0)])
# Assign editable (-e) to following package_name.
if editable:
package_name = editable
# capture indexes and extra indexes
more_packages = list(more_packages)
line = [package_name] + more_packages
index_indicators = ['-i', '--index', '--extra-index-url']
index, extra_indexes = None, None
Expand Down