Skip to content

Fix wheel build failure: Add scipy constraint to build-system#868

Closed
jeongyoonlee wants to merge 1 commit intomasterfrom
jeong/fix_build_system_scipy
Closed

Fix wheel build failure: Add scipy constraint to build-system#868
jeongyoonlee wants to merge 1 commit intomasterfrom
jeong/fix_build_system_scipy

Conversation

@jeongyoonlee
Copy link
Collaborator

Problem

The Ubuntu wheel build is still failing after PR #865 was merged. The build error occurs during scikit-learn installation in the build environment:

Collecting scipy>=1.10.0 (from scikit-learn>=1.6.0)
  Downloading scipy-1.17.0.tar.gz (30.4 MB)
  Run-time dependency scipy-openblas found: NO (tried pkgconfig)
  ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake

CI Failure: https://github.com/uber/causalml/actions/runs/21732447720/job/62689977061

Root Cause

PR #865 added scipy>=1.16.0,<1.17.0 to the runtime dependencies (under [project]), but missed adding it to [build-system] requires.

When building wheels:

  1. ✅ scipy 1.16.3 installs successfully at runtime
  2. But when installing build dependencies, scikit-learn>=1.6.0 requires scipy>=1.10.0
  3. ❌ pip resolves this to scipy 1.17.0 (latest matching >=1.10.0)
  4. ❌ scipy 1.17.0 only has manylinux_2_27 wheels, not manylinux2014
  5. ❌ pip falls back to building from source → OpenBLAS missing → build fails

The Fix

Add scipy>=1.16.0,<1.17.0 to [build-system] requires:

[build-system]
requires = [
    "setuptools>=18.0",
    "wheel",
    "Cython",
    "numpy>=1.18.5",
    "scipy>=1.16.0,<1.17.0",  # ← ADDED: Pin to manylinux2014 wheels
    "scikit-learn>=1.6.0",
]

This ensures scipy 1.16.3 (which has manylinux2014 wheels) is installed before scikit-learn in the build environment, preventing the source build attempt.

Why This Wasn't in PR #865

PR #865 was merged before this issue was fully diagnosed. The initial fix only addressed runtime dependencies, and the build-system issue was discovered later when analyzing the continued CI failures.

Testing

Once merged, the "Upload Python Package" workflow should successfully build wheels without OpenBLAS errors.

🤖 Generated with Claude Code

The Ubuntu wheel build is failing because scikit-learn (a build
dependency) requires scipy>=1.10.0, which resolves to scipy 1.17.0.
Since scipy 1.17.0 only has manylinux_2_27+ wheels (not manylinux2014),
pip tries to build from source, causing an OpenBLAS dependency error.

Error from CI (job 62689977061):
```
Collecting scipy>=1.10.0 (from scikit-learn>=1.6.0)
  Downloading scipy-1.17.0.tar.gz (30.4 MB)
  Run-time dependency scipy-openblas found: NO
  ERROR: Dependency "OpenBLAS" not found
```

By explicitly adding scipy>=1.16.0,<1.17.0 to [build-system] requires,
we ensure scipy 1.16.3 (which has manylinux2014 wheels) is installed
before scikit-learn, preventing the source build fallback.

This completes the fix started in PR #865, which added the runtime
dependency constraint but missed the build-time constraint.

Fixes: https://github.com/uber/causalml/actions/runs/21732447720/job/62689977061

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 6, 2026 00:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Ubuntu wheel build failures by adding the scipy version constraint to the [build-system] requires section. This follows up on PR #865, which only added the constraint to runtime dependencies, missing that the build system also needs this constraint to prevent pip from selecting scipy 1.17.0 during the build process.

Changes:

  • Added scipy>=1.16.0,<1.17.0 to [build-system] requires to ensure manylinux2014-compatible wheels are used during the build process

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeongyoonlee added a commit that referenced this pull request Feb 6, 2026
This PR modernizes CausalML's wheel distribution by upgrading from
manylinux2014 to manylinux_2_28, enabling compatibility with both
scipy 1.16.x and 1.17.x without version pinning.

## Changes

### 1. Upgrade manylinux platform tag (pyproject.toml)
- **Before:** manylinux2014 (glibc 2.17, CentOS 7 base - EOL June 2024)
- **After:** manylinux_2_28 (glibc 2.28, modern standard)

### 2. Remove scipy version constraints
- **pyproject.toml:** `scipy>=1.16.0,<1.17.0` → `scipy>=1.16.0`
- **docs/environment-py311-rtd.yml:** Removed upper bound constraint
- **Benefit:** Support both scipy 1.16.x and 1.17.x automatically

### 3. Document system requirements (docs/installation.rst)
Added new "System Requirements" section documenting:
- Python 3.11+ requirement
- Minimum Linux distributions (Ubuntu 18.04+, RHEL 8+, Debian 10+)
- Build-from-source instructions for older systems

## Why This Change?

### Problems with manylinux2014:
- Based on CentOS 7 (EOL June 2024)
- Required version pinning to avoid scipy 1.17.0
- Prevented access to newer dependency features
- Maintenance burden with explicit constraints

### Benefits of manylinux_2_28:
- Modern, actively maintained standard
- Compatible with scipy 1.16.x AND 1.17.x
- No version pinning needed - pip selects the best version
- Future-proof for upcoming dependencies
- Cleaner dependency declarations

## Compatibility Impact

### Systems That Work:
- Ubuntu 18.04 LTS+ (glibc 2.27+)
- RHEL/CentOS 8+ (glibc 2.28+)
- Debian 10+ (glibc 2.28+)
- All recent macOS and Windows versions

### Systems Requiring Source Build:
- RHEL/CentOS 7 (glibc 2.17)
- Ubuntu 16.04 and earlier
- Debian 9 and earlier

**Note:** CentOS 7 reached EOL in June 2024, and Ubuntu 16.04 EOL
was April 2021, making this upgrade aligned with industry standards.

## scipy Compatibility

CausalML uses these scipy modules:
- scipy.sparse, scipy.stats
- scipy.optimize (fsolve, minimize)
- scipy.special (expit, logit)
- scipy.interpolate (UnivariateSpline)

**None of these are affected by scipy 1.17.0 breaking changes**, which
only impact scipy.spatial.transform. Both scipy 1.16.x and 1.17.x work
correctly with CausalML.

## Testing

Pre-built wheels will now use manylinux_2_28. Users can install with
either scipy version:
- scipy 1.16.3 (stable, has manylinux2014 wheels)
- scipy 1.17.0+ (latest, has manylinux_2_28 wheels)

pip will automatically select the appropriate version based on the
user's system capabilities.

Supersedes: #868 (build-system fix no longer needed with manylinux_2_28)
Closes: #863

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
jeongyoonlee added a commit that referenced this pull request Feb 6, 2026
…onstraints (#869)

* Upgrade to manylinux_2_28 and remove scipy version constraints

This PR modernizes CausalML's wheel distribution by upgrading from
manylinux2014 to manylinux_2_28, enabling compatibility with both
scipy 1.16.x and 1.17.x without version pinning.

## Changes

### 1. Upgrade manylinux platform tag (pyproject.toml)
- **Before:** manylinux2014 (glibc 2.17, CentOS 7 base - EOL June 2024)
- **After:** manylinux_2_28 (glibc 2.28, modern standard)

### 2. Remove scipy version constraints
- **pyproject.toml:** `scipy>=1.16.0,<1.17.0` → `scipy>=1.16.0`
- **docs/environment-py311-rtd.yml:** Removed upper bound constraint
- **Benefit:** Support both scipy 1.16.x and 1.17.x automatically

### 3. Document system requirements (docs/installation.rst)
Added new "System Requirements" section documenting:
- Python 3.11+ requirement
- Minimum Linux distributions (Ubuntu 18.04+, RHEL 8+, Debian 10+)
- Build-from-source instructions for older systems

## Why This Change?

### Problems with manylinux2014:
- Based on CentOS 7 (EOL June 2024)
- Required version pinning to avoid scipy 1.17.0
- Prevented access to newer dependency features
- Maintenance burden with explicit constraints

### Benefits of manylinux_2_28:
- Modern, actively maintained standard
- Compatible with scipy 1.16.x AND 1.17.x
- No version pinning needed - pip selects the best version
- Future-proof for upcoming dependencies
- Cleaner dependency declarations

## Compatibility Impact

### Systems That Work:
- Ubuntu 18.04 LTS+ (glibc 2.27+)
- RHEL/CentOS 8+ (glibc 2.28+)
- Debian 10+ (glibc 2.28+)
- All recent macOS and Windows versions

### Systems Requiring Source Build:
- RHEL/CentOS 7 (glibc 2.17)
- Ubuntu 16.04 and earlier
- Debian 9 and earlier

**Note:** CentOS 7 reached EOL in June 2024, and Ubuntu 16.04 EOL
was April 2021, making this upgrade aligned with industry standards.

## scipy Compatibility

CausalML uses these scipy modules:
- scipy.sparse, scipy.stats
- scipy.optimize (fsolve, minimize)
- scipy.special (expit, logit)
- scipy.interpolate (UnivariateSpline)

**None of these are affected by scipy 1.17.0 breaking changes**, which
only impact scipy.spatial.transform. Both scipy 1.16.x and 1.17.x work
correctly with CausalML.

## Testing

Pre-built wheels will now use manylinux_2_28. Users can install with
either scipy version:
- scipy 1.16.3 (stable, has manylinux2014 wheels)
- scipy 1.17.0+ (latest, has manylinux_2_28 wheels)

pip will automatically select the appropriate version based on the
user's system capabilities.

Supersedes: #868 (build-system fix no longer needed with manylinux_2_28)
Closes: #863

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>

* Fix glibc version requirement: manylinux_2_28 requires glibc 2.28, not 2.27

Copilot correctly identified that Ubuntu 18.04 is NOT compatible with
manylinux_2_28 wheels. Ubuntu 18.04 has glibc 2.27, but manylinux_2_28
requires glibc 2.28 or later.

Changes:
- Updated glibc requirement from 2.27 to 2.28
- Changed minimum Ubuntu version from 18.04 to 20.04 LTS (has glibc 2.31)
- Added Ubuntu 18.04 to the list of distributions requiring source build

This ensures users have accurate information about system requirements.

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>

* Bump version to 0.16.0 and update changelog for breaking changes

This release introduces breaking changes in Linux wheel compatibility
due to the manylinux_2_28 upgrade, warranting a minor version bump
from 0.15.6 to 0.16.0.

Changes:
- Updated version in pyproject.toml: 0.15.6 → 0.16.0
- Added comprehensive 0.16.0 changelog entry documenting:
  - Breaking change: manylinux_2_28 requirement (glibc 2.28+)
  - Affected systems and migration path
  - scipy version pin removal
  - Related PRs (#869, #867, #865, #864)

Breaking Changes:
- Pre-built wheels require Ubuntu 20.04+, RHEL 8+, Debian 10+ (glibc 2.28+)
- Users on Ubuntu 18.04, RHEL 7, etc. must build from source
- Python 3.11+ required (already enforced in previous release)

This follows semantic versioning: minor version bump for backward-
incompatible changes to wheel distribution.

Co-Authored-By: Claude (claude-sonnet-4-5) <noreply@anthropic.com>

---------

Co-authored-by: Claude (claude-sonnet-4-5) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant