-
Notifications
You must be signed in to change notification settings - Fork 2.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
Disable hashes for requirements.txt if a VCS dependency is encountered #3874
Conversation
Something is wrong, it's not actually outputting the requirements.txt file. |
This would improve the situation w.r.t. moneymeets/python-poetry-buildpack#19, but is disabling hashes completely actually a good idea? Why to omit hashes only for VCS dependencies? |
Because pip is dumb. You either have hashes for all packages or none of them, you can't mix it. |
I forgot to unmark this as a draft. I've rebased the PR to fix the merge conflict, should be ready for review/merging now. |
Hi @nyuszika7h, is this still a live issue/PR? |
Yes, it is still relevant. Sorry for the late reply. |
I've rebased the branch to be compatible with the latest changes. |
@nyuszika7h It's probably worth |
AFAIK, maintainers are @finswimmer and @abn , so maybe the could voice their opinion? I’m personally -1 on automatically enabling There have been some discussions in the related pip bug however in the last few weeks: It seems that the maintainers would be happy to accept a per-requirement opt out as the first step towards solving this problem. Maybe if you have time @nyuszika7h you could try to solve the problem at the pip side first? |
Trust me, it's not going to get fixed in pip anytime soon. pypa/pip#4995 has been open since 2018 and pypa/pip#6469 since 2019. Their stance basically seems to be "Poetry or whoever needs this should fix it themselves". I specifically coded this PR to explicitly warn about hashes being disabled in such cases, so it should not reduce security in most cases, unless it's run as part of an automated script and log output is not reviewed. I'd be slightly less happier but also OK with the alternative of simply refusing to generate a requirements.txt in such cases unless |
@nyuszika7h maybe I’m being too optimistic since I didn’t ever have to work with pip maintainers, but they explicitly said on multiple occasions the PRs addressing the problem will be reviewed and accepted, and no such PRs seemed to happen… so yeah, the issues have been open for a very long time, but I didn’t get an impression that they are blocking people, rather nobody seems to be interested enough to try to fix it. |
The problem is that there isn't a clear-cut solution to it. Should pip support hashing VCS dependencies somehow, or ignore the lack of hashes unless It seems to me like this behavior isn't necessarily considered a bug by pip maintainers, even though they'd be potentially open to changing it. I would still argue that until it is resolved, Poetry should stop producing invalid requirements.txt files one way or another (whether that is the current proposed patch or aborting if VCS dependencies are encountered and |
Yes, the 100% solution is to teach pip how to hash VCS requirements, but this is complicated and I think there is no consensus how to proceed with that. However, in pypa/pip#6469 it was proposed to first add
I agree with you that producing broken |
Closing this as the code has moved into https://github.com/python-poetry/poetry-plugin-export -- please discuss/PR this over there. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Resolves: python-poetry/poetry-plugin-export#69