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

Cross platform requirements.txt export (or closer to it) #1476

Closed
gazpachoking opened this issue Oct 31, 2022 · 5 comments
Closed

Cross platform requirements.txt export (or closer to it) #1476

gazpachoking opened this issue Oct 31, 2022 · 5 comments
Labels
⭐ enhancement Improvements for existing features

Comments

@gazpachoking
Copy link
Contributor

Is your feature request related to a problem? Please describe.

To help our users not using pdm, it would be nice to also provide a requirements.txt for easier installation of pinned dependencies that works on multiple platforms.

Describe the solution you'd like

Environment markers are carried over from the lock file into requirements.txt created by the export command.

I see this was purposefully removed in 21ebacc as a result of #843, but I was wondering the motivation behind that? Is it because we don't have the extra logic to combine environment markers if multiple dependencies declare the same transitive dependency with different environment markers? Not a showstopper if that logic complicated to implement, but wanted to bring up the question.

@gazpachoking gazpachoking added the ⭐ enhancement Improvements for existing features label Oct 31, 2022
@frostming
Copy link
Collaborator

frostming commented Oct 31, 2022

Environment marker merging was proved unsustainable and error-prone. I couldn't point to the exact issue right now but it was due to a package, each dependency of it and each dependency of its dependencies have a unique set of environment markers, with marker merging we ended up with a requirement string with more than 1000 characters long, and packaging refuses to parse them. So we decided to switch to install-time resolution, which means the lock file isn't pure-static, and still needs an extra resolution step to get the package set.

@gazpachoking
Copy link
Contributor Author

Yeah, I suspected something like that might be the case. Thanks for the info!

@gazpachoking gazpachoking closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
@gazpachoking
Copy link
Contributor Author

Hmm. I guess the locked requirements I'm outputting in the pdm-buildlocked plugin here will have the same flaw then? https://github.com/gazpachoking/pdm-buildlocked/blob/master/build_locked.py#L32-L47

@frostming
Copy link
Collaborator

Hmm. I guess the locked requirements I'm outputting in the pdm-buildlocked plugin here will have the same flaw then? https://github.com/gazpachoking/pdm-buildlocked/blob/master/build_locked.py#L32-L47

Yes I think so, if your dependencies have environment markers.

@gazpachoking
Copy link
Contributor Author

I took a peek at what poetry is doing, and... it seems pretty complicated. They seem to be combining and trying to simplify the combined marker constraints so that they don't keep growing. https://github.com/python-poetry/poetry-core/blob/3905d3e3baba4048ea3d4ed8d777f48bc87b8ca3/src/poetry/core/version/markers.py

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

No branches or pull requests

2 participants