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

Make clear in PEP 503 that search is not supported. #6696

Closed
stephen-dexda opened this issue Jul 10, 2019 · 3 comments
Closed

Make clear in PEP 503 that search is not supported. #6696

stephen-dexda opened this issue Jul 10, 2019 · 3 comments
Labels
C: search 'pip search' state: needs discussion This needs some more discussion type: enhancement Improvements to functionality

Comments

@stephen-dexda
Copy link

Environment

  • pip version: 19.1.1
  • Python version: 3.7

Description
With a custom PEP 503 repo, pip search -i <repo-root> foo fails with:

ERROR: HTTP error 404 while getting <repo-root>RPC2
ERROR: Exception:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/search.py", line 48, in run
    pypi_hits = self.search(query, options)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/search.py", line 65, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/download.py", line 832, in request
    response.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
pip._vendor.requests.exceptions.HTTPError: 404 Client Error: Not Found for url: <repo-root>RPC2

(Similar failure if rooted at /simple/, except it tries to POST to /simple/ instead of /RPC2).

Per #5216 it seems that search doesn't just walk the root and/or subdirs (which might be assumed), and uses a non-PEP 503 mechanism instead.

Expected behavior
This is documented, so the obvious pip search is not used by someone trying to test their implementation ;)

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jul 10, 2019
@pradyunsg
Copy link
Member

Happy to accept a PR adding this information to pip search's reference.

@stephen-dexda
Copy link
Author

Ideally this would show up in the "pip search" error message if the user tried to search a custom repo and POSTing failed (along the lines of "if is a PEP 503 simple repo, search is not supported for that repo type"). The user may be unlikely to look in the search docs when presented with that error

@chrahunt chrahunt added C: search 'pip search' state: needs discussion This needs some more discussion type: enhancement Improvements to functionality labels Jul 20, 2019
@triage-new-issues triage-new-issues bot removed S: needs triage Issues/PRs that need to be triaged labels Jul 20, 2019
@pradyunsg
Copy link
Member

Closing this since there's been no movement on this in quite a while, and since pip search is no longer usable on PyPI: #5216

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: search 'pip search' state: needs discussion This needs some more discussion type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

3 participants