Viper: Vendorize dependencies

Created on 10 Aug 2016  Â·  8Comments  Â·  Source: spf13/viper

Please, configure the project to vendorize dependencies.

Most helpful comment

@awishformore it wouldn't do any harm if you can at least provide a glide.yaml file (for example) that lists the dependencies and their versions that you think work well with your library. This would help anybody who integrates viper into their project. You don't need to modify the import paths, they will still be "github.com/foo/bar" . But anybody who uses glide can then flatten out the libraries used by viper and fetch them in their vendor directory.

This would really help to have everybody work with supported version of viper's dependencies.

And if you don't want to vendor your dependencies, fine. You don't have to but a simply $ glide install will fetch them for you.

How can you claim your library is stable without having at least an idea which version of dependencies you're using? Defaulting to master branch doesn't sound like a good idea.

All 8 comments

I can recommend to use http://glide.sh for this.

Viper doesn't provide a binary–it's a library. Vendoring in libraries is discouraged. Therefore, if you use Viper, vendoring is _your responsibility_.

@moorereason One has to understand what's going on but it is not impossible to have vendored libraries: https://forum.golangbridge.org/t/vendoring-and-multiple-versions-of-the-same-library/2010

Adding vendoring in a library is indeed discouraged. You should vendor viper and its dependencies as part of your own project.

@awishformore it wouldn't do any harm if you can at least provide a glide.yaml file (for example) that lists the dependencies and their versions that you think work well with your library. This would help anybody who integrates viper into their project. You don't need to modify the import paths, they will still be "github.com/foo/bar" . But anybody who uses glide can then flatten out the libraries used by viper and fetch them in their vendor directory.

This would really help to have everybody work with supported version of viper's dependencies.

And if you don't want to vendor your dependencies, fine. You don't have to but a simply $ glide install will fetch them for you.

How can you claim your library is stable without having at least an idea which version of dependencies you're using? Defaulting to master branch doesn't sound like a good idea.

I think it is premature to close this, but is also a little early to fix.

We should wait and see what comes out of this:

https://groups.google.com/forum/#!topic/golang-dev/C0x8PeHsS8g

Glide may be fine for many, but is a too opinionated choice for a library.

I see the point, my apologies for closing this too hastily. Let's see what comes of this.

Peter Bourgon is heading the Go deps project and he says "libraries •must not• vendor their dependencies", so that should be it:

https://twitter.com/peterbourgon/status/794384491221397504

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hxzhao527 picture hxzhao527  Â·  5Comments

Giri4joyz picture Giri4joyz  Â·  3Comments

noandrea picture noandrea  Â·  4Comments

alfmos picture alfmos  Â·  3Comments

gmaxwell94 picture gmaxwell94  Â·  5Comments