-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Scenario: In a DVC stage, I want to run the main function of a Python module that's located in src/my_package/main.py
in my DVC repository, i.e., python -m my_package.main
. In order to make Python find it, the environment variable PYTHONPATH
needs to be set to src
when running this command.
Currently, this doesn't seem to be possible in an easy way. dvc.yaml
only supports cmd
and doesn't have an env
key. dvc.stage.run
already supports environment variables in theory via run_env
, but they can't be set from outside. I would like a platform-independent way, i.e., no shell-specific syntax and no shell script wrapper, so that my stage runs on any platform.
#1416 is related, but is about parametrization, which I don't need. #2042 and #5332 have been closed in favor of #1416. This issue is explicitly about static, i.e., non-parametrized and non-parametrizing, values of environment variables.
I think DVC would already benefit a lot if static environment variables were supported via an env
key in dvc.yaml
(see #2042) and this would be a good starting point to add parametrization later (#1416).