Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{python} placeholder implementation non-portable #249

Open
mih opened this issue Oct 12, 2023 · 0 comments · May be fixed by #250
Open

{python} placeholder implementation non-portable #249

mih opened this issue Oct 12, 2023 · 0 comments · May be fixed by #250
Assignees

Comments

@mih
Copy link
Member

mih commented Oct 12, 2023

I added the support for the placeholder in containers-run with #227. This means it will get resolved before run can see it, and it will enter the run record in resolved form.

This is bad, because this resolved form is as non-portable as the previous setup, if not more.

This change must be amended, the resolution must be performed in run, and here we need to use the placeholder in its escaped form: {{python}}.

A viable approach might be to define datalad.run.substitutions.python=sys.executable

@mih mih self-assigned this Oct 12, 2023
mih added a commit to mih/datalad-container that referenced this issue Oct 12, 2023
This causes worse portability issues than the previous approach
of storing `python(.exe)`.

Instead pass the placeholder on to `datalad run`.

This would now error with

```
command has an unrecognized placeholder: 'python'
```

and requires a further intervention. Three options:

- have datalad-core define
  `datalad.run.substitutions.python=sys.executable`
- wait for datalad#244
  and use `register_config()` to have datalad-container define it
- have datalad-container define it at `containers-run` runtime by
  patching the configuration for the execution time (would have `rerun`
  fail still)
- add the configuration item to the committed dataset config

Closes datalad#249
mih added a commit to mih/datalad-container that referenced this issue Oct 12, 2023
Mostly to avoid the misconceptions that led to datalad#249
@mih mih linked a pull request Oct 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant