Skip to content

[MNT] remove unnecessary dependencies - numba - #23

Merged
fkiraly merged 2 commits into
mainfrom
remove-numba
Aug 6, 2026
Merged

[MNT] remove unnecessary dependencies - numba#23
fkiraly merged 2 commits into
mainfrom
remove-numba

Conversation

@fkiraly

@fkiraly fkiraly commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Removes unnecessary dependency numba.

numba is only imported in order to deactivate numba in a single test, in case it is there.

Entirely unnecessary.

Copilot AI lite review requested due to automatic review settings August 5, 2026 23:44
@fkiraly fkiraly added the maintenance Continuous integration, unit testing & package distribution label Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 removes numba as a declared dependency and eliminates the only direct usage of numba in the repository (a test-only fixture that disabled JIT during the anomaly model equality test). This keeps PyCaret’s core dependency set smaller and removes test code that was only present to work around numba behavior.

Changes:

  • Dropped numba from pyproject.toml core dependencies.
  • Removed the disable_numba pytest fixture and its related imports from tests/test_models.py.
  • Removed numba from the dependency list reported by pycaret.utils._show_versions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_models.py Removes the test fixture/imports that relied on numba, and updates the anomaly equality test signature accordingly.
pyproject.toml Removes numba from core dependencies to keep the dependency set minimal.
pycaret/utils/_show_versions.py Stops reporting numba as a required dependency.

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

@fkiraly
fkiraly merged commit 345f958 into main Aug 6, 2026
2 of 43 checks passed
fkiraly added a commit that referenced this pull request Aug 8, 2026
Reverts #23 - `numba` seems coupled to tests as well as
one specific estimator.

This feels like bad design and too high coupling, but is outside the
scope of the initial restoration work. Also see discussion in #30.
fkiraly pushed a commit that referenced this pull request Aug 9, 2026
)

Fully passing CI
(https://github.com/WilliamJudge94/sktime-pycaret/actions/runs/31238435952)

## Summary

This PR brings the fork's Python 3.13 compatibility work together with
upstream dependency maintenance. Local `main` now contains
`sktime/pycaret:main` through `7e766c1a`, then adds the fork-specific
compatibility, CI, test, and dependency constraints required to keep the
project working on Python 3.10–3.13.

## What changed and why

### Python 3.13 and dependency compatibility

- Added Python 3.13 support across package metadata, runtime guards, and
CI.
- Added Python-version dependency markers for NumPy, pandas, SciPy,
scikit-learn, LightGBM, Numba, Trio, Matplotlib, SHAP, XGBoost,
pmdarima, and scikit-learn-intelex. These constraints select dependency
versions with Python 3.13 wheels and compatible APIs rather than using
one range for all supported Python releases.
- Added compatibility fixes for NumPy 2, current scikit-learn
validation/metric APIs, SHAP output shapes, Moto, MLflow/cloudpickle
serialization, Joblib cache behavior, and optional dependencies.
- Disabled BATS/TBATS where NumPy 2 compatibility is unavailable,
preventing model discovery from failing during setup.

### Runtime and time-series compatibility

- Added a scikit-learn compatibility layer and updated preprocessing,
metrics, caching, experiment setup, and parallel/logging integrations to
support newer dependency APIs.
- Restored legacy forecasting-horizon split behavior and supports both
current and legacy `sktime` exogenous-variable tags. This preserves the
fork's expected train/test semantics while remaining compatible with
newer `sktime` tag names.
- Added or updated tests for cache persistence, MLflow artifacts, model
behavior, Python 3.13 clustering-engine availability, BATS/TBATS
handling, forecasting tags, and pipeline tag propagation.

### CI and upstream synchronization

- Kept the fork's Python 3.13 CI matrix, notebook coverage, and platform
safeguards, including the macOS/Python-3.13 `daal4py` guard.
- Merged upstream through `7e766c1a`, establishing shared ancestry so
these dependency-maintenance commits will not need to be re-integrated
as a future divergence.
- Retained upstream removals of direct `markupsafe`,
`importlib_metadata`, `nbformat`, and `deprecation` requirements.

## Why selected upstream changes were rolled back locally

`feature/merge_deps_removal` merged `upstream/main` at merge commit
`58c9cff1`. This establishes shared ancestry through upstream commit
`7e766c1a`, preventing the same six upstream commits from being
re-integrated as a future divergence.

The merge preserved this branch's existing Python 3.13 CI matrices and
`daal4py` guard. Two deliberate follow-up commits restore behavior that
upstream removed but this fork requires:

- `e638bea7` — `bug: retain numba test safeguard`
- `5f45a6bf` — `bug: retain wurlitzer logging`

## Upstream commit disposition

| Upstream commit | Subject | Decision | Local outcome and rationale |
| --- | --- | --- | --- |
| `805629fb` | `[MNT] remove stale.yml workflow which automatically
closes issues or PR (#17)` | Kept | The stale issue/PR workflow was
removed as upstream intended. |
| `635416f0` | `[MNT] fix CI - use uv, remove legacy builds (#15)` |
Adapted | Its upstream ancestry is retained. The branch kept its
already-working Python 3.13 CI matrix and stronger
`pytest.importorskip("daal4py")`/macOS guard rather than replacing them
with the older workflow and import changes. The upstream test extra
addition (`pytest-timeout`) is retained through the merge. |
| `345f9581` | `[MNT] remove unnecessary dependencies - numba (#23)` |
Rewritten | The upstream removal was accepted by the merge, then
`e638bea7` restored Numba's Python-version dependency declarations,
version reporting, and the `disable_numba` test fixture. Docker Python
3.13 testing showed that deleting this fixture causes PyOD ABOD to raise
`numba.core.errors.TypingError`; keeping it prevents that regression. |
| `8ad0d2a0` | `[MNT] remove unnecessary deps - notebook/colab related
packages (#22)` | Kept | Removed direct `markupsafe`,
`importlib_metadata`, and `nbformat` requirements while retaining the
branch's Python 3.13 dependency markers. Targeted Docker tests passed. |
| `b1727ca1` | `[MNT] remove unnecessary deps - wurlitzer (#21)` |
Rewritten | The upstream removal was accepted by the merge, then
`5f45a6bf` restored `wurlitzer`, its version report entry, and
`redirect_output`'s C/child-process stdout/stderr capture. This fork
intentionally keeps that logging capability. |
| `7e766c1a` | `[MNT] Remove unused packages - deprecations (#25)` |
Kept | Removed the direct `deprecation` requirement. Targeted Docker
install/import checks passed. |

## Comparison context and remaining risk

At the time of comparison, local `main` was 65 commits ahead and 0
commits behind `sktime/pycaret:main`; all remaining changes are
fork-specific. The highest-risk areas are the broad Python-version
dependency matrix and the custom legacy `sktime` forecasting split. Full
CI across Python 3.10–3.13 remains important to validate the permitted
dependency combinations and platform behavior.

## Conflict resolutions

| File | Resolution |
| --- | --- |
| `.github/workflows/test.yml` | Kept the local workflow because it
already uses `uv` and contains the branch's Python 3.13-focused CI
configuration. |
| `tests/test_clustering_engines.py` | Kept the local
`pytest.importorskip("daal4py")`, macOS/Python-3.13 guard, and
module-based assertions. |
| `pyproject.toml` | Retained local Python-version markers. Applied safe
upstream removals; restored Numba and Wurlitzer through the separate
override commits. |

## Validation

The integrated branch was tested in Docker using `python:3.13-slim` with
`libgomp1` installed for LightGBM:

```text
Python 3.13.14
uv pip install --system --no-cache ".[test]"  # passed
python -m pip check                           # passed
redirect_output() context smoke test          # passed
python -m pytest -q tests/test_models.py      # 5 passed
```

The full CI matrix was not run locally. The Docker validation
specifically confirms the two protected regressions (Numba fixture and
Wurlitzer logging) alongside the dependency merge. CI should validate
the full supported Python 3.10–3.13 matrix before merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Continuous integration, unit testing & package distribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants