-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional dependencies #682
Conversation
this is already planned for the 3.0 branch. as this is a breaking change it'll need to be held off until 3.0. |
oh wait, i didn't realize the default still installs these. give me a day or so to consider this patch, i'd like some more feedback. |
yes, exactly. the default behavior is just like before, unless you install the library with |
This works in the same way as required() but does not throw errors if the module was not found.
Ignore the tests folder when packaging and publishing. The tests folder is only used during development and doesn't have to be packaged in the final tarball. This reduces the package size by another 148 kB.
rebased the commits on top of the current master to take advantage of Travis CI checking |
as you can see in https://api.travis-ci.org/jobs/12582058/log.txt?deansi=true only the required dependencies are getting installed when using |
@mikeal please let me know if you have any more questions about this |
I know this has already been fixed but 👍 |
The
request
library has a rather large dependency chain that not everybody needs. In cases with very little disk space (e.g. embedded platforms) this can be a problem. This pull request changes some of these dependencies into optional dependencies, which are still installed by default, but are skipped when installed vianpm install --no-optional
. The relevant unit tests are skipped in case the modules are not found on the system.