Skip to content

Add conservative dependency upper bounds while preserving Python 3.13 compatibility#614

Draft
Copilot wants to merge 9 commits intomasterfrom
copilot/update-dependency-constraints
Draft

Add conservative dependency upper bounds while preserving Python 3.13 compatibility#614
Copilot wants to merge 9 commits intomasterfrom
copilot/update-dependency-constraints

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

pySDC had loose dependency constraints (numpy>=1.15.4) that could break weekly CI runs when upstream packages release breaking changes. Added conservative upper bounds to prevent unexpected failures, but only where they don't block Python version compatibility.

Changes

Added upper bounds to core scientific libraries:

  • numpy>=1.15.4,<3.0, scipy>=0.17.1,<2.0, matplotlib>=3.0,<4.0
  • These have well-known major version breaking changes

Removed upper bounds from Python-version-dependent packages:

  • mpi4py>=3.0.0 (not <4.0), mpi4py-fft>=2.0.2 (not <3.0), fenics>=2019.1.0 (not <2020)
  • Upper bounds here prevent updates needed for new Python versions

Preserved project-specific constraints:

  • DAE project: scipy>=0.17.1,<1.15 (numerical precision requirement for index-2 DAE solvers)
  • Added inline comments documenting the reason

Files updated:

  • 4 base environment files (etc/environment-*.yml)
  • 6 project environment files
  • Updated dependency management documentation with clear patterns

Automated dependency lock file workflow

Added .github/workflows/update_lockfiles.yml that runs weekly (Sundays 2 AM UTC, before Monday CI):

  • Generates lock files with exact versions for reproducibility
  • Creates PR when dependencies update
  • CI tests lock files before they reach main branch

Lock files are optional - developers can use flexible source files or reproducible lock files as needed.

Example

# Core libraries - add upper bounds
dependencies:
  - numpy>=1.15.4,<3.0
  - scipy>=0.17.1,<2.0

# Python-dependent - NO upper bounds
  - mpi4py>=3.0.0
  - pytorch>=2.0

# Project-specific - document why
  - scipy>=0.17.1,<1.15  # DAE: numerical precision for index-2 solvers

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 8, 2026 12:12
- Create automated weekly lock file update workflow
- Add scripts for manual lock file generation
- Document automated dependency management approach
- Update source files with conservative upper bounds
- Combine automated lock files with upper bounds for robust dependency management

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
- Document weekly workflow with clear timeline
- Show how automated system prevents CI failures
- Illustrate different update scenarios
- Explain two-layer protection system

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
- Create quick reference guide for common dependency tasks
- Add dependency management section to main README
- Link to all dependency documentation
- Complete documentation suite for automated dependency management

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
@pancetta
Copy link
Member

pancetta commented Feb 8, 2026

@brownbaerchen Not sure this is what you saw with heat?

Copilot AI changed the title [WIP] Update dependency constraints in pyproject.toml and environment.yml Automated dependency management with lock files and upper bounds Feb 8, 2026
Copilot AI requested a review from pancetta February 8, 2026 12:18
Copilot AI and others added 2 commits February 8, 2026 12:25
The DAE project tests require scipy<1.15 due to numerical precision
requirements in the fully implicit index-2 DAE solver tests. Restoring
the original constraint that was inadvertently loosened during the
dependency update.

Fixes:
- test_RungeKuttaDAE.py::testOrderAccuracyFullyImplicitIndexTwo[TrapezoidalRuleDAE]
- test_problems.py::test_DiscontinuousTestDAE_SDC_detection[4]

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
…ement

- Add documentation on when and why to use tighter constraints
- Document DAE project's scipy<1.15 requirement
- Add explanatory comment in DAE environment.yml
- Provide best practices for handling project-specific needs

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
Copilot AI changed the title Automated dependency management with lock files and upper bounds Fix DAE test failures by restoring scipy<1.15 constraint Feb 8, 2026
…unds

Remove upper bounds from mpi4py and mpi4py-fft that were blocking
Python 3.13 compatibility. Upper bounds on these packages prevent
them from updating to versions needed for new Python support.

Changes:
- Remove mpi4py<4.0 constraint (use mpi4py>=3.0.0 only)
- Remove mpi4py-fft<3.0 constraint (use mpi4py-fft>=2.0.2 only)
- Remove fenics<2020 constraint
- Update documentation on when NOT to add upper bounds

This restores Python 3.13 test compatibility that was broken when
upper bounds were added to these packages.

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
Copilot AI changed the title Fix DAE test failures by restoring scipy<1.15 constraint Remove upper bounds from Python-version-dependent packages Feb 8, 2026
Remove mpi4py<4.0 upper bound from etc/environment-pytorch.yml that was
missed in the previous fix. This file was preventing Python 3.13 tests
from passing for the pytorch environment.

All environment files now match master's pattern: no upper bounds on
mpi4py or mpi4py-fft to allow compatibility with new Python versions.

Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
Copilot AI changed the title Remove upper bounds from Python-version-dependent packages Add conservative dependency upper bounds while preserving Python 3.13 compatibility Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants