-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Comments
Same here, I am working in Amplify and had to specify |
Same issue here. Also breaking for |
@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. |
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. 🤔
|
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 |
@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: Or even easier after cloning https://github.com/stewartmiles/pipenv_editable_install_repro: pipenv sync && pipenv install -e ./test-hello which errors out with:
|
@stewartmiles That reproduction repository it was I was testing the fix against. I tried both windows, and here is my ubuntu:
|
🤔 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:
ok so I need to update the Pipfile etc.:
Finally, try again:
So it doesn't seem related to Python version or the fact I usually install pipenv with pipx. |
Maybe the ast parser for the setup.py to determine the package name isn't working right for lower versions of python? |
I reproduced with 3.10.12 which is the same version that you're using AFAIK |
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
This may be obvious but I was wondering for a bit so if I help someone great. |
@matteius not sure whether you saw #5858 (comment) but as I mentioned I reproduced the problem with |
@stewartmiles I determined it to be a limitation of the prior ast parser on python 3.10 version -- hopefully latest pipenv |
@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. |
@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 |
@matteius I misread the version number you mentioned in #5858 (comment) i.e With the latest version 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 i.e running:
results in:
The full log is try_pipenv_versions.log |
@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. |
@stewartmiles I have a PR out that I believe does a better job at determining the relative path: #5896 Example:
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. |
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 withpipenv 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:
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:
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:
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'):Contents of
Pipfile.lock
('/home/stewart/src/pipenv_editable_install_repro/Pipfile.lock'):The text was updated successfully, but these errors were encountered: