Repository: pypa/pipenv

Issue:
Using 2023.9.1 editable package installation fails with --skiplock enabled
### Issue description

Enabling `--skiplock` e.g via a `.env` file causes editable package installation to fail.

### Expected result

When enabling `--skiplock` it would be great if editable package installation succeeded as it did in version `2023.7.23`.

### Actual result

Here's a minimal example using https://github.com/stewartmiles/pipenv_editable_install_repro

```bash
echo 'PIPENV_SKIP_LOCK=true' > .env && \
  pipenv --python $(which python) && \
  pipenv install -e ./test-hello
```

which fails with:
```
Loading .env environment variables...
Creating a virtualenv for this project...
Pipfile: /home/stewart/src/pipenv_editable_install_repro/Pipfile
Using /usr/bin/python (3.8.10) to create virtualenv...
⠋ Creating virtual environment...created virtual environment CPython3.8.10.final.0-64 in 53ms
  creator CPython3Posix(dest=/home/stewart/src/pipenv_editable_install_repro/.venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/stewart/.local/share/virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.1.2, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /home/stewart/src/pipenv_editable_install_repro/.venv
Creating a Pipfile for this project...
Loading .env environment variables...
The flag --skip-lock has been reintroduced (but is not recommended).  Without the lock resolver it is
difficult to manage multiple package indexes, and hash checking is not provided.  However it can help
manage installs with current deficiencies in locking across platforms.
Installing -e ./test-hello...
Resolving -e ./test-hello...
Added test-hello to Pipfile's [packages] ...
✔ Installation Succeeded
Installing dependencies from Pipfile...
[pipenv.exceptions.InstallError]: ERROR: Could not find a version that satisfies the requirement test-hello (from versions: none)
[pipenv.exceptions.InstallError]: ERROR: No matching distribution found for test-hello
ERROR: Couldn't install package: {}
 Package installation failed...
```

### Steps to replicate

See above. Also I've updated https://github.com/stewartmiles/pipenv_editable_install_repro/blob/main/try_pipenv_versions.sh to test this case as well.

-------------------------------------------------------------------------------

<details><summary>$ pipenv --support</summary>

Pipenv version: `'2023.9.1'`

Pipenv location: `'/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv'`

Python location: `'/home/stewart/.local/pipx/venvs/pipenv/bin/python'`

OS Name: `'posix'`

User pip version: `'23.2.1'`

user Python installations found:


PEP 508 Information:

```
{'implementation_name': 'cpython',
 'implementation_version': '3.8.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.15.0-69-generic',
 'platform_system': 'Linux',
 'platform_version': '#76~20.04.1-Ubuntu SMP Mon Mar 20 15:54:19 UTC 2023',
 'python_full_version': '3.8.10',
 'python_version': '3.8',
 'sys_platform': 'linux'}
```

System environment variables:

  - `SHELL`
  - `PIPENV_VENV_IN_PROJECT`
  - `TERMCAP`
  - `SSH_AUTH_SOCK`
  - `WINDOW`
  - `SSH_AGENT_PID`
  - `PWD`
  - `LOGNAME`
  - `XDG_SESSION_TYPE`
  - `MOTD_SHOWN`
  - `HOME`
  - `LANG`
  - `LS_COLORS`
  - `SSH_CONNECTION`
  - `LESSCLOSE`
  - `XDG_SESSION_CLASS`
  - `TERM`
  - `LESSOPEN`
  - `USER`
  - `XLA_FLAGS`
  - `SHLVL`
  - `XDG_SESSION_ID`
  - `KUBECONFIG`
  - `LD_LIBRARY_PATH`
  - `XDG_RUNTIME_DIR`
  - `SSH_CLIENT`
  - `XDG_DATA_DIRS`
  - `PATH`
  - `STY`
  - `DBUS_SESSION_BUS_ADDRESS`
  - `SSH_TTY`
  - `USE_GKE_GCLOUD_AUTH_PLUGIN`
  - `_`
  - `OLDPWD`
  - `PIP_DISABLE_PIP_VERSION_CHECK`
  - `PYTHONDONTWRITEBYTECODE`
  - `PIPENV_SKIP_LOCK`
  - `PYTHONFINDER_IGNORE_UNSUPPORTED`

Pipenv–specific environment variables:

 - `PIPENV_VENV_IN_PROJECT`: `true`
 - `PIPENV_SKIP_LOCK`: `true`

Debug–specific environment variables:

  - `PATH`: `/usr/local/cuda/bin:/usr/local/nvidia/bin:/home/stewart/bin/gradle/bin:/home/stewart/bin/cmake/bin:/usr/local/cuda/bin:~/.local/bin:/home/stewart/.local/bin:/home/stewart/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/stewart/bin/node/bin`
  - `SHELL`: `/bin/bash`
  - `LANG`: `en_US.UTF-8`
  - `PWD`: `/home/stewart/src/pipenv_editable_install_repro`


---------------------------

Contents of `Pipfile` ('/home/stewart/src/pipenv_editable_install_repro/Pipfile'):

```toml
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.8"
python_full_version = "3.8.10"

```

</details>



Discussion:

Resolving patch:
diff --git a/pipenv/utils/dependencies.py b/pipenv/utils/dependencies.py
--- a/pipenv/utils/dependencies.py
+++ b/pipenv/utils/dependencies.py
@@ -968,7 +968,33 @@ def expansive_install_req_from_line(
     )
 
 
+def _file_path_from_pipfile(path_obj, pipfile_entry):
+    """Creates an installable file path from a pipfile entry.
+    Handles local and remote paths, files and directories;
+    supports extras and editable specification.
+    Outputs a pip installable line.
+    """
+    parsed_url = urlparse(str(path_obj))
+    if parsed_url.scheme in ["http", "https", "ftp", "file"]:
+        req_str = str(path_obj)
+    elif path_obj.is_absolute():
+        req_str = str(path_obj.as_posix())
+    else:
+        req_str = f"./{str(path_obj.as_posix())}"
+
+    if pipfile_entry.get("extras"):
+        req_str = f"{req_str}[{','.join(pipfile_entry['extras'])}]"
+    if pipfile_entry.get("editable", False):
+        req_str = f"-e {req_str}"
+
+    return req_str
+
+
 def install_req_from_pipfile(name, pipfile):
+    """Creates an InstallRequirement from a name and a pipfile entry.
+    Handles VCS, local & remote paths, and regular named requirements.
+    "file" and "path" entries are treated the same.
+    """
     _pipfile = {}
     vcs = None
     if hasattr(pipfile, "keys"):
@@ -1008,9 +1034,11 @@ def install_req_from_pipfile(name, pipfile):
         else:
             req_str = f"{name}{extras_str}@ {req_str}{subdirectory}"
     elif "path" in _pipfile:
-        req_str = str(Path(_pipfile["path"]).as_posix())
+        path_obj = Path(_pipfile["path"])
+        req_str = _file_path_from_pipfile(path_obj, _pipfile)
     elif "file" in _pipfile:
-        req_str = str(Path(_pipfile["file"]).as_posix())
+        path_obj = Path(_pipfile["file"])
+        req_str = _file_path_from_pipfile(path_obj, _pipfile)
     else:
         # We ensure version contains an operator. Default to equals (==)
         _pipfile["version"] = version = get_version(pipfile)


Test patch: