-
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
Export fails after upgrading poetry to version 1.1.0 #3023
Comments
We've also noticed the same issue in all our builds 😭 |
Same. Also the error gets printed to stdout, which is piped to the requirements.txt output. I guess I'll open an issue about that (edit: #3025) |
Fascinating that many people seem to use |
Personally I use this as part of CI, to install a subset of the packages (export requirements.txt, then use it with I also use it for Docker builds. To use the cache effectively, you want to install dependencies first, then put your code in and install it. I believe the use cases are already tracked as #936 |
Sounds like the planned feature "dependency groups", correct? |
"Me too." My use case for export is that I need to pull dependencies for distribution for offline installs. So export combines with some |
I have raised a feature request (#3033) to handle installing specific packages. As for caching, docker build, I recommend you consider doing the following. FROM docker.io/python:3.8
RUN python -m pip install poetry
RUN python -m poetry config virtualenvs.in-project true
RUN install -d /opt/src
WORKDIR /opt/src
COPY poetry.lock pyproject.toml /opt/src/
RUN python -m poetry install --no-dev --no-root
COPY . /opt/src/
RUN python -m poetry install --no-dev
ENTRYPOINT ["python", "-m", "poetry", "run"]
CMD ["bash"] |
We really do appreciate that this is an issue. However, please do bear with us. The various variables to consider in how people are using poetry is sometimes hard to keep track of. Especially when we need to make critical changes to to the resolver to expand both reliability and supported scenarios. Again, thank you for using poetry, and providing detailed bug reports. |
Yes, this fixes the issue. Thank you, this saves me (and my team) quite a bit of manual intervention once released.
I absolutely understand this and sympathize. Also, I would've been fine with backwards compatibility breaking if poetry's new version number had semantically represented that (eg. 2.0.0). Things don't have to be backwards compatible forever. |
@iksteen this wasn't meant to be a breaking change. The export behavior should have remained as is, but the changes in the lockfile meant that we had to resolve all dependencies without evironment markers available. This forced the change in this logic, however we weren't able to test all cases thoroughly since this was patched after rc. So, if all had gone well this would have just worked with an old lock file. Hence why we didn't bump the major for this one. |
The fact that the new lock files can't be read by the old Poetry is the breaking change. |
I run poetry in Github actions, and run Tried to run If anyone else hits this issue for poetry 1.1: only thing that helped was to revert back to 1.0.10. |
@klintan can ypu provide a sample |
Is there documentation on how one might test #3024? It seems that, to set up Poetry for development, I need a working Poetry already? Am I reading the contributing guide correctly? |
I can confirm that it does work for me (poetry |
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
After upgrading poetry from 1.0.0 to 1.1.0,
poetry export -frequirements.txt
results in the following exception when using apoetry.lock
file created by an earlier version: https://gist.github.com/iksteen/bd4fd24e2b79e0f0644461fe501297d4Running
poetry lock
using poetry 1.1.0 fixes the problem.While not a huge issue, this currently frustrates our CI strategy as we have an assumption there that installing
poetry>=1.0,<2.0
would be sufficient to guard against incompatibilities of poetry updates. Currently we have quite a few PRs on several projects that suddenly won't build in the CI anymore.While this seems similar to #3018, the conditions under which this occurs differ significantly (#3018 is also triggered after running
poetry lock
).The text was updated successfully, but these errors were encountered: