weberc2 / builder

Prototype build tool
0 stars 0 forks source link

Pypi dependencies should be runtime-only? #22

Open ns-cweber opened 5 years ago

ns-cweber commented 5 years ago

Pypi libraries have a dependencies field that takes a list of dependencies. These are only needed at runtime ("build"ing a pypi dependency is just downloading the wheel--don't need deps to download the wheel), but they are treated as build-time dependencies by builder. This is by builder's design--it doesn't allow targets to distinguish between build- and run-time dependencies; it assumes all dependencies are both. The consequence is that updates to a deep dependency will trigger rebuilds (which is mostly "redownloads" for Pypi libraries). Since pip seems to do a good job of caching, this doesn't seem like a big problem in practice, but if there is some downstream target that does have an expensive build step which depends on these (at runtime, but not at build time), it will have to be rebuilt--for now, this is purely hypothetical.

The runtime dependencies aren't necessary until we hit some target that bundles the runtime dependencies into a single payload (e.g., virtualenv or pex). This target will need to be able to distinguish between runtime dependencies and build dependencies so that it doesn't package a bunch of build dependencies into the final package.

Incomplete list/analysis of solutions: