-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow direct urls in install_requires #6301
Comments
The restriction is nonsensical for setup.py, but not for dependency specification in general. So pip probably needs some indication when it should allow this (either by their backend or the user). Another possible way to draw the line is to allow this in pip, but disallow submitting this kind of distros to PyPI. |
The point of this issue is kind of to discuss if we can't have it on PyPI as well (it works with |
There is a security benefit. The actual restriction is that direct URLs cannot occur in the requires-dist metadata element. A wheel (or a project that uses a build backend other than setuptools) does not execute Also, even for setuptools-based source distributions, restricting direct URLs acts as a layered defense - you still need to review |
Anyone can publish anything on PyPI, so I would not consider this as trusted anyway? Only after you have verified the publisher you could trust a dependency, or am I missing something here. |
If you don't trust PyPI, then yes, you have to verify everything (or not use PyPI). But many people do have some level of trust in PyPI - for example, that the "requests" package cannot be suddenly hijacked by a malicious 3rd party. |
Yes, I agree that it adds some level of trust, especially long lived/known (or previously used) packages. However if you do not check the contents of |
The problem is that |
This is disallowed for security reasons; see pypa/pip#6301.
We are facing a similar issue at work. We cannot upload Python wheels with direct references in their metadata to a private index server on AzureDevOps using
|
These all seem like they are related specifically to policies on the index servers, unless I'm misunderstanding. Is there any pip command that fails due to direct URL usage in requirements? If so can we have a specific issue created for that with instructions for reproducing? |
No.
Exactly. We use the default Python index server provided by AzureDevOps pipelines. So we need to investigate if we can configure it for handling direct references in the |
Since this behavior is coming from pypa/warehouse, I will close the issue. If anyone coming up against this wants to see it changed, I would suggest creating an issue over at the Warehouse repository and linking back here. I couldn't find an existing issue, just the place where the change was introduced: #1013. If any change is required in pip to support this use case, then we can address it after confirmation that PyPI will start allowing direct references. |
What's the problem this feature will solve?
I want to put a package on PyPi which uses the new direct url syntax
pkg@git-repo-url
from PEP 508. Uploading to PyPi yieldsIt is stated here that this is for "security reasons", but as pointed out later in the thread, this seems nonsensical as
setup.py
could execute arbitrary code anyway. Are there any other security concerns I am missing?Describe the solution you'd like
Simply allow direct urls.
I have a package which depends on another package which I don't want to go through the trouble of uploading to PyPi as well. This dependency then breaks installing my package from PyPi.
The text was updated successfully, but these errors were encountered: