palmetto / palm-cli

Palm CLI - the tool-belt for data teams

Home Page:https://palm-cli.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pull subprocess into obj commands

ethanknox-palmetto opened this issue · comments

Context
Calling subprocess directly is messy. plus subprocess has breaking changes from python3.7 and up. And as a palm user, I really want a single interface for all palm commands in one place.

Is your feature request related to a problem? Please describe.
when I'm building out commands I not only need to know the palm interface, I need to know the subprocess one.
most of the time I want a simple set of subprocess defaults, so let's provide them.

Describe the solution you'd like
ctx.obj has a run_on_the_metal method, with as close to the run_in_docker API as possible, and really opinionated defaults.
If a user needs something more complex they can import subprocess themselves ;)

Describe alternatives you've considered
keep using subprocess

Additional context
To support older Pythons we will need to use conditional calls to Subprocess - so abstracting this is a really good idea.

Is there an existing feature request for this?

  • I have searched the existing issues

I can see the value here, opinionated defaults are good for guard-rails, and subprocess is still there for anyone who knows what they are doing.

This was wrapped with #30