diff --git a/.github/workflows/python_build.yaml b/.github/workflows/python_build.yaml index 81b9177b6..275af6c58 100644 --- a/.github/workflows/python_build.yaml +++ b/.github/workflows/python_build.yaml @@ -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 diff --git a/python/pyproject.toml b/python/pyproject.toml index b51621220..4a5726467 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -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" diff --git a/python/scripts/build_utils.py b/python/scripts/build_utils.py index dd78afac1..877658faa 100644 --- a/python/scripts/build_utils.py +++ b/python/scripts/build_utils.py @@ -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 @@ -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(