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

Add docs to pixi in a devcontainer #1386

Closed
pavelzw opened this issue May 14, 2024 · 1 comment · Fixed by #2220
Closed

Add docs to pixi in a devcontainer #1386

pavelzw opened this issue May 14, 2024 · 1 comment · Fixed by #2220
Labels
✨ enhancement Feature request

Comments

@pavelzw
Copy link
Contributor

pavelzw commented May 14, 2024

Problem description

#997 (comment)
I'll write some stuff in the coming days

@pavelzw pavelzw added the ✨ enhancement Feature request label May 14, 2024
@lgonzalezsa
Copy link

lgonzalezsa commented Sep 2, 2024

How to use pixi with devcontainer?

I'm not sure if my use case falls under "not best practice," but I am trying to leverage the work I did already on my devcontainer and build and run an image to execute the code in the same way I am able to do it in the vscode. In order to do that, I installed and tested the devcontainer npm package.

Main reason to use this workflow is to avoid additional changes when I switch dev testing to production.
The pyproject.toml file points to local packages (file:// based) that are using /workspaces/my_project
I was reading https://github.com/prefix-dev/pixi-docker not sure why my devcontainer does not have any PIXI env variables set as difference when I launch it with vscode. The my_repo_test has the pyproject.toml file. The bottom line is that I cannot use pixi, here example of the failure:

vscode@53f28a8e52ab:/workspaces/my_repo_test$ pixi shell-hook
pixi shell-hook
  x could not find pixi.toml or pyproject.toml which is configured to use pixi

When I was creating the reproducible example, I face this issue that I recall previously happen as well:

gonluisr@gonluisr-workstation:~/github/pixi_devcontainer$ pixi add papermill
? The environment directory seems have to moved! Environments are non-relocatable, moving them can cause issues.

      /workspaces/pixi_devcontainer/.pixi/envs/default -> /home/gonluisr/github/pixi_devcontainer/.pixi/envs/default

This can be fixed by reinstall the environment from the lock-file in the new location.

Do you want to automatically recreate the environment? (y/n) › yes

Here a reproducible example: https://github.com/lgonzalezsa/pixi_devcontainer

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

Successfully merging a pull request may close this issue.

2 participants