I’ve done a few interesting python gymnastics to make it easier to work with external libraries, especially for non python experts. The particular idea I’m currently chasing is using the python version distributed with TD to determine which version of a library to install in a directory that’s at a known location from the project file.
The idea here is that you then essentially end up with set of dependencies that can travel with your project rather than making changes to the TD install, or maintaining your own python installation that matches TD’s.
What I’ve been playing with is using a suprocess call to specify which python to use, and where to install the requested package.
Big gotchas so far are that TD is missing some essential pieces to make this easier:
There are a few pieces above that I think I can work out, but it will for sure break when I install a new version of TD.
To that end, something that would be beyond helpful here would be a helper in the
project class. That might look like:
def importExternalLibrary(library_string_name, destination_folder): # does a pip install of the requested library # in the specified directory # adds specified directory to project Paths def importExternalReqs(path_to_requirements_txt, destination_folder): # does a requirements install with the path to the requirements txt # in the specified directory # adds specified directory to project Paths
I know this one isn’t as exciting as some of the other REF’s, but boy golly would it be helpful