Skip to content

Commit

Permalink
ci: detect Rust plugins explicitly
Browse files Browse the repository at this point in the history
This is to avoid the case where a Rust plugin has a pip
requirements file or a pyproject.toml file for testing purposes,
but we still want to run the generic tests/setup.sh script
rather than attempting to build a Python plugin.
  • Loading branch information
chrisguida authored and vincenzopalazzo committed Feb 5, 2025
1 parent 2055d2e commit 8a3eef7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .ci/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@ def enumerate_plugins(basedir: Path) -> Generator[Plugin, None, None]:
plugins = list(
[x for x in basedir.iterdir() if x.is_dir() and x.name not in exclude]
)
pip_pytest = [x for x in plugins if (x / Path("requirements.txt")).exists()]
# Explicitly detect rust in case there's python testing code
rust_plugins = [x for x in plugins if (x / Path("Cargo.toml")).exists()]
print(f"Rust plugins: {list_plugins(rust_plugins)}")

pip_pytest = [x for x in plugins if (x / Path("requirements.txt")).exists() and x not in rust_plugins]
print(f"Pip plugins: {list_plugins(pip_pytest)}")

poetry_pytest = [x for x in plugins if (x / Path("pyproject.toml")).exists()]
poetry_pytest = [x for x in plugins if (x / Path("pyproject.toml")).exists() and x not in rust_plugins]
print(f"Poetry plugins: {list_plugins(poetry_pytest)}")

other_plugins = [
generic_plugins = [
x for x in plugins if x not in pip_pytest and x not in poetry_pytest
]
print(f"Other plugins: {list_plugins(other_plugins)}")
print(f"Generic plugins (includes Rust): {list_plugins(generic_plugins)}")

for p in sorted(pip_pytest):
yield Plugin(
Expand All @@ -94,7 +98,7 @@ def enumerate_plugins(basedir: Path) -> Generator[Plugin, None, None]:
},
)

for p in sorted(other_plugins):
for p in sorted(generic_plugins):
yield Plugin(
name=p.name,
path=p,
Expand Down

0 comments on commit 8a3eef7

Please sign in to comment.