Skip to content

Commit

Permalink
feat: Support environment variable to always use venvs: `PDM_MULTIRUN…
Browse files Browse the repository at this point in the history
…_USE_VENVS=1`

Issue #4: #4
PR #3: #3
  • Loading branch information
DomWeldon authored and pawamoy committed Aug 20, 2023
1 parent 8f8b612 commit 16c647c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ pdm multirun -ei 3.10,3.11 pytest tests/
pdm multirun -ei tests38,tests39 pytest tests/
```

You can set PDM Multirun to use virtual environments by default by
setting the `PDM_MULTIRUN_USE_VENVS` environment variable to `1`.

By default, PDM Multirun reads Python versions (or venv names)
from the `PDM_MULTIRUN_VERSIONS` environment variable.
It is a string of `{major}.{minor}` versions (or venv names),
Expand Down
3 changes: 2 additions & 1 deletion src/pdm_multirun/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pdm.core import Core

PYTHON_VERSIONS = os.getenv("PDM_MULTIRUN_VERSIONS", "").split() or [f"3.{minor}" for minor in range(8, 13)]
USE_VENVS = os.getenv("PDM_MULTIRUN_USE_VENVS", "") == "1"


def _comma_separated_list(value: str) -> list[str]:
Expand Down Expand Up @@ -47,7 +48,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None: # noqa: D102
"-e",
"--venvs",
action="store_true",
default=False,
default=USE_VENVS,
help="Use virtual environments",
)

Expand Down

0 comments on commit 16c647c

Please sign in to comment.