-
Notifications
You must be signed in to change notification settings - Fork 54
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 export
uses branch name for VCS dependencies rather than resolved commit hash
#35
Comments
I just created python-poetry/poetry-core#603 in poetry-core to make it easier to resolve this issue. |
@radoering Thanks for helping getting python-poetry/poetry-core#603 merged. I would now also like to update the poetry-plugin-export so that this new functionality is also available to the end user. However I would like to know what the best way to go is before implementing this. So what is better do you think?
Also is this issue considered a bug fix or the addition of a new feature? |
I would consider it a bugfix. Since
Both are valid options. The first one is less work, but requires a poetry-core (and poetry) release first. The second one allows to do it now but requires some cleanup later (when the required poetry-core version will be updated eventually). Do as you like. If we choose the second approach, I'd probably add a try-except and a comment that this can be removed after updating the required poetry-core version to a version that contains python-poetry/poetry-core#603. Further, we have to make a distinction in the test depending on the poetry-core version, which can be removed later. |
Ok, I made a pull request that already contains the necessary fix. I went for the approach by putting the required version in pyproject.toml by cheating a bit and using vcs dependencies for poetry and poetry-core. It passes all tests except for those on 3.7 which is not so strange since the most recent version of poetry dropped support for 3.7. One can try out this new functionality already by doing:
Although it is probably better to wait for an official release instead of using these kind of hacks. |
@radoering I updated the pr since poetry 1.6.0 has been released and it is now ready for review. |
@koffie I see that direct dependencies added in the toml file now are being translated from branch name to commit hash. However, I can not see the dependencies of dependencies do the same. Imagine this example:
I'm not able to share the repositories since they are private however I did my best to explain the problem. Is this a bug or do I need to do something? Python: 3.12.4 |
Did you check the content of the resulting
It looks like you posted the output of pip failing to resolve dependencies. However, since you have already resolved dependencies via poetry and exported all resolved dependencies (direct and transitive dependencies), it makes no sense to let pip resolve again. You should use |
I did, but I guess your second answer clarify the point
Ok will use this |
-vvv
option).Issue
Given the above
pyproject.toml
file,poetry export --without-hashes -o requirements.txt
will generate the following output:Relevant section of
poetry.lock
:Based on this, I would expect
requirements.txt
to contain the following:The text was updated successfully, but these errors were encountered: