Skip to content

Also expand parameters in lists of strings - #333

Open
hmaarrfk wants to merge 4 commits into
conda:mainfrom
hmaarrfk:expand_list_items_too
Open

Also expand parameters in lists of strings#333
hmaarrfk wants to merge 4 commits into
conda:mainfrom
hmaarrfk:expand_list_items_too

Conversation

@hmaarrfk

Copy link
Copy Markdown
Contributor

Previously if one had a list of strings, expressions such as {{ PREFIX }} or {{ ENV_NAME }} would not get expanded

  • Add a test

Description

I wanted to write a command that looks like {{ PREFIX }}/bin/my_app-{{ ENV_NAME }}

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review May 17, 2025
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label May 17, 2025
@hmaarrfk
hmaarrfk marked this pull request as ready for review May 17, 2025 21:20
@hmaarrfk
hmaarrfk requested a review from a team as a code owner May 17, 2025 21:20
@hmaarrfk

Copy link
Copy Markdown
Contributor Author

Pointers on where to add a test would be appreciated if you want one.
also need to add tests for: #334

@marcoesters

Copy link
Copy Markdown
Contributor

Pointers on where to add a test would be appreciated if you want one. also need to add tests for: #334

tests/test_api.py is probably the best place for those tests.

Comment thread menuinst/platforms/base.py Outdated
@github-actions

Copy link
Copy Markdown

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions Bot added the stale [bot] marked as stale due to inactivity label Jun 26, 2026
@marcoesters

Copy link
Copy Markdown
Contributor

Not stale - this is a helpful addition, it just needs some tests.

@hmaarrfk
hmaarrfk force-pushed the expand_list_items_too branch from a15d12c to d67aedb Compare June 27, 2026 01:49
@github-actions github-actions Bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Jun 27, 2026
@hmaarrfk
hmaarrfk force-pushed the expand_list_items_too branch from d67aedb to 0796c50 Compare August 15, 2026 12:15
@hmaarrfk

Copy link
Copy Markdown
Contributor Author

kind ping

hmaarrfk and others added 4 commits August 22, 2026 21:28
Previously if one had a list of strings, expressions such as
{{ PREFIX }} or {{ ENV_NAME }} would not get expanded

- [ ] Add a test
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
<details><summary>Claude's draft</summary>

Add `test_render_expands_placeholders_in_lists` covering the new
`Menu.render` behavior: placeholders are now expanded element-wise in
lists and tuples of strings, while non-string items are returned
untouched and scalar strings behave as before.

Resume this Claude session:
```
cd /Users/mark/git/feedstocks/menuinst
claude --resume 6d4c7180-d5eb-4848-baf7-d9c3bded4784
```
</details>
<details><summary>Claude's draft</summary>

Add `news/333-render-lists` documenting the fix under "Bug fixes":
`Menu.render` now expands placeholders in lists and tuples of strings
instead of returning them unchanged.

Filed as a bug fix rather than an enhancement because `MenuItem.render`
already iterated lists element-wise; only the base `Menu.render` bailed
out early, so the two rendering entry points disagreed.

Resume this Claude session:
```
cd /home/mark/git/feedstock
claude --resume cc4f79cc-0611-4c23-a969-4227b4debe3e
```
</details>
@hmaarrfk
hmaarrfk force-pushed the expand_list_items_too branch from 46dd017 to d59e2aa Compare August 23, 2026 01:28
hmaarrfk added a commit to hmaarrfk/menuinst-feedstock that referenced this pull request Aug 23, 2026
<details><summary>Claude's draft</summary>

Refresh this staging branch onto the current feedstock main (menuinst
2.5.2, rattler-build v1 recipe) and carry all four of my open
conda/menuinst pull requests as source patches:

- 333.patch — conda/menuinst#333
  Expand placeholders in lists of strings, not just scalars.
- 334.patch — conda/menuinst#334
  Allow name/command/StartupWMClass/TryExec to be specified per
  target_environment_is_base, and add the linux `run_in_bash` key.
  Rebased onto upstream main: `min_items` -> `min_length` for pydantic
  v2, `Optional[A, B]` -> `Optional[Union[A, B]]`, and SCHEMA_VERSION
  bumped to 1-1-4 with the generated schema/default JSON regenerated so
  `run_in_bash` has a default to resolve against.
- 535.patch — conda/menuinst#535
  Restore the missing f-string prefix on the Icon= desktop entry line.
- 536.patch — conda/menuinst#536
  Pass the opened file or URL to Linux shortcuts via an Exec field code.

334 and 536 both rewrite LinuxMenuItem._command; 536.patch carries the
merged form, which keeps the field-code "$@" trick for the bash-wrapped
case and appends the field code directly when run_in_bash is false.

Build number bumped by 100 and the build restricted to linux-64, since
this is a staging branch for my own channel.

Resume this Claude session:
```
cd /home/mark/git/feedstock/menuinst-feedstock
claude --resume b888d0ac-7cec-4e1e-ac68-9c15e6554011
```
</details>

Claude-Session: https://claude.ai/code/session_0135Eijr6BTzjVHcRcn3JP8w
hmaarrfk added a commit to hmaarrfk/menuinst-feedstock that referenced this pull request Aug 23, 2026
<details><summary>Claude's draft</summary>

Refresh this staging branch onto the current feedstock main (menuinst
2.5.2, rattler-build v1 recipe) and carry all four of my open
conda/menuinst pull requests as source patches:

- 333.patch — conda/menuinst#333
  Expand placeholders in lists of strings, not just scalars.
- 334.patch — conda/menuinst#334
  Allow name/command/StartupWMClass/TryExec to be specified per
  target_environment_is_base, and add the linux `run_in_bash` key.
  Rebased onto upstream main: `min_items` -> `min_length` for pydantic
  v2, `Optional[A, B]` -> `Optional[Union[A, B]]`, and SCHEMA_VERSION
  bumped to 1-1-4 with the generated schema/default JSON regenerated so
  `run_in_bash` has a default to resolve against.
- 535.patch — conda/menuinst#535
  Restore the missing f-string prefix on the Icon= desktop entry line.
- 536.patch — conda/menuinst#536
  Pass the opened file or URL to Linux shortcuts via an Exec field code.

334 and 536 both rewrite LinuxMenuItem._command; 536.patch carries the
merged form, which keeps the field-code "$@" trick for the bash-wrapped
case and appends the field code directly when run_in_bash is false.

Build number bumped by 100 so this can be uploaded to my own channel.
All platforms stay enabled.

Resume this Claude session:
```
cd /home/mark/git/feedstock/menuinst-feedstock
claude --resume b888d0ac-7cec-4e1e-ac68-9c15e6554011
```
</details>

Claude-Session: https://claude.ai/code/session_0135Eijr6BTzjVHcRcn3JP8w
hmaarrfk added a commit to hmaarrfk/menuinst-feedstock that referenced this pull request Aug 23, 2026
<details><summary>Claude's draft</summary>

Rebased onto the noarch-except-windows branch (conda-forge#67) so this staging
build produces one noarch package plus the Windows builds.

Carry all four of my open conda/menuinst pull requests as source
patches:

- 333.patch — conda/menuinst#333
  Expand placeholders in lists of strings, not just scalars.
- 334.patch — conda/menuinst#334
  Allow name/command/StartupWMClass/TryExec to be specified per
  target_environment_is_base, and add the linux `run_in_bash` key.
  Rebased onto upstream main: `min_items` -> `min_length` for pydantic
  v2, `Optional[A, B]` -> `Optional[Union[A, B]]`, and SCHEMA_VERSION
  bumped to 1-1-4 with the generated schema/default JSON regenerated so
  `run_in_bash` has a default to resolve against.
- 535.patch — conda/menuinst#535
  Restore the missing f-string prefix on the Icon= desktop entry line.
- 536.patch — conda/menuinst#536
  Pass the opened file or URL to Linux shortcuts via an Exec field code.

334 and 536 both rewrite LinuxMenuItem._command; 536.patch carries the
merged form, which keeps the field-code "$@" trick for the bash-wrapped
case and appends the field code directly when run_in_bash is false.

Build number bumped by 100 over the base so this can be uploaded to my
own channel.

Resume this Claude session:
```
cd /home/mark/git/feedstock/menuinst-feedstock
claude --resume b888d0ac-7cec-4e1e-ac68-9c15e6554011
```
</details>

Claude-Session: https://claude.ai/code/session_0135Eijr6BTzjVHcRcn3JP8w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA stale::recovered [bot] recovered after being marked as stale

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

4 participants