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

pipenv sync needs to be called twice to install all VCS dependencies #3327

Closed
ccaspers opened this issue Nov 29, 2018 · 6 comments
Closed

pipenv sync needs to be called twice to install all VCS dependencies #3327

ccaspers opened this issue Nov 29, 2018 · 6 comments
Labels
Category: Dependency Resolution Issue relates to dependency resolution. Category: VCS Relates to version control system dependencies. Type: Regression This issue is a regression of a previous behavior. Type: Release Blocker Must be resolved before the next release can be cut.

Comments

@ccaspers
Copy link

ccaspers commented Nov 29, 2018

Issue description

I have a project that uses few dependencies that I install from a private Gitlab instance.

Project A requires Library X in its setup.py and mentions it solely by name.
Project B requires Project A.
The Pipfile of Project B contains and editable VCS dependency to Project A and Library X. When running pipenv sync for the first time, the installation fails because Pipenv tries to resolve the dependencies from setup.py using pypi. After I execute pipenv sync the second time, everything is installed as expected.

This problem does not occur, when I run pipenv sync --sequential

Expected result

VCS dependencies get resolved and installed.

Actual result

Not all VCS dependencies get resolved and installed.

Excerpt from pipenv sync --verbose:

Collecting library-x (from project-a)
  1 location(s) to search for versions of library-x:
  * https://pypi.org/simple/library-x/
  Getting page https://pypi.org/simple/library-x/
  Looking up "https://pypi.org/simple/library-x/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  https://pypi.org:443 "GET /simple/library-x/ HTTP/1.1" 404 13
  Status code 404 not in (200, 203, 300, 301)
  Could not fetch URL https://pypi.org/simple/library-x/: 404 Client Error: Not Found for url: https://pypi.org/simple/library-x/ - skipping
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-u9fp4m0k'
Exception information:
Traceback (most recent call last):
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 164, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/index.py", line 621, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for library-x (from project-a)

Steps to replicate

$ pipenv --rm
$ pipenv sync
$ pipenv sync


Sorry in advance for not pasting my Pipfile and the output of pipenv --support. Both contain quite a lot of auth-tokens that I don't want to share and I am affraid to accidentally miss when redacting the output.

I might be able to recreate the problem with a few minimal github-repositories tomorrow.

@ccaspers
Copy link
Author

So far, I had no luck in reproducing the problem from scratch :/. Will try again later.

@techalchemy techalchemy added the Type: Regression This issue is a regression of a previous behavior. label Dec 4, 2018
@techalchemy
Copy link
Member

luckily I know for sure this is a regression that was released, ("luckily"), so no worries on reproducing. Thanks for the report

@techalchemy techalchemy added Category: Dependency Resolution Issue relates to dependency resolution. Category: VCS Relates to version control system dependencies. Type: Release Blocker Must be resolved before the next release can be cut. labels Dec 4, 2018
@techalchemy
Copy link
Member

I actually nailed this one down...

during the first pass at installation, pip attempts to build a wheel for this package before ultimately deleting the source.

the source gets deleted before it gets installed.

oops.

@ccaspers
Copy link
Author

Thanks for investigating :)

@techalchemy
Copy link
Member

I believe this is resolved as of #3298 -- closing for now, feel free to try that out and let me know if you have any issues

I will be cutting a release this week with the update, thanks for your patience!

@ccaspers
Copy link
Author

ccaspers commented Mar 6, 2019

I installed 54a73d1, ran pipenv sync and no errors occurred. Seems to be working fine. Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Dependency Resolution Issue relates to dependency resolution. Category: VCS Relates to version control system dependencies. Type: Regression This issue is a regression of a previous behavior. Type: Release Blocker Must be resolved before the next release can be cut.
Projects
None yet
Development

No branches or pull requests

2 participants