Conditionally exclude dependencies

Fixes #547

@eddiemonge Are there are dependencies we could make conditional?