nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.39k stars 56 forks source link

User-defined variable substitution in [tools.poe.env] does not work since 0.26.0 #223

Closed dbohdan closed 2 months ago

dbohdan commented 2 months ago

In Poe 0.25.1 I was able to substitute one [tools.poe.env] variable in another. Since 0.26.0, this no longer works. (Due to #214?)

Let's try the following pyproject.toml file.

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "test"
authors = []
description = ""
version = "0.0.1"

[tool.poe.env]
BASE_DIR = "/foo"
SUBDIR = "${BASE_DIR}/bar/"

[tool.poe.tasks.frobnicate]
cmd = "echo ${SUBDIR}"

Here is how the task frobnicate runs in different versions of Poe.

> pipx install --force poethepoet==0.25.1
Installing to existing venv 'poethepoet'
  installed package poethepoet 0.25.1, installed using Python 3.12.1
  These apps are now globally available
    - poe
done! ✨ 🌟 ✨
> poe frobnicate
Poe => echo /foo/bar/
/foo/bar/
> pipx install --force poethepoet==0.26.0
[...]
done! ✨ 🌟 ✨
> poe frobnicate
Poe => echo /bar/
/bar/
> pipx install --force poethepoet==0.26.1
[...]
done! ✨ 🌟 ✨
> poe frobnicate
Poe => echo /bar/
/bar/
nat-n commented 2 months ago

Hi @dbohdan, thanks for reporting this.

Yep looks like something went wrong with 0.26.0. I'll look into this as soon as I have some time for it.

If you able and willing to contribute a PR with a failing test case that would be a help :)

nat-n commented 2 months ago

This issue is fixed in 0.27.0 🚀