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

Export poetry dependencies without python_version interval #191

Open
2 tasks done
brunolnetto opened this issue Apr 1, 2023 · 10 comments
Open
2 tasks done

Export poetry dependencies without python_version interval #191

brunolnetto opened this issue Apr 1, 2023 · 10 comments

Comments

@brunolnetto
Copy link

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

Feature Request

I have been looking for a way to export my project dependencies. I know there is the command poetry export with its flags, which performs what I am looking for. However, I added additionally the flags --without-hashes and --without-urls to turn it less verbose than before.

On the conventional exporting way with pip freeze, the format corresponds to package_name==package_version. I can perform this same pattern on Linux with the command below, but it would be great to have an additional flag --without-pyversion

poetry export --without-hashes --without-urls | awk '{ print $1 }' FS=';'

@dimbleby
Copy link
Contributor

dimbleby commented Apr 1, 2023

this issue belongs in https://github.com/python-poetry/poetry-plugin-export/, not here

however I expect the answer should be "no": poetry makes you declare the range of python versions that you support and the export faithfully reflects that.

Also simply removing the python version markers indiscriminately is definitely wrong: what if some project uses foo==1.0.0 for python versions 3.7 and 3.8, but foo==2.0 for python versions 3.9 and higher?

@brunolnetto
Copy link
Author

I do not think it is "black" on this right-wrong categorization, but certainly, there is this pathway in which pip resolves dependencies for itself.

However, I do agree with your remark that poetry brings fresh air akin to this gray-and-fuzzy feature in package management.

@Secrus Secrus transferred this issue from python-poetry/poetry Apr 2, 2023
@annie-maria
Copy link

annie-maria commented Oct 2, 2023

I disagree with trying to force the programmer to accept one way of doing requirements.txt. The package should enable the programmer to reach the result they want, not dictate the format of a script and try to unnecessarily force the programmer to accept all of its commands and idiosyncrasies.

People who need a requirements.txt file without the python_version string are going to figure it out on their own regardless, but wouldn't it be much better for the package itself to have that as an inbuilt option.

Thank you brunolnetto.
poetry export --without-hashes --without-urls | awk '{ print $1 }' FS=';' > requirements.txt

@brunolnetto
Copy link
Author

@annie-maria this: https://www.youtube.com/watch?v=dQGrvCAmt-A

@david1542
Copy link

@annie-maria Thank you for sharing the command. I also had to remove the strict python_full_version marker since I work in GCP App Engine standard environment and there are few options for a python environment.

I think a --without-markers flag can be a nice addition.

@dnnane
Copy link

dnnane commented Apr 5, 2024

I come here after wasting some hours trying to figure out why my Cloud Function deployment wasn't working. It turns out that Google has a taste for plain requirements.txt .

Thank you @brunolnetto

@dereisele
Copy link

I had the exact same problem with windmill. Their pip installer is very picky, too windmill-labs/windmill#4376

@dimbleby
Copy link
Contributor

entertainingly the most recent comment in support of this arrived near enough simultaneously with a demonstration of why it is the wrong thing to do #28 (comment)

@brunolnetto
Copy link
Author

Mixed opinions. To be in control is as desired as to rely on automatic actions. Faith and Science eternal battle.

@dereisele
Copy link

What about specifying the target Python version in the export? Then the export is correct and no conditionals for the python version are needed. I just want to use sane dependency pinning where the build-in dependency installer does silly things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants