Conversation
| "PIPX_BIN_DIR": "{{ .Virtenv }}/bin" | ||
| }, | ||
| "shell": { | ||
| "init_hook": [ | ||
| "export PATH=\"{{ .Virtenv }}/bin:$PATH\"" | ||
| ] | ||
| } |
There was a problem hiding this comment.
[suggestion]: you can update the path without an init_hook
| "PIPX_BIN_DIR": "{{ .Virtenv }}/bin" | |
| }, | |
| "shell": { | |
| "init_hook": [ | |
| "export PATH=\"{{ .Virtenv }}/bin:$PATH\"" | |
| ] | |
| } | |
| "PIPX_BIN_DIR": "{{ .Virtenv }}/bin", | |
| "PATH": "{{ .Virtenv }}/bin:$PATH" | |
| } |
There was a problem hiding this comment.
I think I already tried this – you can see that I changed it here when pulling out the local versions of the plugins. This was presumably because something didn't work with setting in the path directly (but this is what I was doing before using plugins). I can't remember what didn't work though...
There was a problem hiding this comment.
@jay-aye-see-kay ☝️ I just checked, and I can confirm that it doesn't get added to path by direct manipulation when the app's devbox.json (or maybe another plugin?) also manipulates $PATH – it seems the app one takes precedence, rather than both being run.
There was a problem hiding this comment.
Oh gross, I hadn't seen that issue before - IMO that's a bug in devbox, I'll make some time this week to raise that with them. That's likely an issue for some of the built in plugins, i.e. the ruby plugin uses this approach https://github.com/jetify-com/devbox/blob/main/plugins/ruby.json
Let's leave it as is, it works and there's no downside the the init_hook approach (aside from being a little verbose).
plugins/pipx/plugin.json
Outdated
| "name": "pipx", | ||
| "version": "0.1.0", | ||
| "description": "Installs Pipx and makes it available", | ||
| "packages": ["pipx@latest"], |
There was a problem hiding this comment.
This will be our first plugin that includes a package, up until a few months ago devbox plugins only supported config.
I think this is a good use case for bundling a package in a plugin, but just keep an eye out for surprising behaviour - i.e. I'm not sure how the version of pipx is set and updated.
There was a problem hiding this comment.
yes good call. I think it might make sense to at least pin to a pipx version so that it's repeatable (my guess would be otherwise this is resolved at the app level meaning you could run it twice with different results as it stands although presumably the app's devbox.lock would make it a little more repeatable at least)
| "name": "pipx", | ||
| "version": "0.1.0", | ||
| "description": "Installs Pipx and makes it available", | ||
| "packages": ["[email protected]"], |
There was a problem hiding this comment.
Unless you don't care about Python version, it's better to use version specified form, e.g.:
python312Packages.pipx@latest
There was a problem hiding this comment.
well we kind of don't care about python version, since this is only used for installing helper tooling (poetry). The virtualenv itself is still a different python version specified by the app (that said, I think that the 3.11 which this is giving us might be causing netskope issues, so we might want to try 3.9)
adds plugin to install pipx which can be used to bootstrap other system level python tools, such as Poetry