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

2023.8.19 through to 2023.8.22 break editable package installation #5858

Closed
stewartmiles opened this issue Aug 22, 2023 · 19 comments · Fixed by #5870 or #5896
Closed

2023.8.19 through to 2023.8.22 break editable package installation #5858

stewartmiles opened this issue Aug 22, 2023 · 19 comments · Fixed by #5870 or #5896
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. Type: Bug 🐛 This issue is a bug.

Comments

@stewartmiles
Copy link

Issue description

Editable package installation appears to be broken from pipenv 2023.8.19 onwards.
For example, given a package in the directory test-hello under the pipenv root installing the package with pipenv install -e ./test-hello fails.

Expected result

pipenv 2023.7.23 and prior versions would install editable packages in Pipfile and in the venv.

Actual result

Here's a log of package installation across recent versions of pipenv.
try_pipenv_versions.log

For example:

+ pipx install pipenv==2023.8.19
creating virtual environment...
installing pipenv from spec 'pipenv==2023.8.19'...
done! ✨ 🌟 ✨
  installed package pipenv 2023.8.19, installed using Python 3.8.10
  These apps are now globally available
    - pipenv
    - pipenv-resolver
+ git clean -dfx
Removing .venv/
Removing applications/test-hello/test_hello.egg-info/
Removing test-hello/test_hello.egg-info/
+ echo '=== Using pipenv version 2023.8.19 ==='
=== Using pipenv version 2023.8.19 ===
+ pipenv sync
Creating a virtualenv for this project...
Pipfile: /home/stewart/src/pipenv_editable_install_repro/Pipfile
Using /usr/bin/python3.8 (3.8.10) to create virtualenv...
created virtual environment CPython3.8.10.final.0-64 in 48ms
  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.0.0, wheel==0.41.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /home/stewart/src/pipenv_editable_install_repro/.venv
Installing dependencies from Pipfile.lock (db4242)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
+ install_test_and_uninstall_package ./test-hello
+ path=./test-hello
+ pipenv run pipenv install -e ./test-hello
Installing -e ./test-hello...
Resolving -e ./test-hello...
�[31m�[1mError:�[0m Traceback (most recent call last):
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/routines/install.py", line 
279, in do_install
    added, cat, normalized_name = project.add_package_to_pipfile(
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/project.py", line 1159, in 
add_package_to_pipfile
    name, normalized_name, entry = self.generate_package_pipfile_entry(
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/project.py", line 1110, in 
generate_package_pipfile_entry
    req_name = determine_package_name(package)
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/utils/dependencies.py", line 
745, in determine_package_name
    raise ValueError(f"Could not determine package name from {package}")
ValueError: Could not determine package name from 
file:///file:///home/stewart/src/pipenv_editable_install_repro/test-hello

✘ Failed adding package to Pipfile
✔ Installation Succeeded

It's also interesting that installation fails, due to the mangled URI that starts with file:///file:///, but the final message is that installation succeeded.

Steps to replicate

https://github.com/stewartmiles/pipenv_editable_install_repro contains a minimal test environment.
I generated the log file using:

git clone https://github.com/stewartmiles/pipenv_editable_install_repro
cd pipenv_editable_install_repro
./try_pipenv_versions.sh 2>&1 | tee ../try_pipenv_versions.log

Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.

$ pipenv --support

Pipenv version: '2023.8.22'

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
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: true

Debug–specific environment variables:

  • PATH: ~/.local/bin:/home/stewart/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/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'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.8"

Contents of Pipfile.lock ('/home/stewart/src/pipenv_editable_install_repro/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "7f7606f08e0544d8d012ef4d097dabdd6df6843a28793eb6551245d4b2db4242"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.8"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}
@hzblacksmith
Copy link

Same here, I am working in Amplify and had to specify pipenv==2023.7.23 in amplify.yml to make Amplify build work, otherwise (without specifying the version) it will raise 'Failed to install dependencies in ... Error: Command failed with exit code 1: pipenv install)'

@lewiswolf
Copy link

Same issue here. Also breaking for pipenv install "git+...".

@matteius
Copy link
Member

@lewiswolf I believe that is a separate issue, there are a couple reports about the git+ vcs issue and an open PR that some have reported fix it.

Regarding this actual issue report, I think part of the problem (maybe not the whole problem) is the ast parser logic for the old setup.py file logic is not accounting for all cases. I tried to correct for that some locally over lunch in the reproduction link (super helpful by the way) and was able to get it to install for the top level test-hello, but when I try the one in the applications sub-dir, I get a pathing issue.

I'll be able to cut a release going into late evening for the PR I have open, but I am not sure I have an immediate fix for what's going on with editable file installs in this issue report.

@matteius matteius added Type: Bug 🐛 This issue is a bug. Priority: High This item is high priority and should be resolved quickly. Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Aug 23, 2023
@matteius
Copy link
Member

So I opened #5861 which I did some testing on windows and linux and it appears to be past this issue, but what I noticed is on windows it will lock a relative path fine, but on linux in this branch its adding the full path to the Pipfile, and then locking that. 🤔

test-hello = {file = "file:/home/matteius/pipenv_editable_install_repro/applications/test-hello", editable=true}

@matteius
Copy link
Member

Good news (I think) -- this branch works for your reproduction examples that I tried on Windows and the changes are still passing the existing pipenv tests. Please have a look and help me verify if it resolves the issues or if there is still something to address regarding local file installs: #5870

@stewartmiles
Copy link
Author

@matteius thanks for the patch. However, it looks like things still aren't working correctly.

Here's a log of a new test run with 2023.8.26:
try_pipenv_versions.log

Or even easier after cloning https://github.com/stewartmiles/pipenv_editable_install_repro:

pipenv sync && pipenv install -e ./test-hello

which errors out with:

Creating a virtualenv for this project...
Pipfile: /home/stewart/src/pipenv_editable_install_repro/Pipfile
Using /usr/bin/python3.8 (3.8.10) to create virtualenv...
⠋ Creating virtual environment...created virtual environment CPython3.8.10.final.0-64 in 51ms
  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.0.0, 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
Installing dependencies from Pipfile.lock (db4242)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
Installing -e ./test-hello...
Resolving -e ./test-hello...
⠋ Installing...Error: Traceback (most recent call last):
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/routines/install.py",
line 255, in do_install
    added, cat, normalized_name = project.add_package_to_pipfile(
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/project.py", line
1167, in add_package_to_pipfile
    name, normalized_name, entry = self.generate_package_pipfile_entry(
  File "/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/project.py", line
1114, in generate_package_pipfile_entry
    req_name = determine_package_name(package)
  File
"/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/utils/dependencies.py", line
744, in determine_package_name
    raise ValueError(f"Could not determine package name from {package}")
ValueError: Could not determine package name from
file:///home/stewart/src/pipenv_editable_install_repro/test-hello

✘ Failed adding package to Pipfile
✔ Installation Succeeded
Installing dependencies from Pipfile.lock (db4242)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

@matteius matteius reopened this Aug 28, 2023
@matteius
Copy link
Member

@stewartmiles That reproduction repository it was I was testing the fix against. I tried both windows, and here is my ubuntu:

matteius@matteius-VirtualBox:~/pipenv_editable_install_repro$ pipenv install -e ./test-hello/
Creating a virtualenv for this project...
Pipfile: /home/matteius/pipenv_editable_install_repro/Pipfile
Using default python from /usr/bin/python (3.10.12) to create virtualenv...
⠼ Creating virtual environment...created virtual environment CPython3.10.12.final.0-64 in 337ms
  creator CPython3Posix(dest=/home/matteius/.virtualenvs/pipenv_editable_install_repro-3TYtUsNd, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/matteius/.local/share/virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.0.0, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /home/matteius/.virtualenvs/pipenv_editable_install_repro-3TYtUsNd
Creating a Pipfile for this project...
Installing -e ./test-hello/...
Resolving -e ./test-hello/...
Added test-hello to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
⠸ Locking...Warning: INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining file:///home/matteius/pipenv_editable_install_repro/test-hello (from -r /tmp/pipenv-8i8n7f5s-requirements/pipenv-e9l02qrp-constraints.txt (line 2))
INFO:pipenv.patched.pip._internal.cli.spinners:Installing build dependencies: started
INFO:pipenv.patched.pip._internal.cli.spinners:Installing build dependencies: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Checking if build backend supports build_editable: started
INFO:pipenv.patched.pip._internal.cli.spinners:Checking if build backend supports build_editable: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Getting requirements to build wheel: started
INFO:pipenv.patched.pip._internal.cli.spinners:Getting requirements to build wheel: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Preparing metadata (pyproject.toml): started
INFO:pipenv.patched.pip._internal.cli.spinners:Preparing metadata (pyproject.toml): finished with status 'done'
Locking [dev-packages] dependencies...
Updated Pipfile.lock (a528f480c44a1940d1f9897c854058593109192be0c4f125d8e2497338d05198)!
Installing dependencies from Pipfile.lock (d05198)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

@stewartmiles
Copy link
Author

🤔 that's odd. My environment uses pipenv installed via pipx and I'm using Python 3.8.

Here's my attempt with the Python docker image:

docker run -it python:3.10.12 /bin/sh
# pip install pipenv
# pipenv --version
pipenv, version 2023.8.26
# git clone https://github.com/stewartmiles/pipenv_editable_install_repro
# cd pipenv_editable_install_repro

First attempt:

# pipenv sync && pipenv install -e ./test-hello
Warning: Python 3.8 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path/to/python

ok so I need to update the Pipfile etc.:

# rm Pipfile*
# pipenv --python 3.10
# pipenv lock
Locking [packages] dependencies...
Locking [dev-packages] dependencies...
Updated Pipfile.lock (8e6547742479a83bb67555446f723053c2894d670dcc89b1a6e1e07cab885a1b)!

Finally, try again:

# pipenv install -e ./test-hello
Installing -e ./test-hello...
Resolving -e ./test-hello...
⠋ Installing...Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pipenv/routines/install.py", line 255, in do_install
    added, cat, normalized_name = project.add_package_to_pipfile(
  File "/usr/local/lib/python3.10/site-packages/pipenv/project.py", line 1167, in
add_package_to_pipfile
    name, normalized_name, entry = self.generate_package_pipfile_entry(
  File "/usr/local/lib/python3.10/site-packages/pipenv/project.py", line 1114, in
generate_package_pipfile_entry
    req_name = determine_package_name(package)
  File "/usr/local/lib/python3.10/site-packages/pipenv/utils/dependencies.py", line 744, in
determine_package_name
    raise ValueError(f"Could not determine package name from {package}")
ValueError: Could not determine package name from file:///pipenv_editable_install_repro/test-hello

✘ Failed adding package to Pipfile
✔ Installation Succeeded
Installing dependencies from Pipfile.lock (885a1b)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

So it doesn't seem related to Python version or the fact I usually install pipenv with pipx.

@matteius
Copy link
Member

Maybe the ast parser for the setup.py to determine the package name isn't working right for lower versions of python?

@stewartmiles
Copy link
Author

I reproduced with 3.10.12 which is the same version that you're using AFAIK

@stbth01
Copy link

stbth01 commented Aug 28, 2023

This maybe a different issue as I'm hitting a private repo but I wanted to add my notes in case its related or it may help others since this thread helped me.

My github build started failing on 8/16 I see that a passing build that day had pipenv version 2023.7.23 and the very next build had 2023.8.22 and I started getting the following error

CRITICAL:pipenv.patched.pip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement dkany (from versions: none)
[ResolutionFailure]:   File "c:\users\bhunscher\appdata\local\programs\python\python38\lib\site-packages\pipenv\resolver.py", line 811, in _main
[ResolutionFailure]:       resolve_packages(
[ResolutionFailure]:   File "c:\users\bhunscher\appdata\local\programs\python\python38\lib\site-packages\pipenv\resolver.py", line 759, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:   File "c:\users\bhunscher\appdata\local\programs\python\python38\lib\site-packages\pipenv\resolver.py", line 738, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:   File "c:\users\bhunscher\appdata\local\programs\python\python38\lib\site-packages\pipenv\utils\resolver.py", line 1096, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:   File "c:\users\bhunscher\appdata\local\programs\python\python38\lib\site-packages\pipenv\utils\resolver.py", line 895, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "c:\users\bhunscher\appdata\local\programs\python\python38\lib\site-packages\pipenv\utils\resolver.py", line 684, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: No matching distribution found for dkany
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://my-repository/simple/"
verify_ssl = true
name = "mine"

[packages]
dataclasses-json = "*"
pandas = ">0.20.1"
strenum = "*"
pyyaml = "*"
dkany = {version="0.0.13", index="mine"}
....

This may be obvious but I was wondering for a bit so if I help someone great.

@matteius
Copy link
Member

@stbth01 that issue may be what is tracked with #5878 and #5880

@stewartmiles
Copy link
Author

@matteius not sure whether you saw #5858 (comment) but as I mentioned I reproduced the problem with 2023.8.26 with python 3.10.12 (your test version) in a Python docker container.

@matteius
Copy link
Member

@stewartmiles I determined it to be a limitation of the prior ast parser on python 3.10 version -- hopefully latest pipenv 2023.8.28 works for you. Please try it out and close the issue if it is satisfactory.

@matteius matteius added Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. and removed Priority: High This item is high priority and should be resolved quickly. Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Aug 29, 2023
@stewartmiles
Copy link
Author

@matteius what is the minimum Python version now required to use pipenv? It used to support all of 3.x but now it sounds like if it doesn't work with 3.10 then all users using editable packages (at least) will need to upgrade.

@matteius
Copy link
Member

@stewartmiles python 3.7 thru 3.11 are still supported -- at some point later this year we will drop support for 3.7. I patched the ast parser logic for setup.py; unless you are reporting a new issue with this update? I still recommend folks migrate away from putting the library name in the setup.py because parsing it can be problematic, but it is expected to work in cases where the string is present in the setup.py

@stewartmiles
Copy link
Author

stewartmiles commented Aug 29, 2023

@matteius I misread the version number you mentioned in #5858 (comment) i.e 2023.8.28 not 26. In #5858 (comment) I tested 2023.8.26 and Python 3.10.12 things did not work, editable package installation fails.

With the latest version 2023.8.28 using https://github.com/stewartmiles/pipenv_editable_install_repro @ stewartmiles/pipenv_editable_install_repro@1926b97 things work fine.

However, now when installing editable packages from parent directories outside the venv (a behavior that used to work), package installation embeds the absolute path of the editable package in Pipfile and Pipfile.lock. This is reproducible with 2023.8.28 with stewartmiles/pipenv_editable_install_repro@86ed880 (sorry the shell is becoming a mess).

i.e running:

git clone https://github.com/stewartmiles/pipenv_editable_install_repro
cd pipenv_editable_install_repro
./try_pipenv_versions.sh 2>&1 | tee ../try_pipenv_versions.log

results in:

+ echo './../test-hello and ../test-hello '
./../test-hello and ../test-hello
+ echo 'not found in {filename}'
not found in {filename}
+ echo '--- Pipfile ---'
--- Pipfile ---
+ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
test-hello = {file = "/home/stewart/src/pipenv_editable_install_repro/test-hello", editable = true}

[dev-packages]

[requires]
python_version = "3.8"
+ error=1
+ for filename in Pipfile Pipfile.lock
++ grep -F '"./../test-hello' Pipfile.lock
+ local found_relative_package_path=
++ grep -F '"../test-hello' Pipfile.lock
+ local found_alternative_package_path=
+ [[ -z '' ]]
+ [[ -z '' ]]
+ echo './../test-hello and ../test-hello '
./../test-hello and ../test-hello
+ echo 'not found in {filename}'
not found in {filename}
+ echo '--- Pipfile.lock ---'
--- Pipfile.lock ---
+ cat Pipfile.lock
{
    "_meta": {
        "hash": {
            "sha256": "08d8cd2781157cf3ebafbeba84526e1c8ed2450b91b614e70ea3e09e24c9ebaa"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.8"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "test-hello": {
            "editable": true,
            "file": "/home/stewart/src/pipenv_editable_install_repro/test-hello"
        }
    },
    "develop": {}
}
+ error=1
+ return 1
+ error=1
+ popd
~/src/pipenv_editable_install_repro
+ return 1
+ echo '--- pipenv version 2023.8.28 is broken ---'
--- pipenv version 2023.8.28 is broken ---

The full log is try_pipenv_versions.log

@matteius
Copy link
Member

@stewartmiles Ah, absolute path bites again -- ok, well I believe this is the area where that is happening: https://github.com/pypa/pipenv/blob/main/pipenv/utils/dependencies.py#L648-L651

I am fully open to code patches that will further figure out how to keep the file paths relative -- I am just not sure the exact direction to head.

@matteius
Copy link
Member

@stewartmiles I have a PR out that I believe does a better job at determining the relative path: #5896

Example:

matteius@matteius-VirtualBox:~/pipenv_editable_install_repro/test-hello$ pipenv install ../applications/test-hello/
Creating a virtualenv for this project...
Pipfile: /home/matteius/pipenv_editable_install_repro/test-hello/Pipfile
Using default python from /usr/bin/python (3.10.12) to create virtualenv...
⠹ Creating virtual environment...created virtual environment CPython3.10.12.final.0-64 in 212ms
  creator CPython3Posix(dest=/home/matteius/.virtualenvs/test-hello--_GSX-an, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/matteius/.local/share/virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.0.0, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /home/matteius/.virtualenvs/test-hello--_GSX-an
Creating a Pipfile for this project...
Installing ../applications/test-hello/...
Resolving ../applications/test-hello/...
Added test-hello to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
⠏ Locking...Warning: INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining file:///home/matteius/pipenv_editable_install_repro/applications/test-hello (from -r /tmp/pipenv-lleb236s-requirements/pipenv-o8ryjw3e-constraints.txt (line 2))
INFO:pipenv.patched.pip._internal.cli.spinners:Installing build dependencies: started
INFO:pipenv.patched.pip._internal.cli.spinners:Installing build dependencies: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Checking if build backend supports build_editable: started
INFO:pipenv.patched.pip._internal.cli.spinners:Checking if build backend supports build_editable: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Getting requirements to build wheel: started
INFO:pipenv.patched.pip._internal.cli.spinners:Getting requirements to build wheel: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Preparing metadata (pyproject.toml): started
INFO:pipenv.patched.pip._internal.cli.spinners:Preparing metadata (pyproject.toml): finished with status 'done'
Locking [dev-packages] dependencies...
Updated Pipfile.lock (23b9cf861bceae95e2dbb7d2a1bcc9307d3e05244dd1e1e5a0c7eed37108a154)!
Installing dependencies from Pipfile.lock (08a154)...
cat PipTo activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
matteius@matteius-VirtualBox:~/pipenv_editable_install_repro/test-hello$ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
test-hello = {file = "../applications/test-hello"}

[dev-packages]

[requires]
python_version = "3.9"
matteius@matteius-VirtualBox:~/pipenv_editable_install_repro/test-hello$ cat Pipfile.lock 
{
    "_meta": {
        "hash": {
            "sha256": "23b9cf861bceae95e2dbb7d2a1bcc9307d3e05244dd1e1e5a0c7eed37108a154"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.9"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "test-hello": {
            "file": "../applications/test-hello"
        }
    },
    "develop": {}
}

Note: I had to remove the Pipfile/lock file from the parent directory so it wouldn't get confused about where it was starting from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. Type: Bug 🐛 This issue is a bug.
Projects
None yet
5 participants