-
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
Poetry fails in CI/CD with ERROR: In --require-hashes mode, all requirements must have their versions pinned #3472
Comments
I am having the same issue. Not sure how to fix. |
@trishankatdatadog I had more time to investigate and while I haven't found any fixes I do think I have started narrowing down the problem space. I still can't rule out poetry for sure but it seems like it's a |
@shadycuz let me know what you find, because I gave up, would rather focus on my code right now |
I'm having the same problem. This is my log
I do have my hashes in
|
1. Why is it filed as a poetry issue? 2. Read pypa/pip#8792 (and probably some other pip tickets as well) |
Looks like you are all using the same pattern, but I am not sure I understand it and whether or not it makes sense. Would you mind walking me through it with a minimal reproducible example? My gut feeling is that it boils down to |
This is the smallest reproducible example I can find right now. Does this help? |
I'd prefer you walk me through the thinking process that lead you to using this pattern.
I have my answers for most of these questions, but they probably don't match yours. Point is: maybe there is a better alternative. |
Thanks for posting this. I was running my builds in CI/CD and did not have access to the contents of the exported file. It's great that we can confirm the hashes are present. |
All good questions. It very largely came from hypermodern Python. I'll dig deeper and see what broke. What's strange is that the nox setup works locally on my machine but not remotely on GitHub. As for hashes in requirements.txt, I can confirm that when I rerun the offending command on my machine, I see the hashes. |
I filed this as a
@trishankatdatadog and I both got the pattern from the excellent blog series Hypermodern Python. I'm not sure about @Corfucinas
To be honest I do it because the blog told me so. I didn't spend much time thinking about it. I know the blog has a companion repo. The companion repo seems to have evolved beyond what was instructed in the blog posts. It seems they found better ways to do things. I unfortunately didn't realize this until after following the now outdated blog posts. I can say that up until this issue I was extremely happy with my new development workflow compared to just using
If you have a fix I would be eager to test it, even if the fix is just changing how we install our development dependencies for This workflow still works fine locally. I'm guessing its something else that changed not related to |
@Corfucinas @trishankatdatadog Seems like this was already discussed and solved in the Hypermodern repo. |
@sinoroc Yes you linked directly to the issue =) with pip. |
I feel good enough about closing this now. The issue is with the change to how Workarounds:
|
@shadycuz Be careful with pinning too eagerly. I guess you all know that by now. :) I do not know if the message went through to you all, so I will repeat it here. From what I understood, the issue is triggered by having in the same
Both have their pros and cons. Altogether the integration between poetry and tox (nox) could be improved. I started a plug-in to attempt to fix this integration (tox-poetry-dev-dependencies), but it is only half way there. Anyway, looks like for now the best compromise for your use cases might be to export without hashes. Some things to look for in the future: |
Wanted to quickly chime in that |
This happened to me because of environment markers, I was running pip on a version of Python that didn't match the E.g. I have
When running that through pip on Python 3.6, no version of
Hopefully that helps somebody else. |
* hashes may be problematic with poetry - python-poetry/poetry#3472 - python-poetry/poetry#1879 (comment)
Workaround --without-hashes for python-poetry/poetry#3472
pypa/pip#9243 was reopened so I think this ticket should be reopened again. I ran into this same issue while trying to automatize one pipeline today. |
Reopening as the original fix has been reverted but is being tracked here pypa/pip#11019 |
What is this issue saying that poetry is doing wrong or should do differently? It's a long and confusing thread. Is #5537 relevant? That fixed an issue where |
To be fair @dimbleby , I dont know and I never knew or if I did know, I dont anymore ;) It's been referenced a lot and has had a lot of activity. I know that when pip changed something. Poetry went from working to not working. Then pip was fixed and it started working again. I think this issue was just to point people to a workaround and possible action from poetry maintainers if they needed to do something to poetry internals. I haven't had the problem reoccur but it's also a very complicated problem. With the next release of If contributors think this issue is no longer useful, we can close it again. That way people experiencing issues could create new issues with less chatter and hopefully, someone can describe their problem in a much more elegant way than I ever could. Special shoutout to Poetry and its contributors, who have made creating and maintaining python applications an enjoyable experience. I really feel bad for all the projects still using setup.py and requirements.txt files. |
I agree that lots of people seem to think that Something is Wrong, but no-one seems to have identified any relevant way in which poetry could be improved. In that context I don't see that an open issue here is doing any good - what should the maintainers to do with it? Indeed, if there's not a poetry problem: why should poetry maintainers do anything with it at all? (So far as being a pointer to a workaround goes: a closed issue works just as well as an open issue.) If you or anyone else can make the case that your error is attributable to poetry then please do: that would be very helpful. Otherwise I'd suggest that this is better closed. |
The problem with a closed issue is that it signals that the problem doesn't exist or was fixed. This current problem doesn't exist currently, but it will for sure soon. While I agree their doesn't seem to be much the poetry maintainers can do if it's a third-party issue, it is still relevant to the users of poetry who will encounter this issue and by default, the search on a repo does not look at closed issues. But I think its time to close this, as its long and convoluted and I dont remember any of the details of how to reproduce. |
I can reproduce this issue, but it's only related to the poetry export requirements.txt file and the specific use in nox (which was worked around by disabling security) This isn't something that can be fixed in peotry, but it could be something that peotry can provide a workaround for eg a new command like |
## [1.0.1](v1.0.0...v1.0.1) (2022-11-20) ### Bug Fixes * add __init__.py to git asset list ([fde2453](fde2453)) * add --without-hashes to fix python-poetry/poetry#3472 ([93ca1ec](93ca1ec)) * raise errors on build and test ([05d148c](05d148c))
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment)
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment) Update python interpreter to test.
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment) Update python interpreter to test.
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment) Update python interpreter to test.
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment) Update python interpreter to test.
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment) Update python interpreter to test. Remove python 3.6 support.
Update dependencies, update minimal python version to 3.6.1 Fix noxfile, generate constraint file using constraint format add `--without-hashes` option to be able to install dependencies, see: python-poetry/poetry#3472 (comment) Update python interpreter to test. Remove python 3.6 support.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).Issue
My builds were working fine locally and remotely. Here is an example of the first 12 or so lines...
I added a package with
poetry add cfn-flip
My builds still work locally but fail in github actions:
Since my builds still worked locally I thought it might be an issue with PyPi, so I waited a day, but they are still failing. Up above I have linked my PR so you should be able to see the changes to the toml and the lock file. I'm very unsure what to try next except maybe deleting the lock file and having poetry recreate it again.
Locally and in the CI/CD I'm running the same Nox and Poetry versions. I think this might be related to python-poetry/poetry-plugin-export#38 and possibly python-poetry/poetry-plugin-export#145 since both of those are about
poetry export
.The text was updated successfully, but these errors were encountered: