easy-install.pth contains incomplete number of paths for editable = true packages.
Describe your environment
- OS Type: Debian Stable 9.2
- Python version: Python 2.7.13
- Pipenv version: pipenv, version 8.3.2
Expected result
When running pipenv install with a Pipfile containing 15 local editable packages:
pyramid-mustache = {path = "vendor/pyramid-mustache/", editable = true}
Dalton = {path = "vendor/Dalton/", editable = true}
pyelasticsearch = {path = "vendor/pyelasticsearch/", editable = true}
deus_lib = {path = "deus_lib/", editable = true}
lexdb = {path = "lexdb/", editable = true}
bias = {path = "bias/", editable = true}
winslow = {path = "winslow/", editable = true}
usertool = {path = "usertool/", editable = true}
analytics_services = {path = "analytics_services/", editable = true}
citadel = {path = "citadel/", editable = true}
lex-nlp-scripts = {path = "lexnlp-product/core/scripts/", editable = true}
dashboarding = {path = "dashboarding/", editable = true}
east = {path = "east/", editable = true}
webhook_handler = {path = "webhook_handler/", editable = true}
qatool = {path = "qatool/", editable = true}
I expect 15 entries in easy-install.pth.
Actual result
I get 13, 11, etc, and each time you run it you get a different set of local pth entries.
No changes to Pipfile or to Pipfile.lock, just rerunning pipenv install
Examples:
/home/gavin/LexMachina/src/deus_lex/vendor/Dalton
/home/gavin/LexMachina/src/deus_lex/east
/home/gavin/LexMachina/src/deus_lex/vendor/pyramid-mustache
/home/gavin/LexMachina/src/deus_lex/citadel
/home/gavin/LexMachina/src/deus_lex/vendor/pyelasticsearch
/home/gavin/LexMachina/src/deus_lex/webhook_handler
/home/gavin/LexMachina/src/deus_lex/usertool
/home/gavin/LexMachina/src/deus_lex/analytics_services
/home/gavin/LexMachina/src/deus_lex/lexdb
/home/gavin/LexMachina/src/deus_lex/deus_lib
/home/gavin/LexMachina/src/deus_lex/winslow
/home/gavin/LexMachina/src/deus_lex/lexnlp-product/core/scripts
/home/gavin/LexMachina/src/deus_lex/qatool
/home/gavin/LexMachina/src/deus_lex/webhook_handler
/home/gavin/LexMachina/src/deus_lex/vendor/Dalton
/home/gavin/LexMachina/src/deus_lex/east
/home/gavin/LexMachina/src/deus_lex/dashboarding
/home/gavin/LexMachina/src/deus_lex/vendor/pyramid-mustache
/home/gavin/LexMachina/src/deus_lex/citadel
/home/gavin/LexMachina/src/deus_lex/bias
/home/gavin/LexMachina/src/deus_lex/usertool
/home/gavin/LexMachina/src/deus_lex/lexdb
/home/gavin/LexMachina/src/deus_lex/analytics_services
/home/gavin/LexMachina/src/deus_lex/winslow
/home/gavin/LexMachina/src/deus_lex/lexnlp-product/core/scripts
/home/gavin/LexMachina/src/deus_lex/qatool
/home/gavin/LexMachina/src/deus_lex/vendor/pyelasticsearch
Steps to replicate
Sadly I have no idea how to make a smaller test case as I have 0 idea what is going on. Happy to try and create one if someone can give me some hint as to how the heck this is even possible.
@gcarothers I would be willing to bet this is related to how pipenv used to handle local path installations... I'm fairly confident it was fixed in #958 and will be working in master. Can you install pipenv from master and see if it works?
@techalchemy giving that shot, removing lock file before reinstalling as well.
Nope, each run of pipenv install still produces a different set of lines in easy-install.pth, I should note that it changes a few times while the install is running too :D
(deus_lex-hgZwqY0d) ~/L/s/deus_lex (cleanup/requirements-to-pipenv|✚2…) $ sort /home/gavin/.local/share/virtualenvs/deus_lex-hgZwqY0d/local/lib/python2.7/site-packages/easy-install.pth
/home/gavin/LexMachina/src/deus_lex/analytics_services
/home/gavin/LexMachina/src/deus_lex/bias
/home/gavin/LexMachina/src/deus_lex/citadel
/home/gavin/LexMachina/src/deus_lex/dashboarding
/home/gavin/LexMachina/src/deus_lex/deus_lib
/home/gavin/LexMachina/src/deus_lex/east
/home/gavin/LexMachina/src/deus_lex/lexdb
/home/gavin/LexMachina/src/deus_lex/lexnlp-product/core/scripts
/home/gavin/LexMachina/src/deus_lex/qatool
/home/gavin/LexMachina/src/deus_lex/usertool
/home/gavin/LexMachina/src/deus_lex/vendor/Dalton
/home/gavin/LexMachina/src/deus_lex/vendor/pyelasticsearch
/home/gavin/LexMachina/src/deus_lex/vendor/pyramid-mustache
/home/gavin/LexMachina/src/deus_lex/winslow
vs.
(deus_lex-hgZwqY0d) ~/L/s/deus_lex (cleanup/requirements-to-pipenv|✚2…) $ sort /home/gavin/.local/share/virtualenvs/deus_lex-hgZwqY0d/local/lib/python2.7/site-packages/easy-install.pth
/home/gavin/LexMachina/src/deus_lex/analytics_services
/home/gavin/LexMachina/src/deus_lex/bias
/home/gavin/LexMachina/src/deus_lex/deus_lib
/home/gavin/LexMachina/src/deus_lex/lexdb
/home/gavin/LexMachina/src/deus_lex/lexnlp-product/core/scripts
/home/gavin/LexMachina/src/deus_lex/qatool
/home/gavin/LexMachina/src/deus_lex/usertool
/home/gavin/LexMachina/src/deus_lex/webhook_handler
/home/gavin/LexMachina/src/deus_lex/winslow
hrm, may not have the version from master, hard to tell given master is 8.3.2 as well ;) pip seems to think it replaced it.
~/L/s/d/deus_lib (cleanup/requirements-to-pipenv|✚2…) $ pip install --user --upgrade https://github.com/kennethreitz/pipenv/archive/master.zip
Collecting https://github.com/kennethreitz/pipenv/archive/master.zip
Downloading https://github.com/kennethreitz/pipenv/archive/master.zip (7.1MB)
100% |████████████████████████████████| 7.1MB 236kB/s
Requirement already up-to-date: virtualenv in /home/gavin/.local/lib/python2.7/site-packages (from pipenv==8.3.2)
Requirement already up-to-date: pew>=0.1.26 in /home/gavin/.local/lib/python2.7/site-packages (from pipenv==8.3.2)
Requirement already up-to-date: pip>=9.0.1 in /home/gavin/.local/lib/python2.7/site-packages (from pipenv==8.3.2)
Requirement already up-to-date: requests>2.18.0 in /home/gavin/.local/lib/python2.7/site-packages (from pipenv==8.3.2)
Requirement already up-to-date: flake8>=3.0.0 in /home/gavin/.local/lib/python2.7/site-packages (from pipenv==8.3.2)
Requirement already up-to-date: urllib3>=1.21.1 in /home/gavin/.local/lib/python2.7/site-packages (from pipenv==8.3.2)
Requirement already up-to-date: pathlib; python_version == "2.7" in /home/gavin/.local/lib/python2.7/site-packages (from pew>=0.1.26->pipenv==8.3.2)
Requirement already up-to-date: virtualenv-clone>=0.2.5 in /home/gavin/.local/lib/python2.7/site-packages (from pew>=0.1.26->pipenv==8.3.2)
Requirement already up-to-date: shutilwhich; python_version == "2.7" in /home/gavin/.local/lib/python2.7/site-packages (from pew>=0.1.26->pipenv==8.3.2)
Requirement already up-to-date: backports.shutil-get-terminal-size; python_version == "2.7" in /home/gavin/.local/lib/python2.7/site-packages (from pew>=0.1.26->pipenv==8.3.2)
Requirement already up-to-date: setuptools>=17.1 in /home/gavin/.local/lib/python2.7/site-packages (from pew>=0.1.26->pipenv==8.3.2)
Requirement already up-to-date: idna<2.7,>=2.5 in /home/gavin/.local/lib/python2.7/site-packages (from requests>2.18.0->pipenv==8.3.2)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /home/gavin/.local/lib/python2.7/site-packages (from requests>2.18.0->pipenv==8.3.2)
Requirement already up-to-date: certifi>=2017.4.17 in /home/gavin/.local/lib/python2.7/site-packages (from requests>2.18.0->pipenv==8.3.2)
Requirement already up-to-date: mccabe<0.7.0,>=0.6.0 in /home/gavin/.local/lib/python2.7/site-packages (from flake8>=3.0.0->pipenv==8.3.2)
Requirement already up-to-date: enum34; python_version < "3.4" in /home/gavin/.local/lib/python2.7/site-packages (from flake8>=3.0.0->pipenv==8.3.2)
Requirement already up-to-date: configparser; python_version < "3.2" in /home/gavin/.local/lib/python2.7/site-packages (from flake8>=3.0.0->pipenv==8.3.2)
Requirement already up-to-date: pycodestyle<2.4.0,>=2.0.0 in /home/gavin/.local/lib/python2.7/site-packages (from flake8>=3.0.0->pipenv==8.3.2)
Requirement already up-to-date: pyflakes<1.7.0,>=1.5.0 in /home/gavin/.local/lib/python2.7/site-packages (from flake8>=3.0.0->pipenv==8.3.2)
Installing collected packages: pipenv
Found existing installation: pipenv 8.3.2
Uninstalling pipenv-8.3.2:
Successfully uninstalled pipenv-8.3.2
Running setup.py install for pipenv ... done
Successfully installed pipenv-8.3.2
@gcarothers did you run pipenv --rm before each install? If it's still generating separately, try pipenv install --sequential?
--sequential does seem to correctly generate all 15 entries!
So this is the same race condition we've discusssd previously. I thought we had a patch merged that forced editable installs to be always done sequentially.
We should look into that and if it was regressed/never worked. I don't have the issue numbers off hand but will try to dig them up tonight.
#919 I think and patch https://github.com/jsatt/pipenv/commit/7c831342f9e6f10d4e55b1ba6cd1573c6bd805e2 ?
@gcarothers that was the original patch which I believe was reverted because it didn't actually do what we wanted.
I thought this was resolved in 8.3.1 but perhaps we prematurely reverted the #919 fix. We need to determine why we're not blocking in this case.
@nateprewitt I helped work on the sequential code, I'll try and find the relevant info tonight.
@nateprewitt the patch in question only attempted to block for VCS dependencies, I think it's simple enough to tack on editable ones as well