Skip to content

Commit

Permalink
Use pipenv cache dir for caching wheels
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed May 27, 2018
1 parent 84c0b09 commit f532b2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
PIPENV_SHELL,
PIPENV_PYTHON,
PIPENV_VIRTUALENV,
PIPENV_CACHE_DIR,
)

# Backport required for earlier versions of Python.
Expand Down Expand Up @@ -1494,7 +1495,7 @@ def pip_install(
)
if verbose:
click.echo('$ {0}'.format(pip_command), err=True)
c = delegator.run(pip_command, block=block)
c = delegator.run(pip_command, block=block, env={'PIP_CACHE_DIR': PIPENV_CACHE_DIR})
return c


Expand All @@ -1506,7 +1507,7 @@ def pip_download(package_name):
source['url'],
project.download_location,
)
c = delegator.run(cmd)
c = delegator.run(cmd, env={'PIP_CACHE_DIR': PIPENV_CACHE_DIR})
if c.return_code == 0:
break

Expand Down
1 change: 1 addition & 0 deletions pipenv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ class PipCommand(basecommand.Command):
constraints_file = f.name
if verbose:
print('Using pip: {0}'.format(' '.join(pip_args)))
pip_args = pip_args.extend(['--cache-dir', PIPENV_CACHE_DIR])
pip_options, _ = pip_command.parse_args(pip_args)
session = pip_command._build_session(pip_options)
pypi = PyPIRepository(
Expand Down

0 comments on commit f532b2e

Please sign in to comment.