Skip to content
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: include "via" information, like pip-compile #5580

Closed
2 tasks done
mitchhentges opened this issue May 9, 2022 · 4 comments
Closed
2 tasks done

Poetry export: include "via" information, like pip-compile #5580

mitchhentges opened this issue May 9, 2022 · 4 comments
Labels
kind/feature Feature requests/implementations

Comments

@mitchhentges
Copy link

mitchhentges commented May 9, 2022

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

When pip-compile creates a requirements.txt, it will include a "via" line for each requirement: this line defines the rationale for why the requirement was included, such as "via -r requirements.in" or "via requests"

poetry has access to this information, it would be cool if it could be propagated to the file created by poetry export.

Example from pip-compile:

#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
#    pip-compile
#
certifi==2021.10.8
    # via requests
charset-normalizer==2.0.12
    # via requests
idna==3.3
    # via requests
requests==2.27.1
    # via -r requirements.in
urllib3==1.26.9
    # via requests
@mitchhentges mitchhentges added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels May 9, 2022
@abn
Copy link
Member

abn commented May 9, 2022

@mitchhentges what exactly is the point of this? Shouldn't poetry show --tree or the proposed --why (#5444) solve the use case?

@mitchhentges
Copy link
Author

I'm trying to target the use case of people migrating away from pip-compile: I'm building a tool to ease that migration over here.

Essentially, its goal is to allow developers to continue interacting with a raw requirements.in and requirements.txt, but to inject poetry into the middle so that the requirements.txt has environment markers.

The bummer here (for this use case, specifically) is that poetry only keeps the "via" information in the poetry.lock, which is thrown out in the process described above (aside: the tool re-feeds the requirements.txt back through poetry to act as a lockfile, which allows developers to not have to store two lockfiles, in a sense).

@abn
Copy link
Member

abn commented May 10, 2022

@mitchhentges sounds like you are better off implementing a new format in the https://github.com/python-poetry/poetry-plugin-export project that is specific to pip-compile.

Alternatively, you can try creating a plugin of your own to handle that. Based on this being an esoteric use case, you might be better off implementing something separate.

Either way, I do not tihnk this is something that will be handled by the Poetry itself. I am going to close this now.

Copy link

github-actions bot commented Mar 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

3 participants