Closed borchero closed 7 months ago
I'm not sure I understand your use case. Why are you not doing
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.6.0
with:
environments: test
- name: Run tests
run: pixi run -e test pytest
i.e. without shell:...
and with -e test
?
Would it be feasible for pixi run to use the previously installed environment?
This would be a bit awkward since this would change the way pixi behaves just by the environments that are installed. IMO the environments should be thought of as ephermal and not relevant to how pixi run
behaves.
The actual reason for setting up the shell is a bit more contrived (I'm not actually trying to call pytest
but a Go binary which calls another binary that must be in the PATH
), I just wanted to simplify the example here :smile:
That being said, I can, of course, still do pixi run -e test bash -e {0}
and this works nicely, but I was a little puzzled that pixi run bash -e {0}
sets up the default
env when first trying this out. IIRC this is different to how poetry
behaves where you can simply do poetry run xxx
after installing a particular dependency group.
IMO the environments should be thought of as ephermal and not relevant to how pixi run behaves.
Fair enough, I think that this is also reasonable. Nonetheless, we could maybe add a comment to the documentation? There already exists something along these lines but the README kinda suggests that specifying -e <env>
is only relevant when installing multiple environments.
I guess this can be closed, I'd rather continue a similar discussion in #103 :smile:
While this might be expected behavior, it caught me by surprise that
installs the
default
environment along with thetest
environment oncepixi run
is called.Would it be feasible for
pixi run
to use the previously installed environment?