Skip to content

Commit

Permalink
fix: looks for groups instead of skip_install
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Jan 4, 2024
1 parent be0929b commit 317b2bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ groups = test
commands = test
```

If you want to skip the pdm install for some environments, you can set `skip_install = true` in the environment config.
If no groups are specified, the pdm install will be skipped.

A real-world example can be found at this repository's [tox.ini](https://github.com/pdm-project/tox-pdm/blob/main/tox.ini) and
[GitHub Action workflow](https://github.com/pdm-project/tox-pdm/blob/main/.github/workflows/ci.yml).
Expand Down
4 changes: 2 additions & 2 deletions tox_pdm/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def _setup_env(self) -> None:
pdm = self.options.pdm
if pdm not in self.conf["allowlist_externals"]:
self.conf["allowlist_externals"].append(pdm)
if self.conf["skip_install"]:
return
groups = self.conf["groups"]
op = "sync" if self.conf["pdm_sync"] else "install"
cmd = [pdm, op, "--no-self"]
if not groups:
return
for group in groups:
cmd.extend(("--group", group))
set_env: SetEnv = self.conf["setenv"]
Expand Down

0 comments on commit 317b2bc

Please sign in to comment.