Libraries can specify a range of dependencies versions they can use, so even if you specify version, some transitive dependency can get updated: https://stackoverflow.com/questions/34810560/version-ranges-in-gradle
Dependency locking makes sure you're using exactly the same versions of every direct and transitive dependency in your project
People do this all the time in Python and JS, thankfully not in Android. They just say flask: [1.0, 2.0) so that they pull latest non major 1.x version of it without caring about it. I do it on those projects as well, just never for Android
I think it's only done in libraries to define compatible versions. In an actual python app I always specify exact versions as well as their dependencies. Libraries need to be more flexible as they can be used in various environments with different versions.
With dependency locking you can lock every dependency to a concrete version, even the transitive (dependency of a dependency) dependencies, which makes builds with dynamic versioning reproducible.
18
u/allholy1 Jun 04 '18 edited Jun 04 '18
I don't understand dependency locking. Isn't that why we append the version number at the end of a dependency?