From ed8a4458c9819f09a172629c17a90b9cd9d66c7c Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 25 May 2023 17:37:22 -0500 Subject: [PATCH] feat: add shim proof of concept --- examples/black | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 examples/black diff --git a/examples/black b/examples/black new file mode 100755 index 0000000..3021468 --- /dev/null +++ b/examples/black @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +""" +Proof of concept output for a 'shim generator' +that would essentially emulate pipx + +A possible cli signature + +viv shim black -o ~/bin/black +""" + +import sys + +sys.path.append("/home/daylin/.viv/src") # noqa +import subprocess +import viv + +if __name__ == "__main__": + vivenv = viv.use( + "black==23.3.0", + "click==8.1.3", + "mypy-extensions==1.0.0", + "packaging==23.1", + "pathspec==0.11.1", + "platformdirs==3.5.1", + ) + sys.exit( + subprocess.run( + [ + vivenv.path / "bin" / "black", + *sys.argv[1:], + ] + ).returncode + )