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

[Bug]: Issue with Poetry shell using devcontainer or Docker image #1762

Closed
spawnrider opened this issue Jan 30, 2024 · 2 comments
Closed

[Bug]: Issue with Poetry shell using devcontainer or Docker image #1762

spawnrider opened this issue Jan 30, 2024 · 2 comments
Labels
aarch64 aarch64 (or arm64) systems bug Something isn't working darwin macOS systems python Support for Python, pip, Poetry, etc.

Comments

@spawnrider
Copy link

Current Behavior (bug)
I'm currently using Devbox and Poetry to setup a tiny Python project.

{
  "packages": ["[email protected]", "poetry"],
  "env": {
    "POWERLEVEL9K_INSTANT_PROMPT": "off"
  } ,
  "shell": {
    "init_hook": "poetry shell -vvv",
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

I'm using devbox generate devcontainer to generate the .devcontainer and the associated Dockerfile.
When I'm launching the devcontainer using VSCode, I'm facing this issue :
Poetry could not find a pyproject.toml file in /code or its parents

I saw that the Dockerfile having reference to the code folder but I don't have it and the Poetry setup is working perfectly my local environment as you can see below :
image

I can duplicate the pyproject.toml file but ... i think it's not the right way to override this issue...

Expected Behavior (fix)
The Devcontainer must start and initialize devbox and poetry shell as well.

Additional context

devbox version -v                                                                        1 err  17:45:43
Version:     0.8.7
Platform:    darwin_arm64
Commit:      525bb17ed665bb3066fbd3fb9bccec0aa961ecb7
Commit Time: 2024-01-23T19:15:31Z
Go Version:  go1.21.5
Launcher:    0.2.1
@spawnrider spawnrider added the bug Something isn't working label Jan 30, 2024
@gcurtis gcurtis added python Support for Python, pip, Poetry, etc. darwin macOS systems aarch64 aarch64 (or arm64) systems triage Issue needs triage labels Jan 31, 2024
@spawnrider
Copy link
Author

I just found the solution. The issue was that I forgot to add the PyProject.toml file to the generated Dockerfile.
It works perfectly now.

@mohsenari
Copy link
Collaborator

@spawnrider glad you found the solution. Apologies for that. I have made a PR to update our docs and generated dockerfile to notify that you should add your project files and directories.

@gcurtis gcurtis removed the triage Issue needs triage label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aarch64 aarch64 (or arm64) systems bug Something isn't working darwin macOS systems python Support for Python, pip, Poetry, etc.
Development

No branches or pull requests

3 participants