Jump to content
wintron

Best practice for sharing workflows containing external (Python) dependencies

Recommended Posts

Hi there!

 

I've created a workflow that I want to share with my team, the workflow includes a Python script, which in turn has a dependency on a 3rd party library (the wonderful Requests[1]).

 

Are there any best practices around sharing this workflow with my team, whilst easing friction around the third party dependency? For example, currently I'm advocating dropping down to the command line and installing the Python dependency globally, ideally I'd like to avoid this, if at all possible.

 

Appreciate any pointers.

 

Kind regards!

Steve

 

 

[1] http://docs.python-requests.org/

Share this post


Link to post
You bundle the dependency with your workflow. End of discussion, basically.
 
cd to your workflow in a shell and run: pip install --target . requests
 

 

Asking users to install libraries is a PITA, and is very likely to cause problems down the line as Python doesn't support versioned libraries. Anything that can't be bundled probably has C extensions that need compiling, which is a world of hurt for the person supporting that.
Edited by deanishe

Share this post


Link to post

My favourite pip trick:

 

When you're not sure which Python (or pyenv etc.) the pip command is pointing to, you can use /path/to/the/python -m pip --pip --options pip args

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...