diff --git a/examples/development/python/poetry/poetry-demo/devbox.lock b/examples/development/python/poetry/poetry-demo/devbox.lock index 04d0d6516ae..89c8b1442ed 100644 --- a/examples/development/python/poetry/poetry-demo/devbox.lock +++ b/examples/development/python/poetry/poetry-demo/devbox.lock @@ -3,7 +3,7 @@ "packages": { "poetry@1.4": { "last_modified": "2023-05-19T19:44:39Z", - "plugin_version": "0.0.1", + "plugin_version": "0.0.2", "resolved": "github:NixOS/nixpkgs/4a22f6f0a4b4354778f786425babce9a56f6b5d8#poetry", "source": "devbox-search", "version": "1.4.2", diff --git a/internal/impl/devbox.go b/internal/impl/devbox.go index 16e99f198c7..952b59be5e7 100644 --- a/internal/impl/devbox.go +++ b/internal/impl/devbox.go @@ -766,7 +766,6 @@ func (d *Devbox) computeNixEnv(ctx context.Context, usePrintDevEnvCache bool) (m // Append variables from current env if --pure is not passed currentEnv := os.Environ() env, err := d.parseEnvAndExcludeSpecialCases(currentEnv) - if err != nil { return nil, err } diff --git a/plugins/poetry.json b/plugins/poetry.json index 5ee9833d987..c45784c6e6b 100644 --- a/plugins/poetry.json +++ b/plugins/poetry.json @@ -1,15 +1,18 @@ { "name": "poetry", - "version": "0.0.2", + "version": "0.0.3", "readme": "This plugin automatically configures poetry to use the version of python installed in your Devbox shell, instead of the Python version that it is bundled with. Your pyproject.toml must be in the same directory as your devbox.json.", "env": { "POETRY_VIRTUALENVS_IN_PROJECT": "true", "POETRY_VIRTUALENVS_CREATE": "true", "POETRY_VIRTUALENVS_PATH": "{{.Virtenv}}/.virtualenvs" }, + "create_files": { + "{{ .Virtenv }}/bin/initHook.sh": "poetry/initHook.sh" + }, "shell": { "init_hook": [ - "poetry env use $(command -v python) --no-interaction" + "{{ .Virtenv }}/bin/initHook.sh" ] } } diff --git a/plugins/poetry/initHook.sh b/plugins/poetry/initHook.sh new file mode 100644 index 00000000000..b01c5be40f2 --- /dev/null +++ b/plugins/poetry/initHook.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +poetry env use $(command -v python) --no-interaction +