Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/python_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ jobs:
shell: bash
run: |
# Generate requirements file with all extras
pip-compile pyproject.toml --all-extras -o requirements-all.txt
pip-compile pyproject.toml \
--extra build \
--extra tdms \
--extra hdf5 \
--extra sift-stream \
--extra rosbags \
--extra openssl \
-o requirements-all.txt

- name: Build dependency wheels
working-directory: python
Expand Down
2 changes: 2 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ tdms = ["npTDMS~=1.9"]
rosbags = ["rosbags~=0.0"]
sift-stream = ["sift-stream-bindings>=0.1.2"]
hdf5 = ["h5py~=3.11", "polars~=1.8"]
# Ensure any new user build extras are added to .github/workflows/python_build.yaml

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
Expand Down
15 changes: 11 additions & 4 deletions python/scripts/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,25 @@ def get_extras_from_wheel(wheel_path: str) -> List[str]:
return extras


def get_extra_combinations(extras: List[str]) -> List[str]:
def get_extra_combinations(extras: List[str], exclude: Optional[List[str]] = None) -> List[str]:
"""Generate all possible combinations of extras.

Args:
extras: List of extra names to generate combinations from.
exclude: Optional list of extra names to exclude from combinations.

Returns:
List of comma-separated strings representing each combination of extras.
"""
# Filter out excluded extras
if exclude:
filtered_extras = [extra for extra in extras if extra not in exclude]
else:
filtered_extras = extras

all_combinations = []
for r in range(len(extras) + 1):
all_combinations.extend(",".join(c) for c in combinations(extras, r))
for r in range(len(filtered_extras) + 1):
all_combinations.extend(",".join(c) for c in combinations(filtered_extras, r))
return all_combinations


Expand Down Expand Up @@ -100,7 +107,7 @@ def main():

# Get all extras from the wheel
extras = get_extras_from_wheel(str(wheel_file))
combinations = get_extra_combinations(extras)
combinations = get_extra_combinations(extras, ["development", "docs"])

# Test base installation first
test_install(
Expand Down
Loading