internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pypa/pipenv

Issue:
sort hashes in Pipfile.lock
I quickly searched the closed issues and don't seem to find something similar:

Is it possible to make pipenv sort the hashes before writing them to the Pipfile.lock file so as there are fewer changes to the file in each installation of a new module?

Thanks for the great project.


Discussion:
Hi, it does since 11.0 (#1529), at least on my machine.
That's great, I verified that it sorts the hashes in the latest version, thanks for the fast reply!
Looks like 1fa3e2a567da779b0c081ac28893aca3353c0674 caused a regression on this bug and #1529.

Code should be: 

    collected_hashes = list(sorted(set(collected_hashes)))

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -1070,7 +1070,7 @@ def do_lock(
             {dep['name']: {'version': '=={0}'.format(dep['version'])}}
         )
         # Add Hashes to lockfile
-        lockfile['develop'][dep['name']]['hashes'] = sorted(dep['hashes'])
+        lockfile['develop'][dep['name']]['hashes'] = dep['hashes']
         # Add index metadata to lockfile.
         if 'index' in dep:
             lockfile['develop'][dep['name']]['index'] = dep['index']
@@ -1126,7 +1126,7 @@ def do_lock(
             {dep['name']: {'version': '=={0}'.format(dep['version'])}}
         )
         # Add Hashes to lockfile
-        lockfile['default'][dep['name']]['hashes'] = sorted(dep['hashes'])
+        lockfile['default'][dep['name']]['hashes'] = dep['hashes']
         # Add index metadata to lockfile.
         if 'index' in dep:
             lockfile['default'][dep['name']]['index'] = dep['index']
diff --git a/pipenv/utils.py b/pipenv/utils.py
--- a/pipenv/utils.py
+++ b/pipenv/utils.py
@@ -496,7 +496,7 @@ def resolve_deps(
             except (ValueError, KeyError, ConnectionError, IndexError):
                 if verbose:
                     print('Error generating hash for {}'.format(name))
-            collected_hashes = list(set(collected_hashes))
+            collected_hashes = sorted(set(collected_hashes))
             d = {'name': name, 'version': version, 'hashes': collected_hashes}
             if index:
                 d.update({'index': index})


Test patch:
Repository: pypa/pipenv

Issue:
Pipenv Shell raises error if shell's path contains space
This might be a windows only issue - Pipenv version 11.10.1
I am using cmder console

##### Steps to replicate
1. `set PIPENV_SHELL="c:\path_with space\enclosed\inquotes\shell"
2. `pipenv shell`

##### Expected result
Pipenv Shell is activated with the desired shell

##### Actual result
Pipenv Shell is activated with the default shell (cmd.exe)
> 'c:\path_with' is not regognized as an internal or external command

I use a portable cmder that is in a folder location that has spaces in its path.
To use Pipenv with cmder, I need to set `PIPENV_SHELL` to cmder's `init.bat` file
This files if there is a space in the folder path.

#### Work Around
Moving cmder's `init.bat` to a location with no spaces fixes it

![image](https://user-images.githubusercontent.com/9513968/39496845-4fccd9e6-4d6e-11e8-9efd-5a510420cc1e.png)


Pipenv Shell raises error if shell's path contains space
This might be a windows only issue - Pipenv version 11.10.1
I am using cmder console

##### Steps to replicate
1. `set PIPENV_SHELL="c:\path_with space\enclosed\inquotes\shell"
2. `pipenv shell`

##### Expected result
Pipenv Shell is activated with the desired shell

##### Actual result
Pipenv Shell is activated with the default shell (cmd.exe)
> 'c:\path_with' is not regognized as an internal or external command

I use a portable cmder that is in a folder location that has spaces in its path.
To use Pipenv with cmder, I need to set `PIPENV_SHELL` to cmder's `init.bat` file
This files if there is a space in the folder path.

#### Work Around
Moving cmder's `init.bat` to a location with no spaces fixes it

![image](https://user-images.githubusercontent.com/9513968/39496845-4fccd9e6-4d6e-11e8-9efd-5a510420cc1e.png)




Discussion:
Probably needs to quote it here. https://github.com/pypa/pipenv/blob/master/pipenv/core.py#L2179
I don’t think the above quote works. Didn’t actually check, but it seems on Windows it should go through the pew workon code path. I need to write a few unit tests to get this right…
Probably needs to quote it here. https://github.com/pypa/pipenv/blob/master/pipenv/core.py#L2179
I don’t think the above quote works. Didn’t actually check, but it seems on Windows it should go through the pew workon code path. I need to write a few unit tests to get this right…

Resolving patch:
diff --git a/pipenv/patched/pew/pew.py b/pipenv/patched/pew/pew.py
--- a/pipenv/patched/pew/pew.py
+++ b/pipenv/patched/pew/pew.py
@@ -184,7 +184,8 @@ def fork_bash(env, cwd):
 
 def fork_cmder(env, cwd):
     shell_cmd = ['cmd']
-    cmderrc_path = r'%CMDER_ROOT%\vendor\init.bat'
+    escaped_cmder_root = os.environ['CMDER_ROOT'].replace(' ', '^ ')
+    cmderrc_path = r'{0}\vendor\init.bat'.format(escaped_cmder_root)
     if expandpath(cmderrc_path).exists():
         shell_cmd += ['/k', cmderrc_path]
     if cwd:


Test patch:
Repository: pypa/pipenv

Issue:
should use virtualenv co-installed with pipenv
The pipenv command assumes the virtualenv command is located on PATH.  Since it is installed as a peer to pipenv, that copy should be used instead of search the PATH.  If not on the PATH, an error is generated.

In my case, pipenv (including the associated virtualenv) is built in a separate venv, and pipenv was added to PATH by creating a symlink from a directory that was already on PATH.

I can provide the output from `$ python -m pipenv.help`, but don't believe it would be useful.

------------

##### Expected result

Create the virtual environment in .venv as documented.

##### Actual result

~~~~~~ console
$ PIPENV_VENV_IN_PROJECT=true pipenv install -vv
Creating a virtualenv for this project…
Using /opt/kt-python36/bin/python3 (3.6.5) to create virtualenv…
⠋Warning: it looks like virtualenv is not in your PATH. We cannot continue until this is resolved.
~~~~~~

##### Steps to replicate

1.  Install pipenv as an isolated tool:

    ~~~~~~~~ console
    $ mkdir tools; cd tools
    $ python3.6 -m venv pipenv
    $ cd pipenv
    $ bin/pip install pipenv
    ...
    $ cd /some/dir/on/path
    $ ln -s .../tools/pipenv/bin/pipenv
    ~~~~~~~~

2.  Create project using a Pipfile, and install:

    ~~~~~~~~ console
    $ cd ~/projects/myproj/
    $ PIPENV_VENV_IN_PROJECT=true pipenv install -vv
    ~~~~~~~~



Discussion:

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -890,7 +890,7 @@ def do_create_virtualenv(python=None, site_packages=False):
     # The user wants the virtualenv in the project.
     if project.is_venv_in_project():
         cmd = [
-            'virtualenv',
+            sys.executable, '-m', 'virtualenv',
             project.virtualenv_location,
             '--prompt=({0})'.format(project.name),
         ]


Test patch:
Repository: pypa/pipenv

Issue:
Ignore comments from `pip freeze` when running `pipenv clean`
Addresses #2229 


Discussion:

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -2564,14 +2564,13 @@ def do_clean(
     # Ensure that virtualenv is available.
     ensure_project(three=three, python=python, validate=False)
     ensure_lockfile()
-    installed_packages = filter(
-        None,
-        delegator.run('{0} freeze'.format(which_pip())).out.strip().split(
-            '\n'
-        ),
-    )
+
     installed_package_names = []
-    for installed in installed_packages:
+    pip_freeze_command = delegator.run('{0} freeze'.format(which_pip()))
+    for line in pip_freeze_command.out.split('\n'):
+        installed = line.strip()
+        if not installed or installed.startswith('#'):  # Comment or empty.
+            continue
         r = Requirement.from_line(installed).requirement
         # Ignore editable installations.
         if not r.editable:


Test patch:
diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py
--- a/tests/integration/test_cli.py
+++ b/tests/integration/test_cli.py
@@ -85,6 +85,26 @@ def test_pipenv_check(PipenvInstance, pypi):
         assert 'requests' in p.pipenv('check').out
 
 
+@pytest.mark.cli
+def test_pipenv_clean_pip_no_warnings(PipenvInstance):
+    with PipenvInstance(chdir=True) as p:
+        with open('setup.py', 'w') as f:
+            f.write('from setuptools import setup; setup(name="empty")')
+        p.pipenv('run pip install -e .')
+        assert p.pipenv('clean').out
+
+
+@pytest.mark.cli
+def test_pipenv_clean_pip_warnings(PipenvInstance):
+    with PipenvInstance(chdir=True) as p:
+        with open('setup.py', 'w') as f:
+            f.write('from setuptools import setup; setup(name="empty")')
+        # create a fake git repo to trigger a pip freeze warning
+        os.mkdir('.git')
+        p.pipenv('run pip install -e .')
+        assert p.pipenv('clean').out
+
+
 @pytest.mark.cli
 def test_venv_envs(PipenvInstance):
     with PipenvInstance() as p:
Repository: pypa/pipenv

Issue:
UnboundLocalError in install against master
```
λ pipenv.exe install --three
Traceback (most recent call last):
  File "C:\Users\uranusjr\AppData\Local\Programs\Python\Python36\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\uranusjr\AppData\Local\Programs\Python\Python36\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\uranusjr\.local\bin\pipenv.exe\__main__.py", line 9, in <module>
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\cli.py", line 416, in install
    selective_upgrade=selective_upgrade,
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\core.py", line 1777, in do_install
    skip_requirements=skip_requirements,
UnboundLocalError: local variable 'skip_requirements' referenced before assignment
```

I believe this is introduced fairly recently. Investigating.


Discussion:

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -1766,6 +1766,8 @@ def do_install(
     # Don't search for requirements.txt files if the user provides one
     if requirements or package_name or project.pipfile_exists:
         skip_requirements = True
+    else:
+        skip_requirements = False
     concurrent = (not sequential)
     # Ensure that virtualenv is available.
     ensure_project(


Test patch:
Repository: pypa/pipenv

Issue:
Non-pipenv created virtualenvs don't create proper names registry
Handle errors attempting to read proper names registry / ensure registry existence first


Discussion:

Resolving patch:
diff --git a/pipenv/project.py b/pipenv/project.py
--- a/pipenv/project.py
+++ b/pipenv/project.py
@@ -111,7 +111,7 @@ def __init__(self, which=None, python_version=None, chdir=True):
         self._name = None
         self._virtualenv_location = None
         self._download_location = None
-        self._proper_names_location = None
+        self._proper_names_db_path = None
         self._pipfile_location = None
         self._pipfile_newlines = DEFAULT_NEWLINES
         self._lockfile_newlines = DEFAULT_NEWLINES
@@ -346,24 +346,23 @@ def download_location(self):
         return self._download_location
 
     @property
-    def proper_names_location(self):
-        if self._proper_names_location is None:
-            loc = os.sep.join(
-                [self.virtualenv_location, 'pipenv-proper-names.txt']
+    def proper_names_db_path(self):
+        if self._proper_names_db_path is None:
+            self._proper_names_db_path = Path(
+                self.virtualenv_location,
+                'pipenv-proper-names.txt',
             )
-            self._proper_names_location = loc
-        # Create the database, if it doesn't exist.
-        open(self._proper_names_location, 'a').close()
-        return self._proper_names_location
+        self._proper_names_db_path.touch()  # Ensure the file exists.
+        return self._proper_names_db_path
 
     @property
     def proper_names(self):
-        with open(self.proper_names_location) as f:
+        with self.proper_names_db_path.open() as f:
             return f.read().splitlines()
 
     def register_proper_name(self, name):
         """Registers a proper name to the database."""
-        with open(self.proper_names_location, 'a') as f:
+        with self.proper_names_db_path.open('a') as f:
             f.write('{0}\n'.format(name))
 
     @property


Test patch:
Repository: pypa/pipenv

Issue:
pipenv --clear is not compatible with pip 9
Be sure to check the existing issues (both open and closed!).

------------

##### Issue description

`do_clean` imports `pip._internal`, available only in 10+.

##### Expected result

Cleans the caches.

##### Actual result

```
$ pipenv --clear
Clearing caches…
Traceback (most recent call last):
  File "/Users/uranusjr/.local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv', 'console_scripts', 'pipenv')()
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/vendor/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/cli.py", line 225, in cli
    do_clear()
  File "/Users/uranusjr/Documents/programming/python/pipenv/pipenv/pipenv/core.py", line 132, in do_clear
    import pip._internal.locations
ModuleNotFoundError: No module named 'pip._internal'
```



Discussion:

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -129,13 +129,20 @@ def which(command, location=None, allow_global=False):
 
 def do_clear():
     click.echo(crayons.white("Clearing caches…", bold=True))
-    import pip._internal.locations
+    try:
+        from pip._internal import locations
+    except ImportError:     # pip 9.
+        from pip import locations
 
     try:
         shutil.rmtree(PIPENV_CACHE_DIR)
-        shutil.rmtree(pip._internal.locations.USER_CACHE_DIR)
-    except FileNotFoundError:
-        pass
+        shutil.rmtree(locations.USER_CACHE_DIR)
+    except OSError as e:
+        # Ignore FileNotFoundError. This is needed for Python 2.7.
+        import errno
+        if e.errno == errno.ENOENT:
+            pass
+        raise
 
 
 def load_dot_env():


Test patch:
Repository: pypa/pipenv

Issue:
Remove addtional blanks in output of pipenv graph
### Issue description

Output of ```pipenv graph``` will output addtional blank lines.

Such as when there is non installed packages, ```pipenv graph``` shows:

```
➜  pipenv graph

```

When there is are installed packages, ```pipenv graph``` shows:

```
➜ pipenv graph
Flask==1.0.2
  - click [required: >=5.1, installed: 7.0]
  - itsdangerous [required: >=0.24, installed: 1.1.0]
  - Jinja2 [required: >=2.10, installed: 2.10]
    - MarkupSafe [required: >=0.23, installed: 1.1.0]
  - Werkzeug [required: >=0.14, installed: 0.14.1]
requests==2.20.1
  - certifi [required: >=2017.4.17, installed: 2018.10.15]
  - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]
  - idna [required: >=2.5,<2.8, installed: 2.7]
  - urllib3 [required: >=1.21.1,<1.25, installed: 1.24.1]

```


### Expected result

It will be nice to remove the blank lines, such as following outout.

```
➜  pipenv graph
```

```
➜ pipenv graph
Flask==1.0.2
  - click [required: >=5.1, installed: 7.0]
  - itsdangerous [required: >=0.24, installed: 1.1.0]
  - Jinja2 [required: >=2.10, installed: 2.10]
    - MarkupSafe [required: >=0.23, installed: 1.1.0]
  - Werkzeug [required: >=0.14, installed: 0.14.1]
requests==2.20.1
  - certifi [required: >=2017.4.17, installed: 2018.10.15]
  - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]
  - idna [required: >=2.5,<2.8, installed: 2.7]
  - urllib3 [required: >=1.21.1,<1.25, installed: 1.24.1]
```

-------------------------------------------------------------------------------

Please run `$ pipenv --support`, and paste the results here. Don't put backticks (`` ` ``) around it! The output already contains Markdown formatting.

If you're on macOS, run the following:

    $ pipenv --support | pbcopy

If you're on Windows, run the following:

    > pipenv --support | clip

If you're on Linux, run the following:

    $ pipenv --support | xclip



Discussion:

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -2517,7 +2517,7 @@ def traverse(obj):
             click.echo(simplejson.dumps(data, indent=4))
             sys.exit(0)
         else:
-            for line in c.out.split("\n"):
+            for line in c.out.strip().split("\n"):
                 # Ignore bad packages as top level.
                 if line.split("==")[0] in BAD_PACKAGES and not reverse:
                     continue


Test patch:
Repository: pypa/pipenv

Issue:
Do not raise exception for pipenv graph when virtualenv does not exist
### Issue description

When virutaulenv is not created for a project yet, ```pipenv graph``` will raise exception.

```
➜  pipenv graph
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv', 'console_scripts', 'pipenv')()
  File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/user/Documents/dev/pipenv/pipenv/cli/command.py", line 538, in graph
    do_graph(bare=bare, json=json, json_tree=json_tree, reverse=reverse)
  File "/home/user/Documents/dev/pipenv/pipenv/core.py", line 2430, in do_graph
    python_path = which("python")
  File "/home/user/Documents/dev/pipenv/pipenv/core.py", line 110, in which
    raise RuntimeError("location not created nor specified")
RuntimeError: location not created nor specified
```

It happens at least for v2018.10.13.

### Expected result

It should be a friendly info.

```
➜  pipenv graph
Warning: No virtualenv has been created for this project yet! Consider running `pipenv install` first to automatically generate one for you or see`pipenv install --help` for further instructions.
```

-------------------------------------------------------------------------------

Please run `$ pipenv --support`, and paste the results here. Don't put backticks (`` ` ``) around it! The output already contains Markdown formatting.

If you're on macOS, run the following:

    $ pipenv --support | pbcopy

If you're on Windows, run the following:

    > pipenv --support | clip

If you're on Linux, run the following:

    $ pipenv --support | xclip



Discussion:

Resolving patch:
diff --git a/pipenv/core.py b/pipenv/core.py
--- a/pipenv/core.py
+++ b/pipenv/core.py
@@ -2438,6 +2438,9 @@ def do_graph(bare=False, json=False, json_tree=False, reverse=False):
             err=True,
         )
         sys.exit(1)
+    except RuntimeError:
+        pass
+
     if reverse and json:
         click.echo(
             u"{0}: {1}".format(


Test patch:
Repository: pypa/pipenv

Issue:
pipenv update fails (given PIPENV_PIPFILE is not found)
### Issue description

In a project where Pipfiles are not under current working directory, pipenv update fails. 
In contrast, pipenv sync works well (if foo already contains a Pipfile.lock file). So the problem happens when trying to create Pipfile.lock.

```
 + foo
    - Pipfile
```

> set PIPENV_PIPFILE=foo\Pipfile
> pipenv update --verbose
 
### Expected result

I expect pipenv to create `Pipfile.lock` under foo directory.

### Actual result

```
λ pipenv update --verbose
Running $ pipenv lock then $ pipenv sync.
Locking [dev-packages] dependencies…
Locking Failed!
Traceback (most recent call last):
  File "c:/python37/lib/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "c:/python37/lib/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "c:/python37/lib/site-packages/pipenv/resolver.py", line 72, in _main
    from pipenv.core import project
  File "c:\python37\lib\site-packages\pipenv\core.py", line 22, in <module>
    from .project import Project, SourceNotFound
  File "c:\python37\lib\site-packages\pipenv\project.py", line 110, in <module>
    raise RuntimeError("Given PIPENV_PIPFILE is not found!")
RuntimeError: Given PIPENV_PIPFILE is not found!
File "c:/python37/lib/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "c:/python37/lib/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "c:/python37/lib/site-packages/pipenv/resolver.py", line 72, in _main
    from pipenv.core import project
  File "c:\python37\lib\site-packages\pipenv\core.py", line 22, in <module>
    from .project import Project, SourceNotFound
  File "c:\python37\lib\site-packages\pipenv\project.py", line 110, in <module>
    raise RuntimeError("Given PIPENV_PIPFILE is not found!")
RuntimeError: Given PIPENV_PIPFILE is not found!
```

### Remarks

If I set PIPENV_SKIP_LOCK and then execute:

> pipenv install

Then there is no problem. Which confirms that the problem is somehow that pipenv fails to create Pipfile.lock when PIPENV_PIPFILE is not on the working directory.




Discussion:

Resolving patch:
diff --git a/pipenv/project.py b/pipenv/project.py
--- a/pipenv/project.py
+++ b/pipenv/project.py
@@ -99,6 +99,9 @@ def preferred_newlines(f):
 
     else:
         PIPENV_PIPFILE = _normalized(PIPENV_PIPFILE)
+        # Overwrite environment variable so that subprocesses can get the correct path.
+        # See https://github.com/pypa/pipenv/issues/3584
+        os.environ['PIPENV_PIPFILE'] = PIPENV_PIPFILE
 # (path, file contents) => TOMLFile
 # keeps track of pipfiles that we've seen so we do not need to re-parse 'em
 _pipfile_cache = {}


Test patch: