Check dependencies at runtime as declared in setup.py. #9638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal is to list the requirements exactly once in code (in
setupext.py) and once in the docs (in INSTALL.rst).
Instead of manually importing and checking that (python) dependencies
are installed with the correct versions, rely on pkg_resources, which
allows automatically keeping things in sync with setupext, as well as
correctly check e.g. the complex version requirements on pyparsing.
Remove the overly complex way to specify the minimum numpy version.
Add comments reminding to update INSTALL.rst when the requirements are
changed in setupext.py; reorder dependencies in INSTALL.rst in a more
logical order.
Remove unneeded reference to MATLAB being a registered trademark.
Note that if you are running Matplotlib from source by manipulating
PYTHONPATH, then it will not appear to pkg_resources. In this case,
there is no check for other dependencies (you are assumed to be
responsible enough for that). Conversely, Matplotlib will fail to
import if it is installed into site-packages but some dependency (six,
etc.) is only available in PYTHONPATH instead of being correctly
installed. I think this is acceptable (or we could just completely drop
the import checks and let bad installs fail with normal ImportErrors,
like most other packages do...).
PR Summary
PR Checklist