Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibitlity to prioritize environment when running tasks locally #1491

Closed
dennis-wey opened this issue Jun 10, 2024 · 1 comment
Closed
Labels
✨ enhancement Feature request

Comments

@dennis-wey
Copy link
Contributor

dennis-wey commented Jun 10, 2024

Problem description

Consider I have the following environments defined:

[tool.pixi.environments]
prod = {features = ["prod"], solve-group = "prod"}  # used for production
test = {features = ["test", "prod"], solve-group = "prod"} # used for testing with github actions
dev = {features = ["dev", "test", "prod"], solve-group = "prod"} # used for local development

Let's assume I have a task run-service defined in feature prod.

Current behavior
Using pixi run run-service locally will trigger an interactive session where I have to pick the environment.
To run it in non-interactive mode I need to run pixi run -e dev run-service

Desired Behavior
While the current behavior is working, it might be not intuitive for users to either run with -e dev or choose the environment interactively. This is especially true if users are not that familiar with pixi (for example if they only work with the project but didn't set it up and therefore don't know much about pixi).
For such user I like to have the required knowledge about pixi as minimal as possible.

Therefore it would be great if there is a mechanism for pixi to realize during local execution of pixi run run-service to prioritize the dev environment.

Implementation ideas

  • Adding a run_priorization option in the environment table
  • Adding a favorite_env option which can be configured for every task
  • Adding a project-related user-specific pixi configuration, to add prioritized environment

I think I would prefer the first option but depending on other features in the pipeline, another solution might feel more natural.

Let me know, what you think

@dennis-wey dennis-wey added the ✨ enhancement Feature request label Jun 10, 2024
ruben-arts added a commit that referenced this issue Jun 11, 2024
Improve documentation on task logic in multi env. Related to
##1491
jjjermiah pushed a commit to jjjermiah/pixi that referenced this issue Jun 11, 2024
Improve documentation on task logic in multi env. Related to
#prefix-dev#1491
@dennis-wey
Copy link
Contributor Author

I just realized that the use cases I had in mind can be solved by using the default environment as dev environment.
I don't have any use cases for multiple prioritzed environments in a single project and since there were not much reaction to this issue, I think it's safe to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request
Projects
None yet
Development

No branches or pull requests

1 participant