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

Tasks do not run in the active environment by default. #1435

Closed
2 tasks done
RaphaelMelanconAtBentley opened this issue May 23, 2024 · 0 comments · Fixed by #1461
Closed
2 tasks done

Tasks do not run in the active environment by default. #1435

RaphaelMelanconAtBentley opened this issue May 23, 2024 · 0 comments · Fixed by #1461
Labels
bug Something isn't working

Comments

@RaphaelMelanconAtBentley

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

[project]
name = "Project"
channels = ["conda-forge"]
platforms = ["linux-64"]

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FEATURES @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
### Python #####################################################################
[feature.python.dependencies]
python = "~=3.11.9"
pip = "~=24.0"

### Testing ####################################################################
[feature.testing.pypi-dependencies]
pytest = "~=8.2.0"
pytest-cov = "~=5.0.0"
pytest-mock = "~=3.14.0"
pytest-xdist = "~=3.6.1"

### Linting ####################################################################
[feature.linting.tasks]
ruff-format = {cmd = ["ruff", "format", "."], cwd = "."}
ruff-format-check = {cmd = ["ruff", "format", "--check", "--verbose"], cwd = "."}
ruff-lint = {cmd = ["ruff", "check", "--fix"], cwd = "."}
ruff-lint-check = {cmd = ["ruff", "check", "--verbose", "--statistics"], cwd = "."}
fix-code = {depends-on = ["ruff-format", "ruff-lint"]}
check-code = {depends-on = ["ruff-format-check", "ruff-lint-check"]}

[feature.linting.pypi-dependencies]
ruff = "~=0.4.0"

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ENVIRONMENTS @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
[environments]
### CI/DC ######################################################################
testing = {features = ["python", "testing", "linting"]}
linting = {features = ["python", "linting"]}

Running pixi shell -e linting then pixi run fix-code results in:

(Project:linting) nonRootUser@07ee445679d4:/workspaces/Project$ pixi run fix-code
? The task 'fix-code' can be run in multiple environments.

Please select an environment to run the task in: ›
❯ testing
  linting

Issue description

Pixi does not seem to care about the active environment when running tasks.

Expected behavior

Should use the activate environment by default if the task is available in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant