Skip to content

Dependency cleanup (PR 1 of 3): packaging truth — extras [extras]/[test]/[dev], drop setup.py and sortedcollections - #811

Open
DLWoodruff wants to merge 1 commit into
mainfrom
dependency-cleanup-phase1
Open

Dependency cleanup (PR 1 of 3): packaging truth — extras [extras]/[test]/[dev], drop setup.py and sortedcollections#811
DLWoodruff wants to merge 1 commit into
mainfrom
dependency-cleanup-phase1

Conversation

@DLWoodruff

Copy link
Copy Markdown
Collaborator

This is the first of three PRs implementing the dependency cleanup designed in doc/designs/dependency_cleanup_design.md (included in this PR). Phase 2 will switch the CI runners to install via the new extras; phase 3 will add attempt_import guards to the four opt-in modules that currently crash on import when their optional package is missing.

What this PR does

  • Deletes setup.py. It has been dead weight since 0.14.0: pyproject.toml is authoritative (pip, editable installs, and the publish workflow all use it), while setup.py still said version 0.13.2.dev0 with its own diverged dependency lists.

  • Drops sortedcollections from the hard dependencies — it is imported nowhere in the repository (leftover from removed code). The true hard dependencies are just numpy and pyomo>=6.4.

  • Drops the unused alias extras scipy, pandas, plot (each just installed one identically-named package; nothing in the repo, docs, or CI used them, and pip only warns on unknown extras so stale external installs don't break).

  • Adds three purposeful extras (extras may reference other extras of the same project):

    • extras — every pip-safe optional feature of the library itself: scipy (confidence intervals, prox approx, kkt), pandas (rho CSV, wtracker, phtracker), matplotlib (plotting), dill (pickled bundles), mip (MPS/LP/SMPS input).
    • testextras plus pytest, coverage, addheader (imported by test_headers.py), and gridx-egret (UC tests/examples).
    • devtest plus doc plus ruff; the contributor one-stop shop: pip install -e ".[mpi,dev]".

    Solvers (cplex/gurobipy/xpress) and proprietary-bridge packages (gams, amplpy) are deliberately in no extra — licensing decisions. mpi4py stays only in [mpi] because pip-installing it fails without an MPI toolchain.

  • Updates the install docs (README, quick_start.rst, install_mpi.rst — which now documents what each extra enables — and CLAUDE.md).

Verification

  • Fresh venv: pip install --dry-run -e ".[dev]" resolves correctly (all nested extras expand; no sortedcollections).
  • pip install -e . --no-deps rebuilds fine without setup.py; import mpisppy and the console scripts work.
  • ruff check clean; mpisppy/tests/test_sputils.py passes (136 tests); cd doc && make html builds clean.
  • Repo-wide grep: no remaining references to setup.py, sortedcollections, or the dropped alias extras.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.33%. Comparing base (3749661) to head (1051791).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #811   +/-   ##
=======================================
  Coverage   76.33%   76.33%           
=======================================
  Files         170      170           
  Lines       22628    22628           
=======================================
  Hits        17274    17274           
  Misses       5354     5354           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Delete the stale setup.py (metadata frozen at 0.13.2.dev0; pyproject.toml
  has been authoritative since 0.14.0).
- Drop sortedcollections from dependencies: it is imported nowhere in the
  repository.
- Drop the unused single-package alias extras (scipy, pandas, plot).
- Add three purposeful extras:
    extras = scipy, pandas, matplotlib, dill, mip (every pip-safe optional
             feature of the library)
    test   = extras + pytest, coverage, addheader, gridx-egret
    dev    = test + doc + ruff
  Solvers and proprietary-bridge packages stay out of all extras
  (licensing decisions); mpi4py stays only in [mpi].
- Update install docs (README, quick_start, install_mpi, CLAUDE.md) and add
  the design document.

First of three PRs; see doc/designs/dependency_cleanup_design.md for the
full plan (phase 2 = CI runners consume the extras, phase 3 = attempt_import
guards for the opt-in modules).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DLWoodruff
DLWoodruff force-pushed the dependency-cleanup-phase1 branch from 6e71480 to 1051791 Compare July 23, 2026 21:30
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