Closed isotes closed 4 years ago
This is actually already implemented. You need to set print=1
variable when invoking the import
function, like seen here.
I agree though that moving into a separate function would be a cleaner approach. Perhaps we could add import_file
and deprecate the print=1
functionality. PR welcome if you'd like to take a stab at it.
Aside from 'sourcing' library scripts, it would be great to reuse the download+cache infrastructure for other files, e.g., binaries or scripts in other languages (Ruby, ...) or even simple data files that are used as a dependency. While binaries provide their own challenges regarding the support for different platforms (i.e. having alternate versions) that might be overkill for this project, simply separating the download+cache step from the source step would be already very helpful. I would propose having an additional function next to
import
, e.g., nameimport_file
that performs the download+cache step and returns the local path to make something like this possible: