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

--exists-action's w flag, is interpretted as a request for a package called w when using pipenv install -e "." #2326

Closed
manihamidi opened this issue Jun 7, 2018 · 7 comments
Assignees
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug.

Comments

@manihamidi
Copy link

manihamidi commented Jun 7, 2018

Been using pipenv for months, never ran into this before:

run pipenv install -e "." seems to result in the request/collection of some random package called w (Wallace!!) that's on pypi!!!!

As far as I can tell the reason why it searches for "w" is the --exists-action option in core.py (line 1488).

(it doesn't help that the authors of Wallace attempt to open a requirements.txt file in their setup.py)

Verbose output:
(ubuntu 18.04, python 2.7.15, pip 10.0.1, pipenv 2018-05-18)

mani@host:~/code/ReportCreator(hotfix/v2.6.3)$pipenv install -e "." -v
Installing -e .…
⠋Installing '-e .'
$ "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/bin/pip" install   --verbose    -e "." -i https://pypi.org/simple --extra-index-url ${PIP_EXTRA_INDEX_URL} --exists-action w
Created temporary directory: /tmp/pip-ephem-wheel-cache-xspLxQ
Created temporary directory: /tmp/pip-install-RJPkTE
Looking in indexes: https://pypi.org/simple, https://my.private.pypi.io/secret/index/, --exists-action
Obtaining file:///home/mani/code/ReportCreator
  Running setup.py (path:/home/mani/code/ReportCreator/setup.py) egg_info for package from file:///home/mani/code/ReportCreator
    Running command python setup.py egg_info
    running egg_info
    writing requirements to abcreporter.egg-info/requires.txt
    writing abcreporter.egg-info/PKG-INFO
    writing top-level names to abcreporter.egg-info/top_level.txt
    writing dependency_links to abcreporter.egg-info/dependency_links.txt
    reading manifest file 'abcreporter.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'abcreporter.egg-info/SOURCES.txt'
  Source in /home/mani/code/ReportCreator has version 2.6.3, which satisfies requirement abcreporter==2.6.3 from file:///home/mani/code/ReportCreator
Collecting w
  2 location(s) to search for versions of w:
  * https://pypi.org/simple/w/
  * https://my.private.pypi.io/secret/index/w/
  Getting page https://pypi.org/simple/w/
  Looking up "https://pypi.org/simple/w/" in the cache
  Current age based on date: 1055
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  Starting new HTTPS connection (1): pypi.org
  https://pypi.org:443 "GET /simple/w/ HTTP/1.1" 304 0
  Analyzing links from page https://pypi.org/simple/w/
    Found link https://files.pythonhosted.org/packages/0d/6f/613f18ccb1fc24d007b72c8215bcf49c445adb720a9d1621ccdf86cf9265/w-0.11.1.tar.gz#sha256=3c9f0bcea99476294aa87092cb6c71a98538a8b1a55203be586378a02394821b (from https://pypi.org/simple/w/), version: 0.11.1
  Getting page https://my.private.pypi.io/secret/index/w/
  Looking up "https://my.private.pypi.io/secret/index/w/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): dl.cloudsmith.io
  https://dl.cloudsmith.io:443 "GET /my.private.pypi.io/secret/index/w/ HTTP/1.1" 404 None
  Status code 404 not in (200, 203, 300, 301)
  Could not fetch URL https://my.private.pypi.io/secret/index/w/: 404 Client Error: Not Found for url: https://my.private.pypi.io/secret/index/w/ - skipping
  Using version 0.11.1 (newest of versions: 0.11.1)
  Created temporary directory: /tmp/pip-unpack-bDSjkY
  Looking up "https://files.pythonhosted.org/packages/0d/6f/613f18ccb1fc24d007b72c8215bcf49c445adb720a9d1621ccdf86cf9265/w-0.11.1.tar.gz" in the cache
  Ignoring unknown cache-control directive: 
  Current age based on date: 6901
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 6901
  Using cached https://files.pythonhosted.org/packages/0d/6f/613f18ccb1fc24d007b72c8215bcf49c445adb720a9d1621ccdf86cf9265/w-0.11.1.tar.gz
  Downloading from URL https://files.pythonhosted.org/packages/0d/6f/613f18ccb1fc24d007b72c8215bcf49c445adb720a9d1621ccdf86cf9265/w-0.11.1.tar.gz#sha256=3c9f0bcea99476294aa87092cb6c71a98538a8b1a55203be586378a02394821b (from https://pypi.org/simple/w/)
  Running setup.py (path:/tmp/pip-install-RJPkTE/w/setup.py) egg_info for package w
    Running command python setup.py egg_info
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-RJPkTE/w/setup.py", line 27, in <module>
        with open('requirements.txt') as f:
    IOError: [Errno 2] No such file or directory: 'requirements.txt'
Cleaning up...
  Removing source in /tmp/pip-install-RJPkTE/w
Exception information:
Traceback (most recent call last):
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 291, in run
    resolver.resolve(requirement_set)
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/resolve.py", line 257, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
    self.require_hashes
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 324, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 154, in prep_for_dist
    self.req.run_egg_info()
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 486, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/mani/.local/share/virtualenvs/ReportCreator-PmaoAZkd/local/lib/python2.7/site-packages/pip/_internal/utils/misc.py", line 698, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-RJPkTE/w/

Error:  An error occurred while installing -e .!
  Url '--exists-action/w/' is ignored. It is either a non-existing path or lacks a specific scheme.
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-RJPkTE/w/

This is likely caused by a bug in -e .. Report this to its maintainers.
@techalchemy
Copy link
Member

Sorry for the confusing issue. The exists-action should probably be moved to an environment variable, but in the meantime, don't surround the . with quotes. Better parsing for this has also made it into the master branch already, so I think this is probably handled.

Thanks for reporting!

@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Category: VCS Relates to version control system dependencies. labels Jun 7, 2018
@techalchemy techalchemy self-assigned this Jun 7, 2018
@techalchemy
Copy link
Member

related: #2279 (another reason to implement this)

@manihamidi
Copy link
Author

thanks @techalchemy , but I tried with and without quotation marks already and no dice! :(

@techalchemy
Copy link
Member

Oh boy that’s very odd. And if you leave out the -v as well?

@manihamidi
Copy link
Author

manihamidi commented Jun 7, 2018

yeah, sorry 😞 removed -v and still no dice...

@manihamidi
Copy link
Author

@techalchemy what is bizarre is that it has no problems whatsoever, when i try to install the same package from a DIFFERENT directory, e.g. when I make a directory ~/elsewhere/ and do pipenv install -e ~/code/mani/ReportCreator it succesfully installs it with all its dependencies.

I tried pipenv install -e ~/code/mani/ReportCreator from that directory itself as well, but didn't work!!???

@manihamidi
Copy link
Author

manihamidi commented Jun 8, 2018

@techalchemy I think I found the problem.. I only get the error when I replace the url for our private [[source]] with url = "${PIP_EXTRA_INDEX_URL}". Changing this to url = "https://private.pypyi/${MY_KEY}/index/" seems to solve the problem.

Not sure why, but thank god I can finally move on! Thanks for your help.
🎺

techalchemy added a commit that referenced this issue Jul 18, 2018
- Fixes #2326

Signed-off-by: Dan Ryan <dan@danryan.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants