-
-
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
pipenv2020 can not lock local dependencies #4235
Comments
I also tried cleaning cache with no changes to behaviour. Question from my side would be why is it mentioning pypi when its a local dependency anyway? edit: Only update / lock is affected. install still works fine. |
I think the pypi mention is just a default put in when pipenv can't find any version of the mentioned package. I have no idea what the issue might be yet, but could you try with |
I edited the Pipfile to include editable=false, no changes as far as I can tell. |
Thanks for taking the time to file this bug -- does he situation improve if you set If this doesn't help, can you share the |
the setup.py of adplib is fairly simple:
setup.cfg also not really special:
|
Thanks for the example -- FYI, using the current master branch I created the following structure: /tmp tree test/
test/
├── adplib
│ ├── adplib
│ │ └── __init__.py
│ └── setup.py
└── myproject
├── Pipfile So I moved into /t/t/myproject pipenv install -e ../adplib/
Installing -e ../adplib/…
Adding adplib to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✔ Success!
Updated Pipfile.lock (1efb46)!
Installing dependencies from Pipfile.lock (1efb46)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 25/25 — 00:00:05
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run. Now I know you mentioned Here is the update: /t/t/myproject pipenv update
Running $ pipenv lock then $ pipenv sync.
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✔ Success!
Updated Pipfile.lock (1efb46)!
Installing dependencies from Pipfile.lock (1efb46)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 25/25 — 00:00:05
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! And then with a fresh environment/no lockfile: /t/t/myproject pipenv --rm; and rm -rf Pipfile.lock
Removing virtualenv (/home/techalchemy/.virtualenvs/myproject-XjvO1jED)…
/t/t/myproject cat Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
adplib = {editable = true, path = "./../adplib"}
[requires]
python_version = "3.8"
/t/t/myproject pipenv lock
Creating a virtualenv for this project…
Pipfile: /tmp/test/myproject/Pipfile
Using /home/techalchemy/.pyenv/versions/3.8.2/bin/python3.8 (3.8.2) to create virtualenv…
⠸ Creating virtual environment...created virtual environment CPython3.8.2.final.0-64 in 201ms
creator CPython3Posix(dest=/home/techalchemy/.virtualenvs/myproject-XjvO1jED, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/home/techalchemy/.local/share/virtualenv/seed-app-data/v1.0.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
✔ Successfully created virtual environment!
Virtualenv location: /home/techalchemy/.virtualenvs/myproject-XjvO1jED
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✔ Success!
Updated Pipfile.lock (1efb46)! If you have some way I can reproduce this on master, or if you can confirm that it still happens on master, that would be really helpful. Thanks! |
I noticed one difference: the in the setup.py we ALSO specify adplib as a dependency. Not just in the Pipfile:
the pipfile of an example adpservice then includes adpservice as well:
|
I tried with the latest master today and the same issue occurs. |
I tried with the released version today and the problem still occurs. I am currently assuming that the problem is that |
Sorry for not getting back to you -- proper packages take precedence in pipenv over entries in your pipfile; that is, if you define something in Because the definition in setup(
...
install_requires=["adplib @ file://localhost/path/to/adplib"]
...
) Note that you need to include So, ultimately my advice would be that if you want to use a relative filepath as a dependency, you will need to take it out of your Sorry for the trouble and thanks for the report! |
@techalchemy Thanks for your explanation of what Pipenv's doing here, it's helpful! We've run into this exact issue recently at work. Is there any chance that Pipenv would support merging the two requirements specifications instead of (silently) ignoring one over the other? I would think it'd be possible for the resolver to figure out that package A needs package B (in our case, at version X) and also that package B should installed (editable) from location Y. That is, the abstract dependency (in setup.py) is different and independent from how the dependency is satisfied (described by the editable:true instruction in the Pipfile). This used to work great with Pipenv 2018, as the OP also notes, and only broke in more recent Pipenv versions. Is it your expectation that the new behaviour is here to stay (i.e. this issue is a WONTFIX) or is there further consideration to be made? |
The core id3c package is technically required for id3c-customizations, but the editable install of id3c through pipenv does not resolve this dependency. Details can be found in the open issue here: pypa/pipenv#4235
Yesterday the client where I deployed the setup from the OP reported he upgraded to pipenv 202011 and apparently it builds with no further changes. I will update once i know more (hopefully before xmas). |
I confirmed the setup works again just by pinning pipenv to 2020.11.15. @techalchemy I would recommend closing this for now as at least for my situation and reports pipenv works as expected now. |
Ah dang, I just rechecked and found out we only tested installing, something that also worked with earlier 2020 versions. Locking still fails. However we will probably go with locking with 2018 and installing with 2020 now as 2018 (sometimes) has problems not installing every requirement. |
@frostming, please re-open the issue |
I believe this issue would not be possible in the recent pipenv releases. Please try it with |
Issue description
The issue is occuring with the current prerelease version but does not occur with pipenv2018.
When running
pipenv update
orpipenv lock
pipenv fails to "find a version that matches adplib". Adplib is a shared library we added via pipenv install -e ./../adplib resulting in the following Pipfile entry:adplib = {editable = true, path = "./../adplib"}
Adplib itself is included in our git repository as a submodule as multiple repos reuse it.
Expected result
Lock succeeds.
Actual result
Steps to replicate
Not sure exactly where to go on from here. I remember reading about changes to locking with regards to vcs dependencies.
$ pipenv --support
Pipenv version:
'2020.4.1b1'
Pipenv location:
'/usr/lib/python3.8/site-packages/pipenv'
Python location:
'/usr/bin/python'
Python installations found:
3.8.2
:/usr/bin/python3
3.8.2
:/usr/bin/python3.8
3.7.6
:/usr/bin/python3.7
3.7.6
:/usr/bin/python3.7m
3.7.6
:/home/winlu/.pyenv/versions/3.7.6/bin/python3.7
3.7.5
:/home/winlu/.pyenv/versions/3.7.5/bin/python3.7
3.6.9
:/usr/bin/python3.6m
3.6.9
:/usr/bin/python3.6
3.6.9
:/home/winlu/.pyenv/versions/3.6.9/bin/python3.6m
2.7.18
:/usr/bin/python2.7
2.7.18
:/usr/bin/python2
PEP 508 Information:
System environment variables:
SHELL
XDG_SESSION_PATH
I3SOCK
GRADLE_HOME
DESKTOP_SESSION
GTK_MODULES
XDG_SEAT
PWD
XDG_SESSION_DESKTOP
LOGNAME
XDG_SESSION_TYPE
XAUTHORITY
DESKTOP_STARTUP_ID
HOME
LANG
XDG_CURRENT_DESKTOP
XDG_SEAT_PATH
XDG_SESSION_CLASS
USER
PAM_KWALLET5_LOGIN
DISPLAY
SHLVL
XDG_VTNR
XDG_SESSION_ID
MOZ_PLUGIN_PATH
XDG_RUNTIME_DIR
PATH
DBUS_SESSION_BUS_ADDRESS
HG
MAIL
OLDPWD
WINDOWID
COLORFGBG
COLORTERM
TERM
ZSH
PAGER
LESS
LSCOLORS
LS_COLORS
SSH_AUTH_SOCK
SSH_AGENT_PID
PYENV_SHELL
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_SHIMS_BASE_MODULE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/home/winlu/bin:/home/winlu/.pyenv/shims:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
SHELL
:/bin/zsh
LANG
:en_GB.UTF-8
PWD
:/home/winlu/projects/customer/project/umbrella/adpservice/adpservice
Contents of
Pipfile
('/home/winlu/projects/customer/project/umbrella/adpservice/adpservice/Pipfile'):Contents of
Pipfile.lock
('/home/winlu/projects/customer/project/umbrella/adpservice/adpservice/Pipfile.lock'):The text was updated successfully, but these errors were encountered: