(no title)
athrun | 1 year ago
To be clear, a lock file is strictly the better option—but for single file scripts it's a bit overkill.
athrun | 1 year ago
To be clear, a lock file is strictly the better option—but for single file scripts it's a bit overkill.
EdwardDiego|1 year ago
Use a lock file if you want transitive dependencies pinned.
I can't think of any other language where "I want my script to use dependencies from the Internet, pinned to precise versions" is a thing.
hannibalhorn|1 year ago
The use case described is for a small one off script for use in CI, or a single file script you send off to a colleague over Slack. Very, very common scenario for many of us. If your script depends on
You can pin versions of those direct dependencies like "a" and "b" easy enough, but 2 years later you may not get the same version of "c", unless the authors of "a" and "b" handle their dependency constraints perfectly. In practice that's really hard and never happens.The timestamp appraoch described above isn't perfect, but would result in the same dep graph, and results, 99% of the time..
kokada|1 year ago
One file is better for sharing than N, you can post it in a messenger program like Slack and easily copy-and-paste (while this becomes annoying with more than one file), or upload this somewhere without needing to compress, etc.
> I can't think of any other language where "I want my script to use dependencies from the Internet, pinned to precise versions" is a thing.
This is the same issue you would have in any other programming language. If it is fine for possibly having breakage in the future you don't need to do it, but I can understand the use case for it.
epistasis|1 year ago
Documentation is hard enough, and that's often right there at exactly the same location.
deanishe|1 year ago
Because this is for scripts in ~/bin, not projects.
They need to be self-contained.
lenkite|1 year ago
Sometimes, the lock files can be larger than the scripts themselves...
einpoklum|1 year ago
froh|1 year ago
fluidcruft|1 year ago
woodruffw|1 year ago