This repository was archived by the owner on Oct 24, 2025. It is now read-only.
No longer sort generated requriements.txt file#481
Closed
AndrewFarley wants to merge 3 commits intoserverless:masterfrom
Closed
No longer sort generated requriements.txt file#481AndrewFarley wants to merge 3 commits intoserverless:masterfrom
AndrewFarley wants to merge 3 commits intoserverless:masterfrom
Conversation
Contributor
Author
|
So idk, these tests pass locally for me... I'm bumping the CI to re-trigger it to see if that helps, if not I'll try to dig a little deeper. |
Contributor
Author
|
Waiting for CI to be fixed by @bsamuel-ui in #482 then will rebase |
|
any thoughts about resurrecting this PR? |
Contributor
|
Hey @AndrewFarley - it's been a long time since this PR was proposed. I'm going to close it, if you feel like the issue is valid, please open a new issue or a new PR against the latest main branch. Thanks 🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
I removed the "feature" that sorts the contents of the requirements.txt file before running pip install
Reasoning
This is a long-time coming. This feature which I originally thought was quite novel was also met with a lot of problems after merging from the general public. I added this feature when I added the ability for this plugin to cache the requirements locally to prevent unnecessary re-building of requirements when the requirements.txt file did not change. At the time, I was managing roughly 5 different serverless codebases which uses the same dependencies but their requirements.txt files differed because of some dev/internal/local/nodeploy dependencies. To solve this problem I cleansed and sorted the requirements.txt file. Unfortunately, this inevitably had a LOT of issues because of edge cases I was not aware of when I first implemented it the biggest of which is that pip resolves circular dependencies by having the first package taking priority.
Result
Because of this, and this new knowledge I firmly believe we must preserve the order of the files inside the requirements.txt file, even at the risk of a bit less of a cache-hit.
Related to and/or would have prevented:
#427
#294
#238