explosion / explosion/weasel

Nested variable behavior change from 0.4.3 to 1.0.0

Open
#103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
93
Forks
15
PR merge metrics
No merged PRs in 30d

Description

The following `project.yml` works in weasel 0.4.3 and doesn't in weasel 1.0.0:

```
title: "Testing nested variables"

vars :
vars-level-1:
var-1-1: "var-1-1"
var-1-2: "prefix-${vars.vars-level-1.var-1-1}-suffix"

commands :
- name : test
help : "Testing nested vars"
script :
- echo "Hello ${vars.vars-level-1.var-1-2}"
```
My friend Claude claims that it's a `confection` issue.

weasel 0.4.3 (+ confection==0.1.5 ) produces this:
```
$ python -m weasel run test

==================================== test ====================================
Running command: echo 'Hello prefix-var-1-1-suffix'
Hello prefix-var-1-1-suffix
```

weasel 1.0.0 (+ confection==1.3.3):
```
$ python -m weasel run test
╭──────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ .venv/lib/python3.13/site-packages/weasel/cli/run.py:42 in project_run_cli │
│ │
│ 39 │ │ print_run_help(project_dir, subcommand, parent_command) │
│ 40 │ else: │
│ 41 │ │ overrides = parse_config_overrides(ctx.args) │
│ ❱ 42 │ │ project_run( │
│ 43 │ │ │ project_dir, │
│ 44 │ │ │ subcommand, │
│ 45 │ │ │ overrides=overrides, │
│ │
│ /Users/nrodnova/Projects/eon/monorepo/ds/.venv/lib/python3.13/site-packages/weasel/cli/run.py:81 in project_run │
│ │
│ 78 │ skip_requirements_check (bool): No longer used, deprecated. │
│ 79 │ """ │
│ 80 │ config = load_project_config(project_dir, overrides=overrides) │
│ ❱ 81 │ commands = {cmd["name"]: cmd for cmd in config.get("commands", [])} │
│ 82 │ workflows = config.get("workflows", {}) │
│ 83 │ validate_subcommand(list(commands.keys()), list(workflows.keys()), subcommand) │
│ 84 │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: string indices must be integers, not 'str'
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.