Demo of versioned dependency install #424
Draft
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.
Draft PR to show a little demo I've put together per our "rapid prototype" discussion on discord (in case you have a few minutes during baby care).
The demo file contains imports as follows:
If you run
demo.py
on a clean environment, the import of theinfer
package will automatically install the specified versions ofarrow
andnumpy
(note these are not the default latest versions) and the latest version of regex.Here's an example running through the demo script:
Some things I've been thinking about as I've been playing with this:
numpy/__init__.py
initializes and imports all its internal packages). Right now this demo uses (fragile) heuristics to determine whether or not the import is important. For unimportant imports (i.e.numpy
internal imports) we turn off the import intercept machinery.numpy
usesModuleNotFoundErrors
to handle some optional internal extensions. This presents a problem for a naive "install every not-found package automatically" strategy.If the wrong version of a requirement is installed, uninstall and then reinstalldemo.py
imports other user-written code)