Skip to content
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

Consider using extra_requires in setup.py + optional imports #11

Open
bitprophet opened this issue May 24, 2018 · 1 comment
Open

Consider using extra_requires in setup.py + optional imports #11

bitprophet opened this issue May 24, 2018 · 1 comment
Labels

Comments

@bitprophet
Copy link
Member

  • Early in invocations' life we tried using optional imports, e.g. the watch-docs task will yell at you if you don't have watchdog installed.
  • This was found to not scale super great, and since all the other dependencies we grew were pure-Python, we decided not to continue that practice.
  • At this point we do have a nontrivial number of deps, and we're also asking users of Invoke to install Invocations for even the smallest helper like confirm. While users should arguably never be all THAT upset to install something requiring no extra C level deps, it's still not ideal to need a dozen or more.
  • We're experimenting with setuptools' extras_require elsewhere and it may work well here, e.g. invocations vanilla has no deps besides Invoke, invocations[watching] adds watchdog, invocations[complete] adds everything.
  • Unfortunately this still requires try/except wrapping around imports, which as above is not the best thing, but it may be a reasonable sacrifice, especially now that we can offer one 'flavor' of invocations per module or subpackage (as opposed to having, say, 2-4 different warnings per module because of its 2-4 dependencies).
    • I.e. before, we'd need say 4 try/except clauses, 4 different error messages, etc
    • Now we can probably get away with a larger single try/except and a single message saying please pip install invocations[flavor]?
@bitprophet
Copy link
Member Author

note - #13 has a potential patch for this attached as a text file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant