devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Poetry shell missing scripts

Open tlelson opened this issue 5 months ago • 5 comments

What happened?

Scripts from the python package are not available on the path of the devbox shell since updating from 1.7.1.

Details

The example in the devbox repo runs on poetry version 1.7.1

Poetry is a major version ahead of this now and poetry shell is implemented by a plugin. poetry docs

The command itself shows:

Looks like you're trying to use a Poetry command that is not available.

Since Poetry (2.0.0), the shell command is not installed by default. You can use,

  • the new env activate command (recommended); or
  • the shell plugin to install the shell command

Maybe its just the examples that are out of date because I see that the plugin code uses: poetry env use ... instead.

This fork shows 3 steps:

  1. Update poetry
  2. Add a python script to the pyproject.toml
  3. Hack the init_hook to get the script working in the devbox shell.

What the the best way to fix this? Is there another way to do thing without using the poetry installed python?

I am happy to work on the fix.

Steps to reproduce

  1. Follow the 3 small commits in my fork

Command

No response

devbox.json

... see the fork

Devbox version

0.14.2

Nix version

nix (Nix) 2.28.4

What system does this bug occur on?

macOS (Intel)

tlelson avatar Aug 19 '25 05:08 tlelson

Is the init hook in the plugin not working with the new version? AFAICT the env use command is still valid for starting your environment?

Lagoja avatar Aug 19 '25 18:08 Lagoja

I've tested your changes and I think I understand the fixes. Do you want to contribute your change to the project? I'd be happy to test and merge a PR if you open one.

Lagoja avatar Aug 19 '25 18:08 Lagoja

Hi @Lagoja , Thanks, I'd like to make a PR but I would like to clarify that it is acceptable first because it seems to violate the idea that devbox/nix should manage the python interpreter.

Is this acceptable to the project ?

tlelson avatar Aug 19 '25 23:08 tlelson

@Lagoja https://github.com/jetify-com/devbox/pull/2691

tlelson avatar Sep 02 '25 01:09 tlelson

Any movement here @Lagoja ?

tle-abc avatar Sep 30 '25 23:09 tle-abc