-
-
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
Pipfile.lock changes local editable dependency to VCS #1130
Comments
FWIW, I just tested this on 8.3.2 and was not able to replicate it: $ rm -rf $(pipenv --venv) Pipfile.lock
$ cat Pipfile
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
"myproject" = {path = ".", editable = true}
[dev-packages]
$ pipenv install
Creating a virtualenv for this project…
⠋Using base prefix '/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/pete/.virtualenvs/myproject-sF_Aa0AH/bin/python3.6
Also creating executable in /Users/pete/.virtualenvs/myproject-sF_Aa0AH/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: /Users/pete/.virtualenvs/myproject-sF_Aa0AH
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (d7c923)!
Installing dependencies from Pipfile.lock (d7c923)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:00
To activate this project's virtualenv, run the following:
$ pipenv shell
$ grep myproject -A3 Pipfile.lock
"myproject": {
"editable": true,
"path": "."
}
$ pipenv --version
pipenv, version 8.3.2 |
The issue shows up when running |
@gsakkis I wasn't able to reproduce this. Out of curiosity, what was your project folder called? |
Ok, I looked into it closer and it turns out it manifests only when there is at least one other VCS dependency in the Pipfile. Sample Pipfile to reproduce:
If the |
@gsakkis if you install a local path in editable mode, it will pin the package version in the lockfile. In this case, since the local path is a git repository and has a |
@techalchemy pinning the local path in editable mode would be ok If it weren't for the fact that
|
Why was this closed? |
I object about closing this as well @techalchemy ! This is definitely not an expected behavior and took me a while to find out what's going on. If I don't have a VCS dependency, it behaves differently than when I have. I have a pretty standard project: few public dependencies, the package I develop in a private repo and one of public dependencies needs to be installed from github becuase it doesn't have the latest features in PyPi release. Just because of adding this simple dependency, I am not able to use My Pipfile:
while my Pipfile.lock:
and my setup.py:
I had to uncomment |
@hnykda we have about 3 other issues tracking this, can you include this information in one of the open ones? I know this is a problem and I know it’s really annoying (believe me, I use pipenv every day, I know). This one is just a tiny bit complicated I think, and we’ve been focused on the other fixed we needed. |
Cool. it's great if you could link related issues before closing it, I thought it's just abanonded and no one really cares. I was trying to replicate this on some minimal example and I wasn't successful, unfortunately. Is there anything particular you want me to test? |
@hnykda I think #1837 and #1690 are both the related issues and I have a clear idea about what is wrong, but a lot of dread about the fix... your case may be a touch different than all of these issues which is probably why you are having trouble reproducing -- It's not the url in the setup.py that matters but instead the use of |
@techalchemy I found this thread while investigating the same issue. Below I've included a minimal example that I was going to post in case it helps, but I can confirm though that this is fixed by the refactor you linked to. Thanks for the solution and excited to see it go live 😁 The original post I had for reference:
Using this Pipfile: [[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
[packages]
"e1839a8" = {path = ".", editable = true}
toolz = {git = "https://github.com/pytoolz/toolz.git"}
[requires]
python_version = "2.7" If the virtual environment is completely clean (e.g. after running But once I actually install and then redo the lock
only then does it add this entry to "funcy": {
"editable": true,
"git": "https://github.com/Suor/funcy.git",
"ref": "aa9dac86244313b47cfeff1918e076b1e0bf7776"
}, This results in plenty of other issues depending on individual setups. Like @hnykda mentioned above it can cause problems with private repos, and it also can cause unfortunate issues when rebasing in git if the ref is deleted. I also find that this can lead to local edits to the code being ignored inside the virtualenv. |
- This was removed in a refactor for no discernable reason - The logic is still present in dev-packages - Fixes #1130 Signed-off-by: Dan Ryan <[email protected]>
- This was removed in a refactor for no discernable reason - The logic is still present in dev-packages - Fixes #1130 Signed-off-by: Dan Ryan <[email protected]>
myproject = {path=".", editable=true}
.pipenv install
generates a Pipfile.lock withpipenv lock
now changes the Pipfile.lock to:Expected result
The Pipfile.lock shouldn't have changed.
Describe your environment
Pipenv version: 8.3.2
The text was updated successfully, but these errors were encountered: